* There is no additional cost associated with requesting a return value aside from the small network and processing
* overhead of receiving a larger response. No read capacity units are consumed.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #returnValues} will
* return {@link ReturnValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #returnValuesAsString}.
*
*
* @return Use
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
*
*
*
* The ReturnValues
parameter is used by several DynamoDB operations; however,
* DeleteItem
does not recognize any values other than NONE
or
* ALL_OLD
.
*
* @see ReturnValue
*/
public final String returnValuesAsString() {
return returnValues;
}
/**
* Returns the value of the ReturnConsumedCapacity property for this object.
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #returnConsumedCapacity} will return {@link ReturnConsumedCapacity#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #returnConsumedCapacityAsString}.
*
*
* @return The value of the ReturnConsumedCapacity property for this object.
* @see ReturnConsumedCapacity
*/
public final ReturnConsumedCapacity returnConsumedCapacity() {
return ReturnConsumedCapacity.fromValue(returnConsumedCapacity);
}
/**
* Returns the value of the ReturnConsumedCapacity property for this object.
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #returnConsumedCapacity} will return {@link ReturnConsumedCapacity#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #returnConsumedCapacityAsString}.
*
*
* @return The value of the ReturnConsumedCapacity property for this object.
* @see ReturnConsumedCapacity
*/
public final String returnConsumedCapacityAsString() {
return returnConsumedCapacity;
}
/**
*
* Determines whether item collection metrics are returned. If set to SIZE
, the response includes
* statistics about item collections, if any, that were modified during the operation are returned in the response.
* If set to NONE
(the default), no statistics are returned.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #returnItemCollectionMetrics} will return {@link ReturnItemCollectionMetrics#UNKNOWN_TO_SDK_VERSION}. The
* raw value returned by the service is available from {@link #returnItemCollectionMetricsAsString}.
*
*
* @return Determines whether item collection metrics are returned. If set to SIZE
, the response
* includes statistics about item collections, if any, that were modified during the operation are returned
* in the response. If set to NONE
(the default), no statistics are returned.
* @see ReturnItemCollectionMetrics
*/
public final ReturnItemCollectionMetrics returnItemCollectionMetrics() {
return ReturnItemCollectionMetrics.fromValue(returnItemCollectionMetrics);
}
/**
*
* Determines whether item collection metrics are returned. If set to SIZE
, the response includes
* statistics about item collections, if any, that were modified during the operation are returned in the response.
* If set to NONE
(the default), no statistics are returned.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #returnItemCollectionMetrics} will return {@link ReturnItemCollectionMetrics#UNKNOWN_TO_SDK_VERSION}. The
* raw value returned by the service is available from {@link #returnItemCollectionMetricsAsString}.
*
*
* @return Determines whether item collection metrics are returned. If set to SIZE
, the response
* includes statistics about item collections, if any, that were modified during the operation are returned
* in the response. If set to NONE
(the default), no statistics are returned.
* @see ReturnItemCollectionMetrics
*/
public final String returnItemCollectionMetricsAsString() {
return returnItemCollectionMetrics;
}
/**
*
* A condition that must be satisfied in order for a conditional DeleteItem
to succeed.
*
*
* An expression can contain any of the following:
*
*
*
*
* Functions: attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size
*
*
* These function names are case-sensitive.
*
*
*
*
* Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
*
*
*
*
* Logical operators: AND | OR | NOT
*
*
*
*
* For more information about condition expressions, see Condition Expressions in the Amazon DynamoDB Developer Guide .
*
*
* @return A condition that must be satisfied in order for a conditional DeleteItem
to succeed.
*
* An expression can contain any of the following:
*
*
*
*
* Functions:
* attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size
*
*
* These function names are case-sensitive.
*
*
*
*
* Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
*
*
*
*
* Logical operators: AND | OR | NOT
*
*
*
*
* For more information about condition expressions, see Condition Expressions in the Amazon DynamoDB Developer Guide .
*/
public final String conditionExpression() {
return conditionExpression;
}
/**
* For responses, this returns true if the service returned a value for the ExpressionAttributeNames property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasExpressionAttributeNames() {
return expressionAttributeNames != null && !(expressionAttributeNames instanceof SdkAutoConstructMap);
}
/**
*
* One or more substitution tokens for attribute names in an expression. The following are some use cases for using
* ExpressionAttributeNames
:
*
*
*
*
* To access an attribute whose name conflicts with a DynamoDB reserved word.
*
*
*
*
* To create a placeholder for repeating occurrences of an attribute name in an expression.
*
*
*
*
* To prevent special characters in an attribute name from being misinterpreted in an expression.
*
*
*
*
* Use the # character in an expression to dereference an attribute name. For example, consider the following
* attribute name:
*
*
*
* The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For
* the complete list of reserved words, see Reserved Words in
* the Amazon DynamoDB Developer Guide ). To work around this, you could specify the following for
* ExpressionAttributeNames
:
*
*
*
*
* {"#P":"Percentile"}
*
*
*
*
* You could then use this substitution in an expression, as in this example:
*
*
*
*
* Tokens that begin with the : character are expression attribute values , which are placeholders for
* the actual value at runtime.
*
*
*
* For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide .
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasExpressionAttributeNames} method.
*
*
* @return One or more substitution tokens for attribute names in an expression. The following are some use cases
* for using ExpressionAttributeNames
:
*
*
*
* To access an attribute whose name conflicts with a DynamoDB reserved word.
*
*
*
*
* To create a placeholder for repeating occurrences of an attribute name in an expression.
*
*
*
*
* To prevent special characters in an attribute name from being misinterpreted in an expression.
*
*
*
*
* Use the # character in an expression to dereference an attribute name. For example, consider the
* following attribute name:
*
*
*
* The name of this attribute conflicts with a reserved word, so it cannot be used directly in an
* expression. (For the complete list of reserved words, see Reserved
* Words in the Amazon DynamoDB Developer Guide ). To work around this, you could specify the
* following for ExpressionAttributeNames
:
*
*
*
*
* {"#P":"Percentile"}
*
*
*
*
* You could then use this substitution in an expression, as in this example:
*
*
*
*
* Tokens that begin with the : character are expression attribute values , which are
* placeholders for the actual value at runtime.
*
*
*
* For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide .
*/
public final Map expressionAttributeNames() {
return expressionAttributeNames;
}
/**
* For responses, this returns true if the service returned a value for the ExpressionAttributeValues property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasExpressionAttributeValues() {
return expressionAttributeValues != null && !(expressionAttributeValues instanceof SdkAutoConstructMap);
}
/**
*
* One or more values that can be substituted in an expression.
*
*
* Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that
* you wanted to check whether the value of the ProductStatus attribute was one of the following:
*
*
* Available | Backordered | Discontinued
*
*
* You would first need to specify ExpressionAttributeValues
as follows:
*
*
* { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }
*
*
* You could then use these values in an expression, such as this:
*
*
* ProductStatus IN (:avail, :back, :disc)
*
*
* For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide .
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasExpressionAttributeValues} method.
*
*
* @return One or more values that can be substituted in an expression.
*
* Use the : (colon) character in an expression to dereference an attribute value. For example,
* suppose that you wanted to check whether the value of the ProductStatus attribute was one of the
* following:
*
*
* Available | Backordered | Discontinued
*
*
* You would first need to specify ExpressionAttributeValues
as follows:
*
*
* { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }
*
*
* You could then use these values in an expression, such as this:
*
*
* ProductStatus IN (:avail, :back, :disc)
*
*
* For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide .
*/
public final Map expressionAttributeValues() {
return expressionAttributeValues;
}
/**
*
* An optional parameter that returns the item attributes for a DeleteItem
operation that failed a
* condition check.
*
*
* There is no additional cost associated with requesting a return value aside from the small network and processing
* overhead of receiving a larger response. No read capacity units are consumed.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #returnValuesOnConditionCheckFailure} will return
* {@link ReturnValuesOnConditionCheckFailure#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #returnValuesOnConditionCheckFailureAsString}.
*
*
* @return An optional parameter that returns the item attributes for a DeleteItem
operation that
* failed a condition check.
*
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
* @see ReturnValuesOnConditionCheckFailure
*/
public final ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure() {
return ReturnValuesOnConditionCheckFailure.fromValue(returnValuesOnConditionCheckFailure);
}
/**
*
* An optional parameter that returns the item attributes for a DeleteItem
operation that failed a
* condition check.
*
*
* There is no additional cost associated with requesting a return value aside from the small network and processing
* overhead of receiving a larger response. No read capacity units are consumed.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #returnValuesOnConditionCheckFailure} will return
* {@link ReturnValuesOnConditionCheckFailure#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #returnValuesOnConditionCheckFailureAsString}.
*
*
* @return An optional parameter that returns the item attributes for a DeleteItem
operation that
* failed a condition check.
*
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
* @see ReturnValuesOnConditionCheckFailure
*/
public final String returnValuesOnConditionCheckFailureAsString() {
return returnValuesOnConditionCheckFailure;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(tableName());
hashCode = 31 * hashCode + Objects.hashCode(hasKey() ? key() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasExpected() ? expected() : null);
hashCode = 31 * hashCode + Objects.hashCode(conditionalOperatorAsString());
hashCode = 31 * hashCode + Objects.hashCode(returnValuesAsString());
hashCode = 31 * hashCode + Objects.hashCode(returnConsumedCapacityAsString());
hashCode = 31 * hashCode + Objects.hashCode(returnItemCollectionMetricsAsString());
hashCode = 31 * hashCode + Objects.hashCode(conditionExpression());
hashCode = 31 * hashCode + Objects.hashCode(hasExpressionAttributeNames() ? expressionAttributeNames() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasExpressionAttributeValues() ? expressionAttributeValues() : null);
hashCode = 31 * hashCode + Objects.hashCode(returnValuesOnConditionCheckFailureAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DeleteItemRequest)) {
return false;
}
DeleteItemRequest other = (DeleteItemRequest) obj;
return Objects.equals(tableName(), other.tableName())
&& hasKey() == other.hasKey()
&& Objects.equals(key(), other.key())
&& hasExpected() == other.hasExpected()
&& Objects.equals(expected(), other.expected())
&& Objects.equals(conditionalOperatorAsString(), other.conditionalOperatorAsString())
&& Objects.equals(returnValuesAsString(), other.returnValuesAsString())
&& Objects.equals(returnConsumedCapacityAsString(), other.returnConsumedCapacityAsString())
&& Objects.equals(returnItemCollectionMetricsAsString(), other.returnItemCollectionMetricsAsString())
&& Objects.equals(conditionExpression(), other.conditionExpression())
&& hasExpressionAttributeNames() == other.hasExpressionAttributeNames()
&& Objects.equals(expressionAttributeNames(), other.expressionAttributeNames())
&& hasExpressionAttributeValues() == other.hasExpressionAttributeValues()
&& Objects.equals(expressionAttributeValues(), other.expressionAttributeValues())
&& Objects.equals(returnValuesOnConditionCheckFailureAsString(),
other.returnValuesOnConditionCheckFailureAsString());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("DeleteItemRequest").add("TableName", tableName()).add("Key", hasKey() ? key() : null)
.add("Expected", hasExpected() ? expected() : null).add("ConditionalOperator", conditionalOperatorAsString())
.add("ReturnValues", returnValuesAsString()).add("ReturnConsumedCapacity", returnConsumedCapacityAsString())
.add("ReturnItemCollectionMetrics", returnItemCollectionMetricsAsString())
.add("ConditionExpression", conditionExpression())
.add("ExpressionAttributeNames", hasExpressionAttributeNames() ? expressionAttributeNames() : null)
.add("ExpressionAttributeValues", hasExpressionAttributeValues() ? expressionAttributeValues() : null)
.add("ReturnValuesOnConditionCheckFailure", returnValuesOnConditionCheckFailureAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TableName":
return Optional.ofNullable(clazz.cast(tableName()));
case "Key":
return Optional.ofNullable(clazz.cast(key()));
case "Expected":
return Optional.ofNullable(clazz.cast(expected()));
case "ConditionalOperator":
return Optional.ofNullable(clazz.cast(conditionalOperatorAsString()));
case "ReturnValues":
return Optional.ofNullable(clazz.cast(returnValuesAsString()));
case "ReturnConsumedCapacity":
return Optional.ofNullable(clazz.cast(returnConsumedCapacityAsString()));
case "ReturnItemCollectionMetrics":
return Optional.ofNullable(clazz.cast(returnItemCollectionMetricsAsString()));
case "ConditionExpression":
return Optional.ofNullable(clazz.cast(conditionExpression()));
case "ExpressionAttributeNames":
return Optional.ofNullable(clazz.cast(expressionAttributeNames()));
case "ExpressionAttributeValues":
return Optional.ofNullable(clazz.cast(expressionAttributeValues()));
case "ReturnValuesOnConditionCheckFailure":
return Optional.ofNullable(clazz.cast(returnValuesOnConditionCheckFailureAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((DeleteItemRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends DynamoDbRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* The name of the table from which to delete the item. You can also provide the Amazon Resource Name (ARN) of
* the table in this parameter.
*
*
* @param tableName
* The name of the table from which to delete the item. You can also provide the Amazon Resource Name
* (ARN) of the table in this parameter.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tableName(String tableName);
/**
*
* A map of attribute names to AttributeValue
objects, representing the primary key of the item to
* delete.
*
*
* For the primary key, you must provide all of the key attributes. For example, with a simple primary key, you
* only need to provide a value for the partition key. For a composite primary key, you must provide values for
* both the partition key and the sort key.
*
*
* @param key
* A map of attribute names to AttributeValue
objects, representing the primary key of the
* item to delete.
*
* For the primary key, you must provide all of the key attributes. For example, with a simple primary
* key, you only need to provide a value for the partition key. For a composite primary key, you must
* provide values for both the partition key and the sort key.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder key(Map key);
/**
*
* This is a legacy parameter. Use ConditionExpression
instead. For more information, see Expected in the Amazon DynamoDB Developer Guide .
*
*
* @param expected
* This is a legacy parameter. Use ConditionExpression
instead. For more information, see Expected in the Amazon DynamoDB Developer Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder expected(Map expected);
/**
*
* This is a legacy parameter. Use ConditionExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide .
*
*
* @param conditionalOperator
* This is a legacy parameter. Use ConditionExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide .
* @see ConditionalOperator
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConditionalOperator
*/
Builder conditionalOperator(String conditionalOperator);
/**
*
* This is a legacy parameter. Use ConditionExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide .
*
*
* @param conditionalOperator
* This is a legacy parameter. Use ConditionExpression
instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide .
* @see ConditionalOperator
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConditionalOperator
*/
Builder conditionalOperator(ConditionalOperator conditionalOperator);
/**
*
* Use ReturnValues
if you want to get the item attributes as they appeared before they were
* deleted. For DeleteItem
, the valid values are:
*
*
*
*
* NONE
- If ReturnValues
is not specified, or if its value is NONE
, then
* nothing is returned. (This setting is the default for ReturnValues
.)
*
*
*
*
* ALL_OLD
- The content of the old item is returned.
*
*
*
*
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
*
*
*
* The ReturnValues
parameter is used by several DynamoDB operations; however,
* DeleteItem
does not recognize any values other than NONE
or ALL_OLD
.
*
*
*
* @param returnValues
* Use ReturnValues
if you want to get the item attributes as they appeared before they were
* deleted. For DeleteItem
, the valid values are:
*
*
*
* NONE
- If ReturnValues
is not specified, or if its value is
* NONE
, then nothing is returned. (This setting is the default for
* ReturnValues
.)
*
*
*
*
* ALL_OLD
- The content of the old item is returned.
*
*
*
*
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
*
*
*
* The ReturnValues
parameter is used by several DynamoDB operations; however,
* DeleteItem
does not recognize any values other than NONE
or
* ALL_OLD
.
*
* @see ReturnValue
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReturnValue
*/
Builder returnValues(String returnValues);
/**
*
* Use ReturnValues
if you want to get the item attributes as they appeared before they were
* deleted. For DeleteItem
, the valid values are:
*
*
*
*
* NONE
- If ReturnValues
is not specified, or if its value is NONE
, then
* nothing is returned. (This setting is the default for ReturnValues
.)
*
*
*
*
* ALL_OLD
- The content of the old item is returned.
*
*
*
*
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
*
*
*
* The ReturnValues
parameter is used by several DynamoDB operations; however,
* DeleteItem
does not recognize any values other than NONE
or ALL_OLD
.
*
*
*
* @param returnValues
* Use ReturnValues
if you want to get the item attributes as they appeared before they were
* deleted. For DeleteItem
, the valid values are:
*
*
*
* NONE
- If ReturnValues
is not specified, or if its value is
* NONE
, then nothing is returned. (This setting is the default for
* ReturnValues
.)
*
*
*
*
* ALL_OLD
- The content of the old item is returned.
*
*
*
*
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
*
*
*
* The ReturnValues
parameter is used by several DynamoDB operations; however,
* DeleteItem
does not recognize any values other than NONE
or
* ALL_OLD
.
*
* @see ReturnValue
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReturnValue
*/
Builder returnValues(ReturnValue returnValues);
/**
* Sets the value of the ReturnConsumedCapacity property for this object.
*
* @param returnConsumedCapacity
* The new value for the ReturnConsumedCapacity property for this object.
* @see ReturnConsumedCapacity
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReturnConsumedCapacity
*/
Builder returnConsumedCapacity(String returnConsumedCapacity);
/**
* Sets the value of the ReturnConsumedCapacity property for this object.
*
* @param returnConsumedCapacity
* The new value for the ReturnConsumedCapacity property for this object.
* @see ReturnConsumedCapacity
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReturnConsumedCapacity
*/
Builder returnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity);
/**
*
* Determines whether item collection metrics are returned. If set to SIZE
, the response includes
* statistics about item collections, if any, that were modified during the operation are returned in the
* response. If set to NONE
(the default), no statistics are returned.
*
*
* @param returnItemCollectionMetrics
* Determines whether item collection metrics are returned. If set to SIZE
, the response
* includes statistics about item collections, if any, that were modified during the operation are
* returned in the response. If set to NONE
(the default), no statistics are returned.
* @see ReturnItemCollectionMetrics
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReturnItemCollectionMetrics
*/
Builder returnItemCollectionMetrics(String returnItemCollectionMetrics);
/**
*
* Determines whether item collection metrics are returned. If set to SIZE
, the response includes
* statistics about item collections, if any, that were modified during the operation are returned in the
* response. If set to NONE
(the default), no statistics are returned.
*
*
* @param returnItemCollectionMetrics
* Determines whether item collection metrics are returned. If set to SIZE
, the response
* includes statistics about item collections, if any, that were modified during the operation are
* returned in the response. If set to NONE
(the default), no statistics are returned.
* @see ReturnItemCollectionMetrics
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReturnItemCollectionMetrics
*/
Builder returnItemCollectionMetrics(ReturnItemCollectionMetrics returnItemCollectionMetrics);
/**
*
* A condition that must be satisfied in order for a conditional DeleteItem
to succeed.
*
*
* An expression can contain any of the following:
*
*
*
*
* Functions:
* attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size
*
*
* These function names are case-sensitive.
*
*
*
*
* Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
*
*
*
*
* Logical operators: AND | OR | NOT
*
*
*
*
* For more information about condition expressions, see Condition Expressions in the Amazon DynamoDB Developer Guide .
*
*
* @param conditionExpression
* A condition that must be satisfied in order for a conditional DeleteItem
to succeed.
*
* An expression can contain any of the following:
*
*
*
*
* Functions:
* attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size
*
*
* These function names are case-sensitive.
*
*
*
*
* Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
*
*
*
*
* Logical operators: AND | OR | NOT
*
*
*
*
* For more information about condition expressions, see Condition Expressions in the Amazon DynamoDB Developer Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder conditionExpression(String conditionExpression);
/**
*
* One or more substitution tokens for attribute names in an expression. The following are some use cases for
* using ExpressionAttributeNames
:
*
*
*
*
* To access an attribute whose name conflicts with a DynamoDB reserved word.
*
*
*
*
* To create a placeholder for repeating occurrences of an attribute name in an expression.
*
*
*
*
* To prevent special characters in an attribute name from being misinterpreted in an expression.
*
*
*
*
* Use the # character in an expression to dereference an attribute name. For example, consider the
* following attribute name:
*
*
*
* The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression.
* (For the complete list of reserved words, see Reserved Words
* in the Amazon DynamoDB Developer Guide ). To work around this, you could specify the following for
* ExpressionAttributeNames
:
*
*
*
*
* {"#P":"Percentile"}
*
*
*
*
* You could then use this substitution in an expression, as in this example:
*
*
*
*
* Tokens that begin with the : character are expression attribute values , which are placeholders
* for the actual value at runtime.
*
*
*
* For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide .
*
*
* @param expressionAttributeNames
* One or more substitution tokens for attribute names in an expression. The following are some use cases
* for using ExpressionAttributeNames
:
*
*
*
* To access an attribute whose name conflicts with a DynamoDB reserved word.
*
*
*
*
* To create a placeholder for repeating occurrences of an attribute name in an expression.
*
*
*
*
* To prevent special characters in an attribute name from being misinterpreted in an expression.
*
*
*
*
* Use the # character in an expression to dereference an attribute name. For example, consider
* the following attribute name:
*
*
*
* The name of this attribute conflicts with a reserved word, so it cannot be used directly in an
* expression. (For the complete list of reserved words, see Reserved
* Words in the Amazon DynamoDB Developer Guide ). To work around this, you could specify the
* following for ExpressionAttributeNames
:
*
*
*
*
* {"#P":"Percentile"}
*
*
*
*
* You could then use this substitution in an expression, as in this example:
*
*
*
*
* Tokens that begin with the : character are expression attribute values , which are
* placeholders for the actual value at runtime.
*
*
*
* For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder expressionAttributeNames(Map expressionAttributeNames);
/**
*
* One or more values that can be substituted in an expression.
*
*
* Use the : (colon) character in an expression to dereference an attribute value. For example, suppose
* that you wanted to check whether the value of the ProductStatus attribute was one of the following:
*
*
* Available | Backordered | Discontinued
*
*
* You would first need to specify ExpressionAttributeValues
as follows:
*
*
* { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }
*
*
* You could then use these values in an expression, such as this:
*
*
* ProductStatus IN (:avail, :back, :disc)
*
*
* For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide .
*
*
* @param expressionAttributeValues
* One or more values that can be substituted in an expression.
*
* Use the : (colon) character in an expression to dereference an attribute value. For example,
* suppose that you wanted to check whether the value of the ProductStatus attribute was one of
* the following:
*
*
* Available | Backordered | Discontinued
*
*
* You would first need to specify ExpressionAttributeValues
as follows:
*
*
* { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }
*
*
* You could then use these values in an expression, such as this:
*
*
* ProductStatus IN (:avail, :back, :disc)
*
*
* For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder expressionAttributeValues(Map expressionAttributeValues);
/**
*
* An optional parameter that returns the item attributes for a DeleteItem
operation that failed a
* condition check.
*
*
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
*
*
* @param returnValuesOnConditionCheckFailure
* An optional parameter that returns the item attributes for a DeleteItem
operation that
* failed a condition check.
*
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
* @see ReturnValuesOnConditionCheckFailure
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReturnValuesOnConditionCheckFailure
*/
Builder returnValuesOnConditionCheckFailure(String returnValuesOnConditionCheckFailure);
/**
*
* An optional parameter that returns the item attributes for a DeleteItem
operation that failed a
* condition check.
*
*
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
*
*
* @param returnValuesOnConditionCheckFailure
* An optional parameter that returns the item attributes for a DeleteItem
operation that
* failed a condition check.
*
* There is no additional cost associated with requesting a return value aside from the small network and
* processing overhead of receiving a larger response. No read capacity units are consumed.
* @see ReturnValuesOnConditionCheckFailure
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReturnValuesOnConditionCheckFailure
*/
Builder returnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends DynamoDbRequest.BuilderImpl implements Builder {
private String tableName;
private Map key = DefaultSdkAutoConstructMap.getInstance();
private Map expected = DefaultSdkAutoConstructMap.getInstance();
private String conditionalOperator;
private String returnValues;
private String returnConsumedCapacity;
private String returnItemCollectionMetrics;
private String conditionExpression;
private Map expressionAttributeNames = DefaultSdkAutoConstructMap.getInstance();
private Map expressionAttributeValues = DefaultSdkAutoConstructMap.getInstance();
private String returnValuesOnConditionCheckFailure;
private BuilderImpl() {
}
private BuilderImpl(DeleteItemRequest model) {
super(model);
tableName(model.tableName);
key(model.key);
expected(model.expected);
conditionalOperator(model.conditionalOperator);
returnValues(model.returnValues);
returnConsumedCapacity(model.returnConsumedCapacity);
returnItemCollectionMetrics(model.returnItemCollectionMetrics);
conditionExpression(model.conditionExpression);
expressionAttributeNames(model.expressionAttributeNames);
expressionAttributeValues(model.expressionAttributeValues);
returnValuesOnConditionCheckFailure(model.returnValuesOnConditionCheckFailure);
}
public final String getTableName() {
return tableName;
}
public final void setTableName(String tableName) {
this.tableName = tableName;
}
@Override
public final Builder tableName(String tableName) {
this.tableName = tableName;
return this;
}
public final Map getKey() {
Map result = KeyCopier.copyToBuilder(this.key);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setKey(Map key) {
this.key = KeyCopier.copyFromBuilder(key);
}
@Override
public final Builder key(Map key) {
this.key = KeyCopier.copy(key);
return this;
}
public final Map getExpected() {
Map result = ExpectedAttributeMapCopier.copyToBuilder(this.expected);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setExpected(Map expected) {
this.expected = ExpectedAttributeMapCopier.copyFromBuilder(expected);
}
@Override
public final Builder expected(Map expected) {
this.expected = ExpectedAttributeMapCopier.copy(expected);
return this;
}
public final String getConditionalOperator() {
return conditionalOperator;
}
public final void setConditionalOperator(String conditionalOperator) {
this.conditionalOperator = conditionalOperator;
}
@Override
public final Builder conditionalOperator(String conditionalOperator) {
this.conditionalOperator = conditionalOperator;
return this;
}
@Override
public final Builder conditionalOperator(ConditionalOperator conditionalOperator) {
this.conditionalOperator(conditionalOperator == null ? null : conditionalOperator.toString());
return this;
}
public final String getReturnValues() {
return returnValues;
}
public final void setReturnValues(String returnValues) {
this.returnValues = returnValues;
}
@Override
public final Builder returnValues(String returnValues) {
this.returnValues = returnValues;
return this;
}
@Override
public final Builder returnValues(ReturnValue returnValues) {
this.returnValues(returnValues == null ? null : returnValues.toString());
return this;
}
public final String getReturnConsumedCapacity() {
return returnConsumedCapacity;
}
public final void setReturnConsumedCapacity(String returnConsumedCapacity) {
this.returnConsumedCapacity = returnConsumedCapacity;
}
@Override
public final Builder returnConsumedCapacity(String returnConsumedCapacity) {
this.returnConsumedCapacity = returnConsumedCapacity;
return this;
}
@Override
public final Builder returnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity) {
this.returnConsumedCapacity(returnConsumedCapacity == null ? null : returnConsumedCapacity.toString());
return this;
}
public final String getReturnItemCollectionMetrics() {
return returnItemCollectionMetrics;
}
public final void setReturnItemCollectionMetrics(String returnItemCollectionMetrics) {
this.returnItemCollectionMetrics = returnItemCollectionMetrics;
}
@Override
public final Builder returnItemCollectionMetrics(String returnItemCollectionMetrics) {
this.returnItemCollectionMetrics = returnItemCollectionMetrics;
return this;
}
@Override
public final Builder returnItemCollectionMetrics(ReturnItemCollectionMetrics returnItemCollectionMetrics) {
this.returnItemCollectionMetrics(returnItemCollectionMetrics == null ? null : returnItemCollectionMetrics.toString());
return this;
}
public final String getConditionExpression() {
return conditionExpression;
}
public final void setConditionExpression(String conditionExpression) {
this.conditionExpression = conditionExpression;
}
@Override
public final Builder conditionExpression(String conditionExpression) {
this.conditionExpression = conditionExpression;
return this;
}
public final Map getExpressionAttributeNames() {
if (expressionAttributeNames instanceof SdkAutoConstructMap) {
return null;
}
return expressionAttributeNames;
}
public final void setExpressionAttributeNames(Map expressionAttributeNames) {
this.expressionAttributeNames = ExpressionAttributeNameMapCopier.copy(expressionAttributeNames);
}
@Override
public final Builder expressionAttributeNames(Map expressionAttributeNames) {
this.expressionAttributeNames = ExpressionAttributeNameMapCopier.copy(expressionAttributeNames);
return this;
}
public final Map getExpressionAttributeValues() {
Map result = ExpressionAttributeValueMapCopier
.copyToBuilder(this.expressionAttributeValues);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setExpressionAttributeValues(Map expressionAttributeValues) {
this.expressionAttributeValues = ExpressionAttributeValueMapCopier.copyFromBuilder(expressionAttributeValues);
}
@Override
public final Builder expressionAttributeValues(Map expressionAttributeValues) {
this.expressionAttributeValues = ExpressionAttributeValueMapCopier.copy(expressionAttributeValues);
return this;
}
public final String getReturnValuesOnConditionCheckFailure() {
return returnValuesOnConditionCheckFailure;
}
public final void setReturnValuesOnConditionCheckFailure(String returnValuesOnConditionCheckFailure) {
this.returnValuesOnConditionCheckFailure = returnValuesOnConditionCheckFailure;
}
@Override
public final Builder returnValuesOnConditionCheckFailure(String returnValuesOnConditionCheckFailure) {
this.returnValuesOnConditionCheckFailure = returnValuesOnConditionCheckFailure;
return this;
}
@Override
public final Builder returnValuesOnConditionCheckFailure(
ReturnValuesOnConditionCheckFailure returnValuesOnConditionCheckFailure) {
this.returnValuesOnConditionCheckFailure(returnValuesOnConditionCheckFailure == null ? null
: returnValuesOnConditionCheckFailure.toString());
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public DeleteItemRequest build() {
return new DeleteItemRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}