-
Notifications
You must be signed in to change notification settings - Fork 914
Implement support for ReturnValuesOnConditionCheckFailure #2688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
96aa329
to
efb4816
Compare
c58acda
to
c57df6d
Compare
This change gives customer the ability to specify ReturnValuesOnConditionCheckFailure on the TransactWriteItems operation, i.e. for PutItem, DeleteItem, UpdateItem, and ConditionCheck. In order to support this feature, new Transact*EnhancedRequest objects have been introduced because ReturnValuesOnConditionCheckFailure does not make any sense for the non-TransactWrite operations. Conversely, other options on the non-transact versions like ReturnConsumedCapacity do not make sense for the Transact* versions. As a result of "splitting" off the TransactWrite versions of the operations, the methods on TransactWriteItemsEnhancedRequest that take the non-transact versions have been deprecated. Fixes aws#2283
c57df6d
to
ec5b871
Compare
Duplication failure is expected; it's flagging the duplication of the |
...db-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/ConditionCheck.java
Show resolved
Hide resolved
...n/java/software/amazon/awssdk/enhanced/dynamodb/model/TransactDeleteItemEnhancedRequest.java
Outdated
Show resolved
Hide resolved
...n/java/software/amazon/awssdk/enhanced/dynamodb/model/TransactDeleteItemEnhancedRequest.java
Show resolved
Hide resolved
* {@link ReturnValuesOnConditionCheckFailure#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is | ||
* available from {@link #returnValuesOnConditionCheckFailureAsString}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This Javadoc seems to be somewhat redundantly referring to itself.
...n/java/software/amazon/awssdk/enhanced/dynamodb/model/TransactUpdateItemEnhancedRequest.java
Show resolved
Hide resolved
...n/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/DeleteItemOperation.java
Show resolved
Hide resolved
...n/java/software/amazon/awssdk/enhanced/dynamodb/model/TransactWriteItemsEnhancedRequest.java
Show resolved
Hide resolved
...n/java/software/amazon/awssdk/enhanced/dynamodb/model/TransactWriteItemsEnhancedRequest.java
Outdated
Show resolved
Hide resolved
...n/java/software/amazon/awssdk/enhanced/dynamodb/model/TransactWriteItemsEnhancedRequest.java
Outdated
Show resolved
Hide resolved
try { | ||
enhancedClient.transactWriteItems(transactWriteItemsEnhancedRequest); | ||
fail("Expected TransactionCanceledException to be thrown"); | ||
} catch(TransactionCanceledException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Recommend using assertThatExceptionOfType(..)
instead.
...n/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/UpdateItemOperation.java
Show resolved
Hide resolved
SonarCloud Quality Gate failed. |
Motivation and Context
Fixes #2283
Description
This change gives customer the ability to specify
ReturnValuesOnConditionCheckFailure on the TransactWriteItems operation, i.e.
for PutItem, DeleteItem, UpdateItem, and ConditionCheck.
In order to support this feature, new Transact*EnhancedRequest objects have been
introduced because ReturnValuesOnConditionCheckFailure does not make any sense
for the non-TransactWrite operations. Conversely, other options on the
non-transact versions like ReturnConsumedCapacity do not make sense for the
Transact* versions.
As a result of "splitting" off the TransactWrite versions of the operations, the
methods on TransactWriteItemsEnhancedRequest that take the non-transact versions
have been deprecated.
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsLicense