aws_sdk_dynamodb/operation/update_item/
_update_item_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of an <code>UpdateItem</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateItemInput {
7    /// <p>The name of the table containing the item to update. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
8    pub table_name: ::std::option::Option<::std::string::String>,
9    /// <p>The primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.</p>
10    /// <p>For the primary key, you must provide all of the 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.</p>
11    pub key: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
12    /// <p>This is a legacy parameter. Use <code>UpdateExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html">AttributeUpdates</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
13    pub attribute_updates: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValueUpdate>>,
14    /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html">Expected</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
15    pub expected: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ExpectedAttributeValue>>,
16    /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html">ConditionalOperator</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
17    pub conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
18    /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appear before or after they are successfully updated. For <code>UpdateItem</code>, the valid values are:</p>
19    /// <ul>
20    /// <li>
21    /// <p><code>NONE</code> - If <code>ReturnValues</code> is not specified, or if its value is <code>NONE</code>, then nothing is returned. (This setting is the default for <code>ReturnValues</code>.)</p></li>
22    /// <li>
23    /// <p><code>ALL_OLD</code> - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.</p></li>
24    /// <li>
25    /// <p><code>UPDATED_OLD</code> - Returns only the updated attributes, as they appeared before the UpdateItem operation.</p></li>
26    /// <li>
27    /// <p><code>ALL_NEW</code> - Returns all of the attributes of the item, as they appear after the UpdateItem operation.</p></li>
28    /// <li>
29    /// <p><code>UPDATED_NEW</code> - Returns only the updated attributes, as they appear after the UpdateItem operation.</p></li>
30    /// </ul>
31    /// <p>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.</p>
32    /// <p>The values returned are strongly consistent.</p>
33    pub return_values: ::std::option::Option<crate::types::ReturnValue>,
34    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
35    /// <ul>
36    /// <li>
37    /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
38    /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
39    /// <li>
40    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
41    /// <li>
42    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
43    /// </ul>
44    pub return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
45    /// <p>Determines whether item collection metrics are returned. If set to <code>SIZE</code>, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set to <code>NONE</code> (the default), no statistics are returned.</p>
46    pub return_item_collection_metrics: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>,
47    /// <p>An expression that defines one or more attributes to be updated, the action to be performed on them, and new values for them.</p>
48    /// <p>The following action values are available for <code>UpdateExpression</code>.</p>
49    /// <ul>
50    /// <li>
51    /// <p><code>SET</code> - Adds one or more attributes and values to an item. If any of these attributes already exist, they are replaced by the new values. You can also use <code>SET</code> to add or subtract from an attribute that is of type Number. For example: <code>SET myNum = myNum + :val</code></p>
52    /// <p><code>SET</code> supports the following functions:</p>
53    /// <ul>
54    /// <li>
55    /// <p><code>if_not_exists (path, operand)</code> - if the item does not contain an attribute at the specified path, then <code>if_not_exists</code> evaluates to operand; otherwise, it evaluates to path. You can use this function to avoid overwriting an attribute that may already be present in the item.</p></li>
56    /// <li>
57    /// <p><code>list_append (operand, operand)</code> - evaluates to a list with a new element added to it. You can append the new element to the start or the end of the list by reversing the order of the operands.</p></li>
58    /// </ul>
59    /// <p>These function names are case-sensitive.</p></li>
60    /// <li>
61    /// <p><code>REMOVE</code> - Removes one or more attributes from an item.</p></li>
62    /// <li>
63    /// <p><code>ADD</code> - Adds the specified value to the item, if the attribute does not already exist. If the attribute does exist, then the behavior of <code>ADD</code> depends on the data type of the attribute:</p>
64    /// <ul>
65    /// <li>
66    /// <p>If the existing attribute is a number, and if <code>Value</code> is also a number, then <code>Value</code> is mathematically added to the existing attribute. If <code>Value</code> is a negative number, then it is subtracted from the existing attribute.</p><note>
67    /// <p>If you use <code>ADD</code> to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses <code>0</code> as the initial value.</p>
68    /// <p>Similarly, if you use <code>ADD</code> for an existing item to increment or decrement an attribute value that doesn't exist before the update, DynamoDB uses <code>0</code> as the initial value. For example, suppose that the item you want to update doesn't have an attribute named <code>itemcount</code>, but you decide to <code>ADD</code> the number <code>3</code> to this attribute anyway. DynamoDB will create the <code>itemcount</code> attribute, set its initial value to <code>0</code>, and finally add <code>3</code> to it. The result will be a new <code>itemcount</code> attribute in the item, with a value of <code>3</code>.</p>
69    /// </note></li>
70    /// <li>
71    /// <p>If the existing data type is a set and if <code>Value</code> is also a set, then <code>Value</code> is added to the existing set. For example, if the attribute value is the set <code>\[1,2\]</code>, and the <code>ADD</code> action specified <code>\[3\]</code>, then the final attribute value is <code>\[1,2,3\]</code>. An error occurs if an <code>ADD</code> action is specified for a set attribute and the attribute type specified does not match the existing set type.</p>
72    /// <p>Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the <code>Value</code> must also be a set of strings.</p></li>
73    /// </ul><important>
74    /// <p>The <code>ADD</code> action only supports Number and set data types. In addition, <code>ADD</code> can only be used on top-level attributes, not nested attributes.</p>
75    /// </important></li>
76    /// <li>
77    /// <p><code>DELETE</code> - Deletes an element from a set.</p>
78    /// <p>If a set of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set <code>\[a,b,c\]</code> and the <code>DELETE</code> action specifies <code>\[a,c\]</code>, then the final attribute value is <code>\[b\]</code>. Specifying an empty set is an error.</p><important>
79    /// <p>The <code>DELETE</code> action only supports set data types. In addition, <code>DELETE</code> can only be used on top-level attributes, not nested attributes.</p>
80    /// </important></li>
81    /// </ul>
82    /// <p>You can have many actions in a single expression, such as the following: <code>SET a=:value1, b=:value2 DELETE :value3, :value4, :value5</code></p>
83    /// <p>For more information on update expressions, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html">Modifying Items and Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
84    pub update_expression: ::std::option::Option<::std::string::String>,
85    /// <p>A condition that must be satisfied in order for a conditional update to succeed.</p>
86    /// <p>An expression can contain any of the following:</p>
87    /// <ul>
88    /// <li>
89    /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
90    /// <p>These function names are case-sensitive.</p></li>
91    /// <li>
92    /// <p>Comparison operators: <code>= | &lt;&gt; | &lt; | &gt; | &lt;= | &gt;= | BETWEEN | IN </code></p></li>
93    /// <li>
94    /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
95    /// </ul>
96    /// <p>For more information about condition expressions, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Specifying Conditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
97    pub condition_expression: ::std::option::Option<::std::string::String>,
98    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
99    /// <ul>
100    /// <li>
101    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
102    /// <li>
103    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
104    /// <li>
105    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
106    /// </ul>
107    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
108    /// <ul>
109    /// <li>
110    /// <p><code>Percentile</code></p></li>
111    /// </ul>
112    /// <p>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 <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html">Reserved Words</a> in the <i>Amazon DynamoDB Developer Guide</i>.) To work around this, you could specify the following for <code>ExpressionAttributeNames</code>:</p>
113    /// <ul>
114    /// <li>
115    /// <p><code>{"#P":"Percentile"}</code></p></li>
116    /// </ul>
117    /// <p>You could then use this substitution in an expression, as in this example:</p>
118    /// <ul>
119    /// <li>
120    /// <p><code>#P = :val</code></p></li>
121    /// </ul><note>
122    /// <p>Tokens that begin with the <b>:</b> character are <i>expression attribute values</i>, which are placeholders for the actual value at runtime.</p>
123    /// </note>
124    /// <p>For more information about expression attribute names, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html">Specifying Item Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
125    pub expression_attribute_names: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
126    /// <p>One or more values that can be substituted in an expression.</p>
127    /// <p>Use the <b>:</b> (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the <code>ProductStatus</code> attribute was one of the following:</p>
128    /// <p><code>Available | Backordered | Discontinued</code></p>
129    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
130    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
131    /// <p>You could then use these values in an expression, such as this:</p>
132    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
133    /// <p>For more information on expression attribute values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Condition Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
134    pub expression_attribute_values: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
135    /// <p>An optional parameter that returns the item attributes for an <code>UpdateItem</code> operation that failed a condition check.</p>
136    /// <p>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.</p>
137    pub return_values_on_condition_check_failure: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
138}
139impl UpdateItemInput {
140    /// <p>The name of the table containing the item to update. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
141    pub fn table_name(&self) -> ::std::option::Option<&str> {
142        self.table_name.as_deref()
143    }
144    /// <p>The primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.</p>
145    /// <p>For the primary key, you must provide all of the 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.</p>
146    pub fn key(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
147        self.key.as_ref()
148    }
149    /// <p>This is a legacy parameter. Use <code>UpdateExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html">AttributeUpdates</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
150    pub fn attribute_updates(
151        &self,
152    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValueUpdate>> {
153        self.attribute_updates.as_ref()
154    }
155    /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html">Expected</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
156    pub fn expected(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ExpectedAttributeValue>> {
157        self.expected.as_ref()
158    }
159    /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html">ConditionalOperator</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
160    pub fn conditional_operator(&self) -> ::std::option::Option<&crate::types::ConditionalOperator> {
161        self.conditional_operator.as_ref()
162    }
163    /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appear before or after they are successfully updated. For <code>UpdateItem</code>, the valid values are:</p>
164    /// <ul>
165    /// <li>
166    /// <p><code>NONE</code> - If <code>ReturnValues</code> is not specified, or if its value is <code>NONE</code>, then nothing is returned. (This setting is the default for <code>ReturnValues</code>.)</p></li>
167    /// <li>
168    /// <p><code>ALL_OLD</code> - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.</p></li>
169    /// <li>
170    /// <p><code>UPDATED_OLD</code> - Returns only the updated attributes, as they appeared before the UpdateItem operation.</p></li>
171    /// <li>
172    /// <p><code>ALL_NEW</code> - Returns all of the attributes of the item, as they appear after the UpdateItem operation.</p></li>
173    /// <li>
174    /// <p><code>UPDATED_NEW</code> - Returns only the updated attributes, as they appear after the UpdateItem operation.</p></li>
175    /// </ul>
176    /// <p>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.</p>
177    /// <p>The values returned are strongly consistent.</p>
178    pub fn return_values(&self) -> ::std::option::Option<&crate::types::ReturnValue> {
179        self.return_values.as_ref()
180    }
181    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
182    /// <ul>
183    /// <li>
184    /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
185    /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
186    /// <li>
187    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
188    /// <li>
189    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
190    /// </ul>
191    pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
192        self.return_consumed_capacity.as_ref()
193    }
194    /// <p>Determines whether item collection metrics are returned. If set to <code>SIZE</code>, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set to <code>NONE</code> (the default), no statistics are returned.</p>
195    pub fn return_item_collection_metrics(&self) -> ::std::option::Option<&crate::types::ReturnItemCollectionMetrics> {
196        self.return_item_collection_metrics.as_ref()
197    }
198    /// <p>An expression that defines one or more attributes to be updated, the action to be performed on them, and new values for them.</p>
199    /// <p>The following action values are available for <code>UpdateExpression</code>.</p>
200    /// <ul>
201    /// <li>
202    /// <p><code>SET</code> - Adds one or more attributes and values to an item. If any of these attributes already exist, they are replaced by the new values. You can also use <code>SET</code> to add or subtract from an attribute that is of type Number. For example: <code>SET myNum = myNum + :val</code></p>
203    /// <p><code>SET</code> supports the following functions:</p>
204    /// <ul>
205    /// <li>
206    /// <p><code>if_not_exists (path, operand)</code> - if the item does not contain an attribute at the specified path, then <code>if_not_exists</code> evaluates to operand; otherwise, it evaluates to path. You can use this function to avoid overwriting an attribute that may already be present in the item.</p></li>
207    /// <li>
208    /// <p><code>list_append (operand, operand)</code> - evaluates to a list with a new element added to it. You can append the new element to the start or the end of the list by reversing the order of the operands.</p></li>
209    /// </ul>
210    /// <p>These function names are case-sensitive.</p></li>
211    /// <li>
212    /// <p><code>REMOVE</code> - Removes one or more attributes from an item.</p></li>
213    /// <li>
214    /// <p><code>ADD</code> - Adds the specified value to the item, if the attribute does not already exist. If the attribute does exist, then the behavior of <code>ADD</code> depends on the data type of the attribute:</p>
215    /// <ul>
216    /// <li>
217    /// <p>If the existing attribute is a number, and if <code>Value</code> is also a number, then <code>Value</code> is mathematically added to the existing attribute. If <code>Value</code> is a negative number, then it is subtracted from the existing attribute.</p><note>
218    /// <p>If you use <code>ADD</code> to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses <code>0</code> as the initial value.</p>
219    /// <p>Similarly, if you use <code>ADD</code> for an existing item to increment or decrement an attribute value that doesn't exist before the update, DynamoDB uses <code>0</code> as the initial value. For example, suppose that the item you want to update doesn't have an attribute named <code>itemcount</code>, but you decide to <code>ADD</code> the number <code>3</code> to this attribute anyway. DynamoDB will create the <code>itemcount</code> attribute, set its initial value to <code>0</code>, and finally add <code>3</code> to it. The result will be a new <code>itemcount</code> attribute in the item, with a value of <code>3</code>.</p>
220    /// </note></li>
221    /// <li>
222    /// <p>If the existing data type is a set and if <code>Value</code> is also a set, then <code>Value</code> is added to the existing set. For example, if the attribute value is the set <code>\[1,2\]</code>, and the <code>ADD</code> action specified <code>\[3\]</code>, then the final attribute value is <code>\[1,2,3\]</code>. An error occurs if an <code>ADD</code> action is specified for a set attribute and the attribute type specified does not match the existing set type.</p>
223    /// <p>Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the <code>Value</code> must also be a set of strings.</p></li>
224    /// </ul><important>
225    /// <p>The <code>ADD</code> action only supports Number and set data types. In addition, <code>ADD</code> can only be used on top-level attributes, not nested attributes.</p>
226    /// </important></li>
227    /// <li>
228    /// <p><code>DELETE</code> - Deletes an element from a set.</p>
229    /// <p>If a set of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set <code>\[a,b,c\]</code> and the <code>DELETE</code> action specifies <code>\[a,c\]</code>, then the final attribute value is <code>\[b\]</code>. Specifying an empty set is an error.</p><important>
230    /// <p>The <code>DELETE</code> action only supports set data types. In addition, <code>DELETE</code> can only be used on top-level attributes, not nested attributes.</p>
231    /// </important></li>
232    /// </ul>
233    /// <p>You can have many actions in a single expression, such as the following: <code>SET a=:value1, b=:value2 DELETE :value3, :value4, :value5</code></p>
234    /// <p>For more information on update expressions, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html">Modifying Items and Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
235    pub fn update_expression(&self) -> ::std::option::Option<&str> {
236        self.update_expression.as_deref()
237    }
238    /// <p>A condition that must be satisfied in order for a conditional update to succeed.</p>
239    /// <p>An expression can contain any of the following:</p>
240    /// <ul>
241    /// <li>
242    /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
243    /// <p>These function names are case-sensitive.</p></li>
244    /// <li>
245    /// <p>Comparison operators: <code>= | &lt;&gt; | &lt; | &gt; | &lt;= | &gt;= | BETWEEN | IN </code></p></li>
246    /// <li>
247    /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
248    /// </ul>
249    /// <p>For more information about condition expressions, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Specifying Conditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
250    pub fn condition_expression(&self) -> ::std::option::Option<&str> {
251        self.condition_expression.as_deref()
252    }
253    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
254    /// <ul>
255    /// <li>
256    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
257    /// <li>
258    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
259    /// <li>
260    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
261    /// </ul>
262    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
263    /// <ul>
264    /// <li>
265    /// <p><code>Percentile</code></p></li>
266    /// </ul>
267    /// <p>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 <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html">Reserved Words</a> in the <i>Amazon DynamoDB Developer Guide</i>.) To work around this, you could specify the following for <code>ExpressionAttributeNames</code>:</p>
268    /// <ul>
269    /// <li>
270    /// <p><code>{"#P":"Percentile"}</code></p></li>
271    /// </ul>
272    /// <p>You could then use this substitution in an expression, as in this example:</p>
273    /// <ul>
274    /// <li>
275    /// <p><code>#P = :val</code></p></li>
276    /// </ul><note>
277    /// <p>Tokens that begin with the <b>:</b> character are <i>expression attribute values</i>, which are placeholders for the actual value at runtime.</p>
278    /// </note>
279    /// <p>For more information about expression attribute names, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html">Specifying Item Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
280    pub fn expression_attribute_names(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
281        self.expression_attribute_names.as_ref()
282    }
283    /// <p>One or more values that can be substituted in an expression.</p>
284    /// <p>Use the <b>:</b> (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the <code>ProductStatus</code> attribute was one of the following:</p>
285    /// <p><code>Available | Backordered | Discontinued</code></p>
286    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
287    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
288    /// <p>You could then use these values in an expression, such as this:</p>
289    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
290    /// <p>For more information on expression attribute values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Condition Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
291    pub fn expression_attribute_values(
292        &self,
293    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
294        self.expression_attribute_values.as_ref()
295    }
296    /// <p>An optional parameter that returns the item attributes for an <code>UpdateItem</code> operation that failed a condition check.</p>
297    /// <p>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.</p>
298    pub fn return_values_on_condition_check_failure(&self) -> ::std::option::Option<&crate::types::ReturnValuesOnConditionCheckFailure> {
299        self.return_values_on_condition_check_failure.as_ref()
300    }
301}
302impl UpdateItemInput {
303    /// Creates a new builder-style object to manufacture [`UpdateItemInput`](crate::operation::update_item::UpdateItemInput).
304    pub fn builder() -> crate::operation::update_item::builders::UpdateItemInputBuilder {
305        crate::operation::update_item::builders::UpdateItemInputBuilder::default()
306    }
307}
308
309/// A builder for [`UpdateItemInput`](crate::operation::update_item::UpdateItemInput).
310#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
311#[non_exhaustive]
312pub struct UpdateItemInputBuilder {
313    pub(crate) table_name: ::std::option::Option<::std::string::String>,
314    pub(crate) key: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
315    pub(crate) attribute_updates: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValueUpdate>>,
316    pub(crate) expected: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ExpectedAttributeValue>>,
317    pub(crate) conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
318    pub(crate) return_values: ::std::option::Option<crate::types::ReturnValue>,
319    pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
320    pub(crate) return_item_collection_metrics: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>,
321    pub(crate) update_expression: ::std::option::Option<::std::string::String>,
322    pub(crate) condition_expression: ::std::option::Option<::std::string::String>,
323    pub(crate) expression_attribute_names: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
324    pub(crate) expression_attribute_values: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
325    pub(crate) return_values_on_condition_check_failure: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
326}
327impl UpdateItemInputBuilder {
328    /// <p>The name of the table containing the item to update. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
329    /// This field is required.
330    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
331        self.table_name = ::std::option::Option::Some(input.into());
332        self
333    }
334    /// <p>The name of the table containing the item to update. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
335    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
336        self.table_name = input;
337        self
338    }
339    /// <p>The name of the table containing the item to update. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
340    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
341        &self.table_name
342    }
343    /// Adds a key-value pair to `key`.
344    ///
345    /// To override the contents of this collection use [`set_key`](Self::set_key).
346    ///
347    /// <p>The primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.</p>
348    /// <p>For the primary key, you must provide all of the 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.</p>
349    pub fn key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
350        let mut hash_map = self.key.unwrap_or_default();
351        hash_map.insert(k.into(), v);
352        self.key = ::std::option::Option::Some(hash_map);
353        self
354    }
355    /// <p>The primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.</p>
356    /// <p>For the primary key, you must provide all of the 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.</p>
357    pub fn set_key(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>) -> Self {
358        self.key = input;
359        self
360    }
361    /// <p>The primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.</p>
362    /// <p>For the primary key, you must provide all of the 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.</p>
363    pub fn get_key(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
364        &self.key
365    }
366    /// Adds a key-value pair to `attribute_updates`.
367    ///
368    /// To override the contents of this collection use [`set_attribute_updates`](Self::set_attribute_updates).
369    ///
370    /// <p>This is a legacy parameter. Use <code>UpdateExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html">AttributeUpdates</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
371    pub fn attribute_updates(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValueUpdate) -> Self {
372        let mut hash_map = self.attribute_updates.unwrap_or_default();
373        hash_map.insert(k.into(), v);
374        self.attribute_updates = ::std::option::Option::Some(hash_map);
375        self
376    }
377    /// <p>This is a legacy parameter. Use <code>UpdateExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html">AttributeUpdates</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
378    pub fn set_attribute_updates(
379        mut self,
380        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValueUpdate>>,
381    ) -> Self {
382        self.attribute_updates = input;
383        self
384    }
385    /// <p>This is a legacy parameter. Use <code>UpdateExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html">AttributeUpdates</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
386    pub fn get_attribute_updates(
387        &self,
388    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValueUpdate>> {
389        &self.attribute_updates
390    }
391    /// Adds a key-value pair to `expected`.
392    ///
393    /// To override the contents of this collection use [`set_expected`](Self::set_expected).
394    ///
395    /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html">Expected</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
396    pub fn expected(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ExpectedAttributeValue) -> Self {
397        let mut hash_map = self.expected.unwrap_or_default();
398        hash_map.insert(k.into(), v);
399        self.expected = ::std::option::Option::Some(hash_map);
400        self
401    }
402    /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html">Expected</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
403    pub fn set_expected(
404        mut self,
405        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ExpectedAttributeValue>>,
406    ) -> Self {
407        self.expected = input;
408        self
409    }
410    /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html">Expected</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
411    pub fn get_expected(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ExpectedAttributeValue>> {
412        &self.expected
413    }
414    /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html">ConditionalOperator</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
415    pub fn conditional_operator(mut self, input: crate::types::ConditionalOperator) -> Self {
416        self.conditional_operator = ::std::option::Option::Some(input);
417        self
418    }
419    /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html">ConditionalOperator</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
420    pub fn set_conditional_operator(mut self, input: ::std::option::Option<crate::types::ConditionalOperator>) -> Self {
421        self.conditional_operator = input;
422        self
423    }
424    /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html">ConditionalOperator</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
425    pub fn get_conditional_operator(&self) -> &::std::option::Option<crate::types::ConditionalOperator> {
426        &self.conditional_operator
427    }
428    /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appear before or after they are successfully updated. For <code>UpdateItem</code>, the valid values are:</p>
429    /// <ul>
430    /// <li>
431    /// <p><code>NONE</code> - If <code>ReturnValues</code> is not specified, or if its value is <code>NONE</code>, then nothing is returned. (This setting is the default for <code>ReturnValues</code>.)</p></li>
432    /// <li>
433    /// <p><code>ALL_OLD</code> - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.</p></li>
434    /// <li>
435    /// <p><code>UPDATED_OLD</code> - Returns only the updated attributes, as they appeared before the UpdateItem operation.</p></li>
436    /// <li>
437    /// <p><code>ALL_NEW</code> - Returns all of the attributes of the item, as they appear after the UpdateItem operation.</p></li>
438    /// <li>
439    /// <p><code>UPDATED_NEW</code> - Returns only the updated attributes, as they appear after the UpdateItem operation.</p></li>
440    /// </ul>
441    /// <p>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.</p>
442    /// <p>The values returned are strongly consistent.</p>
443    pub fn return_values(mut self, input: crate::types::ReturnValue) -> Self {
444        self.return_values = ::std::option::Option::Some(input);
445        self
446    }
447    /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appear before or after they are successfully updated. For <code>UpdateItem</code>, the valid values are:</p>
448    /// <ul>
449    /// <li>
450    /// <p><code>NONE</code> - If <code>ReturnValues</code> is not specified, or if its value is <code>NONE</code>, then nothing is returned. (This setting is the default for <code>ReturnValues</code>.)</p></li>
451    /// <li>
452    /// <p><code>ALL_OLD</code> - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.</p></li>
453    /// <li>
454    /// <p><code>UPDATED_OLD</code> - Returns only the updated attributes, as they appeared before the UpdateItem operation.</p></li>
455    /// <li>
456    /// <p><code>ALL_NEW</code> - Returns all of the attributes of the item, as they appear after the UpdateItem operation.</p></li>
457    /// <li>
458    /// <p><code>UPDATED_NEW</code> - Returns only the updated attributes, as they appear after the UpdateItem operation.</p></li>
459    /// </ul>
460    /// <p>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.</p>
461    /// <p>The values returned are strongly consistent.</p>
462    pub fn set_return_values(mut self, input: ::std::option::Option<crate::types::ReturnValue>) -> Self {
463        self.return_values = input;
464        self
465    }
466    /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appear before or after they are successfully updated. For <code>UpdateItem</code>, the valid values are:</p>
467    /// <ul>
468    /// <li>
469    /// <p><code>NONE</code> - If <code>ReturnValues</code> is not specified, or if its value is <code>NONE</code>, then nothing is returned. (This setting is the default for <code>ReturnValues</code>.)</p></li>
470    /// <li>
471    /// <p><code>ALL_OLD</code> - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.</p></li>
472    /// <li>
473    /// <p><code>UPDATED_OLD</code> - Returns only the updated attributes, as they appeared before the UpdateItem operation.</p></li>
474    /// <li>
475    /// <p><code>ALL_NEW</code> - Returns all of the attributes of the item, as they appear after the UpdateItem operation.</p></li>
476    /// <li>
477    /// <p><code>UPDATED_NEW</code> - Returns only the updated attributes, as they appear after the UpdateItem operation.</p></li>
478    /// </ul>
479    /// <p>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.</p>
480    /// <p>The values returned are strongly consistent.</p>
481    pub fn get_return_values(&self) -> &::std::option::Option<crate::types::ReturnValue> {
482        &self.return_values
483    }
484    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
485    /// <ul>
486    /// <li>
487    /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
488    /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
489    /// <li>
490    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
491    /// <li>
492    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
493    /// </ul>
494    pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
495        self.return_consumed_capacity = ::std::option::Option::Some(input);
496        self
497    }
498    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
499    /// <ul>
500    /// <li>
501    /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
502    /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
503    /// <li>
504    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
505    /// <li>
506    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
507    /// </ul>
508    pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
509        self.return_consumed_capacity = input;
510        self
511    }
512    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
513    /// <ul>
514    /// <li>
515    /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
516    /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
517    /// <li>
518    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
519    /// <li>
520    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
521    /// </ul>
522    pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
523        &self.return_consumed_capacity
524    }
525    /// <p>Determines whether item collection metrics are returned. If set to <code>SIZE</code>, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set to <code>NONE</code> (the default), no statistics are returned.</p>
526    pub fn return_item_collection_metrics(mut self, input: crate::types::ReturnItemCollectionMetrics) -> Self {
527        self.return_item_collection_metrics = ::std::option::Option::Some(input);
528        self
529    }
530    /// <p>Determines whether item collection metrics are returned. If set to <code>SIZE</code>, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set to <code>NONE</code> (the default), no statistics are returned.</p>
531    pub fn set_return_item_collection_metrics(mut self, input: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>) -> Self {
532        self.return_item_collection_metrics = input;
533        self
534    }
535    /// <p>Determines whether item collection metrics are returned. If set to <code>SIZE</code>, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set to <code>NONE</code> (the default), no statistics are returned.</p>
536    pub fn get_return_item_collection_metrics(&self) -> &::std::option::Option<crate::types::ReturnItemCollectionMetrics> {
537        &self.return_item_collection_metrics
538    }
539    /// <p>An expression that defines one or more attributes to be updated, the action to be performed on them, and new values for them.</p>
540    /// <p>The following action values are available for <code>UpdateExpression</code>.</p>
541    /// <ul>
542    /// <li>
543    /// <p><code>SET</code> - Adds one or more attributes and values to an item. If any of these attributes already exist, they are replaced by the new values. You can also use <code>SET</code> to add or subtract from an attribute that is of type Number. For example: <code>SET myNum = myNum + :val</code></p>
544    /// <p><code>SET</code> supports the following functions:</p>
545    /// <ul>
546    /// <li>
547    /// <p><code>if_not_exists (path, operand)</code> - if the item does not contain an attribute at the specified path, then <code>if_not_exists</code> evaluates to operand; otherwise, it evaluates to path. You can use this function to avoid overwriting an attribute that may already be present in the item.</p></li>
548    /// <li>
549    /// <p><code>list_append (operand, operand)</code> - evaluates to a list with a new element added to it. You can append the new element to the start or the end of the list by reversing the order of the operands.</p></li>
550    /// </ul>
551    /// <p>These function names are case-sensitive.</p></li>
552    /// <li>
553    /// <p><code>REMOVE</code> - Removes one or more attributes from an item.</p></li>
554    /// <li>
555    /// <p><code>ADD</code> - Adds the specified value to the item, if the attribute does not already exist. If the attribute does exist, then the behavior of <code>ADD</code> depends on the data type of the attribute:</p>
556    /// <ul>
557    /// <li>
558    /// <p>If the existing attribute is a number, and if <code>Value</code> is also a number, then <code>Value</code> is mathematically added to the existing attribute. If <code>Value</code> is a negative number, then it is subtracted from the existing attribute.</p><note>
559    /// <p>If you use <code>ADD</code> to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses <code>0</code> as the initial value.</p>
560    /// <p>Similarly, if you use <code>ADD</code> for an existing item to increment or decrement an attribute value that doesn't exist before the update, DynamoDB uses <code>0</code> as the initial value. For example, suppose that the item you want to update doesn't have an attribute named <code>itemcount</code>, but you decide to <code>ADD</code> the number <code>3</code> to this attribute anyway. DynamoDB will create the <code>itemcount</code> attribute, set its initial value to <code>0</code>, and finally add <code>3</code> to it. The result will be a new <code>itemcount</code> attribute in the item, with a value of <code>3</code>.</p>
561    /// </note></li>
562    /// <li>
563    /// <p>If the existing data type is a set and if <code>Value</code> is also a set, then <code>Value</code> is added to the existing set. For example, if the attribute value is the set <code>\[1,2\]</code>, and the <code>ADD</code> action specified <code>\[3\]</code>, then the final attribute value is <code>\[1,2,3\]</code>. An error occurs if an <code>ADD</code> action is specified for a set attribute and the attribute type specified does not match the existing set type.</p>
564    /// <p>Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the <code>Value</code> must also be a set of strings.</p></li>
565    /// </ul><important>
566    /// <p>The <code>ADD</code> action only supports Number and set data types. In addition, <code>ADD</code> can only be used on top-level attributes, not nested attributes.</p>
567    /// </important></li>
568    /// <li>
569    /// <p><code>DELETE</code> - Deletes an element from a set.</p>
570    /// <p>If a set of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set <code>\[a,b,c\]</code> and the <code>DELETE</code> action specifies <code>\[a,c\]</code>, then the final attribute value is <code>\[b\]</code>. Specifying an empty set is an error.</p><important>
571    /// <p>The <code>DELETE</code> action only supports set data types. In addition, <code>DELETE</code> can only be used on top-level attributes, not nested attributes.</p>
572    /// </important></li>
573    /// </ul>
574    /// <p>You can have many actions in a single expression, such as the following: <code>SET a=:value1, b=:value2 DELETE :value3, :value4, :value5</code></p>
575    /// <p>For more information on update expressions, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html">Modifying Items and Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
576    pub fn update_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
577        self.update_expression = ::std::option::Option::Some(input.into());
578        self
579    }
580    /// <p>An expression that defines one or more attributes to be updated, the action to be performed on them, and new values for them.</p>
581    /// <p>The following action values are available for <code>UpdateExpression</code>.</p>
582    /// <ul>
583    /// <li>
584    /// <p><code>SET</code> - Adds one or more attributes and values to an item. If any of these attributes already exist, they are replaced by the new values. You can also use <code>SET</code> to add or subtract from an attribute that is of type Number. For example: <code>SET myNum = myNum + :val</code></p>
585    /// <p><code>SET</code> supports the following functions:</p>
586    /// <ul>
587    /// <li>
588    /// <p><code>if_not_exists (path, operand)</code> - if the item does not contain an attribute at the specified path, then <code>if_not_exists</code> evaluates to operand; otherwise, it evaluates to path. You can use this function to avoid overwriting an attribute that may already be present in the item.</p></li>
589    /// <li>
590    /// <p><code>list_append (operand, operand)</code> - evaluates to a list with a new element added to it. You can append the new element to the start or the end of the list by reversing the order of the operands.</p></li>
591    /// </ul>
592    /// <p>These function names are case-sensitive.</p></li>
593    /// <li>
594    /// <p><code>REMOVE</code> - Removes one or more attributes from an item.</p></li>
595    /// <li>
596    /// <p><code>ADD</code> - Adds the specified value to the item, if the attribute does not already exist. If the attribute does exist, then the behavior of <code>ADD</code> depends on the data type of the attribute:</p>
597    /// <ul>
598    /// <li>
599    /// <p>If the existing attribute is a number, and if <code>Value</code> is also a number, then <code>Value</code> is mathematically added to the existing attribute. If <code>Value</code> is a negative number, then it is subtracted from the existing attribute.</p><note>
600    /// <p>If you use <code>ADD</code> to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses <code>0</code> as the initial value.</p>
601    /// <p>Similarly, if you use <code>ADD</code> for an existing item to increment or decrement an attribute value that doesn't exist before the update, DynamoDB uses <code>0</code> as the initial value. For example, suppose that the item you want to update doesn't have an attribute named <code>itemcount</code>, but you decide to <code>ADD</code> the number <code>3</code> to this attribute anyway. DynamoDB will create the <code>itemcount</code> attribute, set its initial value to <code>0</code>, and finally add <code>3</code> to it. The result will be a new <code>itemcount</code> attribute in the item, with a value of <code>3</code>.</p>
602    /// </note></li>
603    /// <li>
604    /// <p>If the existing data type is a set and if <code>Value</code> is also a set, then <code>Value</code> is added to the existing set. For example, if the attribute value is the set <code>\[1,2\]</code>, and the <code>ADD</code> action specified <code>\[3\]</code>, then the final attribute value is <code>\[1,2,3\]</code>. An error occurs if an <code>ADD</code> action is specified for a set attribute and the attribute type specified does not match the existing set type.</p>
605    /// <p>Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the <code>Value</code> must also be a set of strings.</p></li>
606    /// </ul><important>
607    /// <p>The <code>ADD</code> action only supports Number and set data types. In addition, <code>ADD</code> can only be used on top-level attributes, not nested attributes.</p>
608    /// </important></li>
609    /// <li>
610    /// <p><code>DELETE</code> - Deletes an element from a set.</p>
611    /// <p>If a set of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set <code>\[a,b,c\]</code> and the <code>DELETE</code> action specifies <code>\[a,c\]</code>, then the final attribute value is <code>\[b\]</code>. Specifying an empty set is an error.</p><important>
612    /// <p>The <code>DELETE</code> action only supports set data types. In addition, <code>DELETE</code> can only be used on top-level attributes, not nested attributes.</p>
613    /// </important></li>
614    /// </ul>
615    /// <p>You can have many actions in a single expression, such as the following: <code>SET a=:value1, b=:value2 DELETE :value3, :value4, :value5</code></p>
616    /// <p>For more information on update expressions, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html">Modifying Items and Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
617    pub fn set_update_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
618        self.update_expression = input;
619        self
620    }
621    /// <p>An expression that defines one or more attributes to be updated, the action to be performed on them, and new values for them.</p>
622    /// <p>The following action values are available for <code>UpdateExpression</code>.</p>
623    /// <ul>
624    /// <li>
625    /// <p><code>SET</code> - Adds one or more attributes and values to an item. If any of these attributes already exist, they are replaced by the new values. You can also use <code>SET</code> to add or subtract from an attribute that is of type Number. For example: <code>SET myNum = myNum + :val</code></p>
626    /// <p><code>SET</code> supports the following functions:</p>
627    /// <ul>
628    /// <li>
629    /// <p><code>if_not_exists (path, operand)</code> - if the item does not contain an attribute at the specified path, then <code>if_not_exists</code> evaluates to operand; otherwise, it evaluates to path. You can use this function to avoid overwriting an attribute that may already be present in the item.</p></li>
630    /// <li>
631    /// <p><code>list_append (operand, operand)</code> - evaluates to a list with a new element added to it. You can append the new element to the start or the end of the list by reversing the order of the operands.</p></li>
632    /// </ul>
633    /// <p>These function names are case-sensitive.</p></li>
634    /// <li>
635    /// <p><code>REMOVE</code> - Removes one or more attributes from an item.</p></li>
636    /// <li>
637    /// <p><code>ADD</code> - Adds the specified value to the item, if the attribute does not already exist. If the attribute does exist, then the behavior of <code>ADD</code> depends on the data type of the attribute:</p>
638    /// <ul>
639    /// <li>
640    /// <p>If the existing attribute is a number, and if <code>Value</code> is also a number, then <code>Value</code> is mathematically added to the existing attribute. If <code>Value</code> is a negative number, then it is subtracted from the existing attribute.</p><note>
641    /// <p>If you use <code>ADD</code> to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses <code>0</code> as the initial value.</p>
642    /// <p>Similarly, if you use <code>ADD</code> for an existing item to increment or decrement an attribute value that doesn't exist before the update, DynamoDB uses <code>0</code> as the initial value. For example, suppose that the item you want to update doesn't have an attribute named <code>itemcount</code>, but you decide to <code>ADD</code> the number <code>3</code> to this attribute anyway. DynamoDB will create the <code>itemcount</code> attribute, set its initial value to <code>0</code>, and finally add <code>3</code> to it. The result will be a new <code>itemcount</code> attribute in the item, with a value of <code>3</code>.</p>
643    /// </note></li>
644    /// <li>
645    /// <p>If the existing data type is a set and if <code>Value</code> is also a set, then <code>Value</code> is added to the existing set. For example, if the attribute value is the set <code>\[1,2\]</code>, and the <code>ADD</code> action specified <code>\[3\]</code>, then the final attribute value is <code>\[1,2,3\]</code>. An error occurs if an <code>ADD</code> action is specified for a set attribute and the attribute type specified does not match the existing set type.</p>
646    /// <p>Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the <code>Value</code> must also be a set of strings.</p></li>
647    /// </ul><important>
648    /// <p>The <code>ADD</code> action only supports Number and set data types. In addition, <code>ADD</code> can only be used on top-level attributes, not nested attributes.</p>
649    /// </important></li>
650    /// <li>
651    /// <p><code>DELETE</code> - Deletes an element from a set.</p>
652    /// <p>If a set of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set <code>\[a,b,c\]</code> and the <code>DELETE</code> action specifies <code>\[a,c\]</code>, then the final attribute value is <code>\[b\]</code>. Specifying an empty set is an error.</p><important>
653    /// <p>The <code>DELETE</code> action only supports set data types. In addition, <code>DELETE</code> can only be used on top-level attributes, not nested attributes.</p>
654    /// </important></li>
655    /// </ul>
656    /// <p>You can have many actions in a single expression, such as the following: <code>SET a=:value1, b=:value2 DELETE :value3, :value4, :value5</code></p>
657    /// <p>For more information on update expressions, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html">Modifying Items and Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
658    pub fn get_update_expression(&self) -> &::std::option::Option<::std::string::String> {
659        &self.update_expression
660    }
661    /// <p>A condition that must be satisfied in order for a conditional update to succeed.</p>
662    /// <p>An expression can contain any of the following:</p>
663    /// <ul>
664    /// <li>
665    /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
666    /// <p>These function names are case-sensitive.</p></li>
667    /// <li>
668    /// <p>Comparison operators: <code>= | &lt;&gt; | &lt; | &gt; | &lt;= | &gt;= | BETWEEN | IN </code></p></li>
669    /// <li>
670    /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
671    /// </ul>
672    /// <p>For more information about condition expressions, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Specifying Conditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
673    pub fn condition_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
674        self.condition_expression = ::std::option::Option::Some(input.into());
675        self
676    }
677    /// <p>A condition that must be satisfied in order for a conditional update to succeed.</p>
678    /// <p>An expression can contain any of the following:</p>
679    /// <ul>
680    /// <li>
681    /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
682    /// <p>These function names are case-sensitive.</p></li>
683    /// <li>
684    /// <p>Comparison operators: <code>= | &lt;&gt; | &lt; | &gt; | &lt;= | &gt;= | BETWEEN | IN </code></p></li>
685    /// <li>
686    /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
687    /// </ul>
688    /// <p>For more information about condition expressions, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Specifying Conditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
689    pub fn set_condition_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
690        self.condition_expression = input;
691        self
692    }
693    /// <p>A condition that must be satisfied in order for a conditional update to succeed.</p>
694    /// <p>An expression can contain any of the following:</p>
695    /// <ul>
696    /// <li>
697    /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
698    /// <p>These function names are case-sensitive.</p></li>
699    /// <li>
700    /// <p>Comparison operators: <code>= | &lt;&gt; | &lt; | &gt; | &lt;= | &gt;= | BETWEEN | IN </code></p></li>
701    /// <li>
702    /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
703    /// </ul>
704    /// <p>For more information about condition expressions, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Specifying Conditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
705    pub fn get_condition_expression(&self) -> &::std::option::Option<::std::string::String> {
706        &self.condition_expression
707    }
708    /// Adds a key-value pair to `expression_attribute_names`.
709    ///
710    /// To override the contents of this collection use [`set_expression_attribute_names`](Self::set_expression_attribute_names).
711    ///
712    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
713    /// <ul>
714    /// <li>
715    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
716    /// <li>
717    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
718    /// <li>
719    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
720    /// </ul>
721    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
722    /// <ul>
723    /// <li>
724    /// <p><code>Percentile</code></p></li>
725    /// </ul>
726    /// <p>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 <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html">Reserved Words</a> in the <i>Amazon DynamoDB Developer Guide</i>.) To work around this, you could specify the following for <code>ExpressionAttributeNames</code>:</p>
727    /// <ul>
728    /// <li>
729    /// <p><code>{"#P":"Percentile"}</code></p></li>
730    /// </ul>
731    /// <p>You could then use this substitution in an expression, as in this example:</p>
732    /// <ul>
733    /// <li>
734    /// <p><code>#P = :val</code></p></li>
735    /// </ul><note>
736    /// <p>Tokens that begin with the <b>:</b> character are <i>expression attribute values</i>, which are placeholders for the actual value at runtime.</p>
737    /// </note>
738    /// <p>For more information about expression attribute names, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html">Specifying Item Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
739    pub fn expression_attribute_names(
740        mut self,
741        k: impl ::std::convert::Into<::std::string::String>,
742        v: impl ::std::convert::Into<::std::string::String>,
743    ) -> Self {
744        let mut hash_map = self.expression_attribute_names.unwrap_or_default();
745        hash_map.insert(k.into(), v.into());
746        self.expression_attribute_names = ::std::option::Option::Some(hash_map);
747        self
748    }
749    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
750    /// <ul>
751    /// <li>
752    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
753    /// <li>
754    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
755    /// <li>
756    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
757    /// </ul>
758    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
759    /// <ul>
760    /// <li>
761    /// <p><code>Percentile</code></p></li>
762    /// </ul>
763    /// <p>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 <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html">Reserved Words</a> in the <i>Amazon DynamoDB Developer Guide</i>.) To work around this, you could specify the following for <code>ExpressionAttributeNames</code>:</p>
764    /// <ul>
765    /// <li>
766    /// <p><code>{"#P":"Percentile"}</code></p></li>
767    /// </ul>
768    /// <p>You could then use this substitution in an expression, as in this example:</p>
769    /// <ul>
770    /// <li>
771    /// <p><code>#P = :val</code></p></li>
772    /// </ul><note>
773    /// <p>Tokens that begin with the <b>:</b> character are <i>expression attribute values</i>, which are placeholders for the actual value at runtime.</p>
774    /// </note>
775    /// <p>For more information about expression attribute names, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html">Specifying Item Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
776    pub fn set_expression_attribute_names(
777        mut self,
778        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
779    ) -> Self {
780        self.expression_attribute_names = input;
781        self
782    }
783    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
784    /// <ul>
785    /// <li>
786    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
787    /// <li>
788    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
789    /// <li>
790    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
791    /// </ul>
792    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
793    /// <ul>
794    /// <li>
795    /// <p><code>Percentile</code></p></li>
796    /// </ul>
797    /// <p>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 <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html">Reserved Words</a> in the <i>Amazon DynamoDB Developer Guide</i>.) To work around this, you could specify the following for <code>ExpressionAttributeNames</code>:</p>
798    /// <ul>
799    /// <li>
800    /// <p><code>{"#P":"Percentile"}</code></p></li>
801    /// </ul>
802    /// <p>You could then use this substitution in an expression, as in this example:</p>
803    /// <ul>
804    /// <li>
805    /// <p><code>#P = :val</code></p></li>
806    /// </ul><note>
807    /// <p>Tokens that begin with the <b>:</b> character are <i>expression attribute values</i>, which are placeholders for the actual value at runtime.</p>
808    /// </note>
809    /// <p>For more information about expression attribute names, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html">Specifying Item Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
810    pub fn get_expression_attribute_names(
811        &self,
812    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
813        &self.expression_attribute_names
814    }
815    /// Adds a key-value pair to `expression_attribute_values`.
816    ///
817    /// To override the contents of this collection use [`set_expression_attribute_values`](Self::set_expression_attribute_values).
818    ///
819    /// <p>One or more values that can be substituted in an expression.</p>
820    /// <p>Use the <b>:</b> (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the <code>ProductStatus</code> attribute was one of the following:</p>
821    /// <p><code>Available | Backordered | Discontinued</code></p>
822    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
823    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
824    /// <p>You could then use these values in an expression, such as this:</p>
825    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
826    /// <p>For more information on expression attribute values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Condition Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
827    pub fn expression_attribute_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
828        let mut hash_map = self.expression_attribute_values.unwrap_or_default();
829        hash_map.insert(k.into(), v);
830        self.expression_attribute_values = ::std::option::Option::Some(hash_map);
831        self
832    }
833    /// <p>One or more values that can be substituted in an expression.</p>
834    /// <p>Use the <b>:</b> (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the <code>ProductStatus</code> attribute was one of the following:</p>
835    /// <p><code>Available | Backordered | Discontinued</code></p>
836    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
837    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
838    /// <p>You could then use these values in an expression, such as this:</p>
839    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
840    /// <p>For more information on expression attribute values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Condition Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
841    pub fn set_expression_attribute_values(
842        mut self,
843        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
844    ) -> Self {
845        self.expression_attribute_values = input;
846        self
847    }
848    /// <p>One or more values that can be substituted in an expression.</p>
849    /// <p>Use the <b>:</b> (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the <code>ProductStatus</code> attribute was one of the following:</p>
850    /// <p><code>Available | Backordered | Discontinued</code></p>
851    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
852    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
853    /// <p>You could then use these values in an expression, such as this:</p>
854    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
855    /// <p>For more information on expression attribute values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Condition Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
856    pub fn get_expression_attribute_values(
857        &self,
858    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
859        &self.expression_attribute_values
860    }
861    /// <p>An optional parameter that returns the item attributes for an <code>UpdateItem</code> operation that failed a condition check.</p>
862    /// <p>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.</p>
863    pub fn return_values_on_condition_check_failure(mut self, input: crate::types::ReturnValuesOnConditionCheckFailure) -> Self {
864        self.return_values_on_condition_check_failure = ::std::option::Option::Some(input);
865        self
866    }
867    /// <p>An optional parameter that returns the item attributes for an <code>UpdateItem</code> operation that failed a condition check.</p>
868    /// <p>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.</p>
869    pub fn set_return_values_on_condition_check_failure(
870        mut self,
871        input: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
872    ) -> Self {
873        self.return_values_on_condition_check_failure = input;
874        self
875    }
876    /// <p>An optional parameter that returns the item attributes for an <code>UpdateItem</code> operation that failed a condition check.</p>
877    /// <p>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.</p>
878    pub fn get_return_values_on_condition_check_failure(&self) -> &::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure> {
879        &self.return_values_on_condition_check_failure
880    }
881    /// Consumes the builder and constructs a [`UpdateItemInput`](crate::operation::update_item::UpdateItemInput).
882    pub fn build(self) -> ::std::result::Result<crate::operation::update_item::UpdateItemInput, ::aws_smithy_types::error::operation::BuildError> {
883        ::std::result::Result::Ok(crate::operation::update_item::UpdateItemInput {
884            table_name: self.table_name,
885            key: self.key,
886            attribute_updates: self.attribute_updates,
887            expected: self.expected,
888            conditional_operator: self.conditional_operator,
889            return_values: self.return_values,
890            return_consumed_capacity: self.return_consumed_capacity,
891            return_item_collection_metrics: self.return_item_collection_metrics,
892            update_expression: self.update_expression,
893            condition_expression: self.condition_expression,
894            expression_attribute_names: self.expression_attribute_names,
895            expression_attribute_values: self.expression_attribute_values,
896            return_values_on_condition_check_failure: self.return_values_on_condition_check_failure,
897        })
898    }
899}