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>= | <> | < | > | <= | >= | 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(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValueUpdate>> {
151 self.attribute_updates.as_ref()
152 }
153 /// <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>
154 pub fn expected(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>> {
155 self.expected.as_ref()
156 }
157 /// <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>
158 pub fn conditional_operator(&self) -> ::std::option::Option<&crate::types::ConditionalOperator> {
159 self.conditional_operator.as_ref()
160 }
161 /// <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>
162 /// <ul>
163 /// <li>
164 /// <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>
165 /// <li>
166 /// <p><code>ALL_OLD</code> - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.</p></li>
167 /// <li>
168 /// <p><code>UPDATED_OLD</code> - Returns only the updated attributes, as they appeared before the UpdateItem operation.</p></li>
169 /// <li>
170 /// <p><code>ALL_NEW</code> - Returns all of the attributes of the item, as they appear after the UpdateItem operation.</p></li>
171 /// <li>
172 /// <p><code>UPDATED_NEW</code> - Returns only the updated attributes, as they appear after the UpdateItem operation.</p></li>
173 /// </ul>
174 /// <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>
175 /// <p>The values returned are strongly consistent.</p>
176 pub fn return_values(&self) -> ::std::option::Option<&crate::types::ReturnValue> {
177 self.return_values.as_ref()
178 }
179 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
180 /// <ul>
181 /// <li>
182 /// <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>
183 /// <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>
184 /// <li>
185 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
186 /// <li>
187 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
188 /// </ul>
189 pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
190 self.return_consumed_capacity.as_ref()
191 }
192 /// <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>
193 pub fn return_item_collection_metrics(&self) -> ::std::option::Option<&crate::types::ReturnItemCollectionMetrics> {
194 self.return_item_collection_metrics.as_ref()
195 }
196 /// <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>
197 /// <p>The following action values are available for <code>UpdateExpression</code>.</p>
198 /// <ul>
199 /// <li>
200 /// <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>
201 /// <p><code>SET</code> supports the following functions:</p>
202 /// <ul>
203 /// <li>
204 /// <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>
205 /// <li>
206 /// <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>
207 /// </ul>
208 /// <p>These function names are case-sensitive.</p></li>
209 /// <li>
210 /// <p><code>REMOVE</code> - Removes one or more attributes from an item.</p></li>
211 /// <li>
212 /// <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>
213 /// <ul>
214 /// <li>
215 /// <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>
216 /// <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>
217 /// <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>
218 /// </note></li>
219 /// <li>
220 /// <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>
221 /// <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>
222 /// </ul><important>
223 /// <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>
224 /// </important></li>
225 /// <li>
226 /// <p><code>DELETE</code> - Deletes an element from a set.</p>
227 /// <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>
228 /// <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>
229 /// </important></li>
230 /// </ul>
231 /// <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>
232 /// <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>
233 pub fn update_expression(&self) -> ::std::option::Option<&str> {
234 self.update_expression.as_deref()
235 }
236 /// <p>A condition that must be satisfied in order for a conditional update to succeed.</p>
237 /// <p>An expression can contain any of the following:</p>
238 /// <ul>
239 /// <li>
240 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
241 /// <p>These function names are case-sensitive.</p></li>
242 /// <li>
243 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
244 /// <li>
245 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
246 /// </ul>
247 /// <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>
248 pub fn condition_expression(&self) -> ::std::option::Option<&str> {
249 self.condition_expression.as_deref()
250 }
251 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
252 /// <ul>
253 /// <li>
254 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
255 /// <li>
256 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
257 /// <li>
258 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
259 /// </ul>
260 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
261 /// <ul>
262 /// <li>
263 /// <p><code>Percentile</code></p></li>
264 /// </ul>
265 /// <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>
266 /// <ul>
267 /// <li>
268 /// <p><code>{"#P":"Percentile"}</code></p></li>
269 /// </ul>
270 /// <p>You could then use this substitution in an expression, as in this example:</p>
271 /// <ul>
272 /// <li>
273 /// <p><code>#P = :val</code></p></li>
274 /// </ul><note>
275 /// <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>
276 /// </note>
277 /// <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>
278 pub fn expression_attribute_names(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
279 self.expression_attribute_names.as_ref()
280 }
281 /// <p>One or more values that can be substituted in an expression.</p>
282 /// <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>
283 /// <p><code>Available | Backordered | Discontinued</code></p>
284 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
285 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
286 /// <p>You could then use these values in an expression, such as this:</p>
287 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
288 /// <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>
289 pub fn expression_attribute_values(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
290 self.expression_attribute_values.as_ref()
291 }
292 /// <p>An optional parameter that returns the item attributes for an <code>UpdateItem</code> operation that failed a condition check.</p>
293 /// <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>
294 pub fn return_values_on_condition_check_failure(&self) -> ::std::option::Option<&crate::types::ReturnValuesOnConditionCheckFailure> {
295 self.return_values_on_condition_check_failure.as_ref()
296 }
297}
298static UPDATEITEMINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.dynamodb.synthetic#UpdateItemInput", "com.amazonaws.dynamodb.synthetic", "UpdateItemInput");
299static UPDATEITEMINPUT_MEMBER_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
300 ::aws_smithy_schema::ShapeId::from_static(
301 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$TableName",
302 "com.amazonaws.dynamodb.synthetic",
303 "UpdateItemInput",
304 ),
305 ::aws_smithy_schema::ShapeType::String,
306 "TableName",
307 0,
308 );
309static UPDATEITEMINPUT_MEMBER_KEY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
310 ::aws_smithy_schema::ShapeId::from_static(
311 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$Key",
312 "com.amazonaws.dynamodb.synthetic",
313 "UpdateItemInput",
314 ),
315 ::aws_smithy_schema::ShapeType::Map,
316 "Key",
317 1,
318 );
319static UPDATEITEMINPUT_MEMBER_ATTRIBUTE_UPDATES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
320 ::aws_smithy_schema::ShapeId::from_static(
321 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$AttributeUpdates",
322 "com.amazonaws.dynamodb.synthetic",
323 "UpdateItemInput",
324 ),
325 ::aws_smithy_schema::ShapeType::Map,
326 "AttributeUpdates",
327 2,
328 );
329static UPDATEITEMINPUT_MEMBER_EXPECTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
330 ::aws_smithy_schema::ShapeId::from_static(
331 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$Expected",
332 "com.amazonaws.dynamodb.synthetic",
333 "UpdateItemInput",
334 ),
335 ::aws_smithy_schema::ShapeType::Map,
336 "Expected",
337 3,
338 );
339static UPDATEITEMINPUT_MEMBER_CONDITIONAL_OPERATOR: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
340 ::aws_smithy_schema::ShapeId::from_static(
341 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ConditionalOperator",
342 "com.amazonaws.dynamodb.synthetic",
343 "UpdateItemInput",
344 ),
345 ::aws_smithy_schema::ShapeType::String,
346 "ConditionalOperator",
347 4,
348 );
349static UPDATEITEMINPUT_MEMBER_RETURN_VALUES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
350 ::aws_smithy_schema::ShapeId::from_static(
351 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ReturnValues",
352 "com.amazonaws.dynamodb.synthetic",
353 "UpdateItemInput",
354 ),
355 ::aws_smithy_schema::ShapeType::String,
356 "ReturnValues",
357 5,
358 );
359static UPDATEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
360 ::aws_smithy_schema::ShapeId::from_static(
361 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ReturnConsumedCapacity",
362 "com.amazonaws.dynamodb.synthetic",
363 "UpdateItemInput",
364 ),
365 ::aws_smithy_schema::ShapeType::String,
366 "ReturnConsumedCapacity",
367 6,
368 );
369static UPDATEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
370 ::aws_smithy_schema::ShapeId::from_static(
371 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ReturnItemCollectionMetrics",
372 "com.amazonaws.dynamodb.synthetic",
373 "UpdateItemInput",
374 ),
375 ::aws_smithy_schema::ShapeType::String,
376 "ReturnItemCollectionMetrics",
377 7,
378 );
379static UPDATEITEMINPUT_MEMBER_UPDATE_EXPRESSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
380 ::aws_smithy_schema::ShapeId::from_static(
381 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$UpdateExpression",
382 "com.amazonaws.dynamodb.synthetic",
383 "UpdateItemInput",
384 ),
385 ::aws_smithy_schema::ShapeType::String,
386 "UpdateExpression",
387 8,
388 );
389static UPDATEITEMINPUT_MEMBER_CONDITION_EXPRESSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
390 ::aws_smithy_schema::ShapeId::from_static(
391 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ConditionExpression",
392 "com.amazonaws.dynamodb.synthetic",
393 "UpdateItemInput",
394 ),
395 ::aws_smithy_schema::ShapeType::String,
396 "ConditionExpression",
397 9,
398 );
399static UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
400 ::aws_smithy_schema::ShapeId::from_static(
401 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ExpressionAttributeNames",
402 "com.amazonaws.dynamodb.synthetic",
403 "UpdateItemInput",
404 ),
405 ::aws_smithy_schema::ShapeType::Map,
406 "ExpressionAttributeNames",
407 10,
408 );
409static UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
410 ::aws_smithy_schema::ShapeId::from_static(
411 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ExpressionAttributeValues",
412 "com.amazonaws.dynamodb.synthetic",
413 "UpdateItemInput",
414 ),
415 ::aws_smithy_schema::ShapeType::Map,
416 "ExpressionAttributeValues",
417 11,
418 );
419static UPDATEITEMINPUT_MEMBER_RETURN_VALUES_ON_CONDITION_CHECK_FAILURE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
420 ::aws_smithy_schema::ShapeId::from_static(
421 "com.amazonaws.dynamodb.synthetic#UpdateItemInput$ReturnValuesOnConditionCheckFailure",
422 "com.amazonaws.dynamodb.synthetic",
423 "UpdateItemInput",
424 ),
425 ::aws_smithy_schema::ShapeType::String,
426 "ReturnValuesOnConditionCheckFailure",
427 12,
428 );
429static UPDATEITEMINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
430 UPDATEITEMINPUT_SCHEMA_ID,
431 ::aws_smithy_schema::ShapeType::Structure,
432 &[&UPDATEITEMINPUT_MEMBER_TABLE_NAME, &UPDATEITEMINPUT_MEMBER_KEY, &UPDATEITEMINPUT_MEMBER_ATTRIBUTE_UPDATES, &UPDATEITEMINPUT_MEMBER_EXPECTED, &UPDATEITEMINPUT_MEMBER_CONDITIONAL_OPERATOR, &UPDATEITEMINPUT_MEMBER_RETURN_VALUES, &UPDATEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY, &UPDATEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS, &UPDATEITEMINPUT_MEMBER_UPDATE_EXPRESSION, &UPDATEITEMINPUT_MEMBER_CONDITION_EXPRESSION, &UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES, &UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES, &UPDATEITEMINPUT_MEMBER_RETURN_VALUES_ON_CONDITION_CHECK_FAILURE],
433 );
434impl UpdateItemInput {
435 /// The schema for this shape.
436 pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &UPDATEITEMINPUT_SCHEMA;
437 }
438impl ::aws_smithy_schema::serde::SerializableStruct for UpdateItemInput {
439 #[allow(unused_variables, clippy::diverging_sub_expression)]
440 fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
441 if let Some(ref val) = self.table_name {
442 ser.write_string(&UPDATEITEMINPUT_MEMBER_TABLE_NAME, val)?;
443 }
444if let Some(ref val) = self.key {
445
446 ser.write_map(&UPDATEITEMINPUT_MEMBER_KEY, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
447 for (key, value) in val {
448 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
449 ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
450 }
451 Ok(())
452 })?;
453
454 }
455if let Some(ref val) = self.attribute_updates {
456
457 ser.write_map(&UPDATEITEMINPUT_MEMBER_ATTRIBUTE_UPDATES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
458 for (key, value) in val {
459 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
460 ser.write_struct(crate::types::AttributeValueUpdate::SCHEMA, value)?;
461 }
462 Ok(())
463 })?;
464
465 }
466if let Some(ref val) = self.expected {
467
468 ser.write_map(&UPDATEITEMINPUT_MEMBER_EXPECTED, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
469 for (key, value) in val {
470 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
471 ser.write_struct(crate::types::ExpectedAttributeValue::SCHEMA, value)?;
472 }
473 Ok(())
474 })?;
475
476 }
477if let Some(ref val) = self.conditional_operator {
478 ser.write_string(&UPDATEITEMINPUT_MEMBER_CONDITIONAL_OPERATOR, val.as_str())?;
479 }
480if let Some(ref val) = self.return_values {
481 ser.write_string(&UPDATEITEMINPUT_MEMBER_RETURN_VALUES, val.as_str())?;
482 }
483if let Some(ref val) = self.return_consumed_capacity {
484 ser.write_string(&UPDATEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY, val.as_str())?;
485 }
486if let Some(ref val) = self.return_item_collection_metrics {
487 ser.write_string(&UPDATEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS, val.as_str())?;
488 }
489if let Some(ref val) = self.update_expression {
490 ser.write_string(&UPDATEITEMINPUT_MEMBER_UPDATE_EXPRESSION, val)?;
491 }
492if let Some(ref val) = self.condition_expression {
493 ser.write_string(&UPDATEITEMINPUT_MEMBER_CONDITION_EXPRESSION, val)?;
494 }
495if let Some(ref val) = self.expression_attribute_names {
496
497 ser.write_map(&UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
498 for (key, value) in val {
499 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
500 ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
501 }
502 Ok(())
503 })?;
504
505 }
506if let Some(ref val) = self.expression_attribute_values {
507
508 ser.write_map(&UPDATEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
509 for (key, value) in val {
510 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
511 ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
512 }
513 Ok(())
514 })?;
515
516 }
517if let Some(ref val) = self.return_values_on_condition_check_failure {
518 ser.write_string(&UPDATEITEMINPUT_MEMBER_RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, val.as_str())?;
519 }
520 Ok(())
521 }
522 }
523impl UpdateItemInput {
524 /// Deserializes this structure from a [`ShapeDeserializer`].
525 pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
526 #[allow(unused_variables, unused_mut)]
527 let mut builder = Self::builder();
528 #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
529 deserializer.read_struct(&UPDATEITEMINPUT_SCHEMA, &mut |member, deser| {
530 match member.member_index() {
531 Some(0) => {
532 builder.table_name = Some(deser.read_string(member)?);
533 }
534Some(1) => {
535 builder.key = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::AttributeValue::deserialize(deser)?); Ok(()) })?; container });
536 }
537Some(2) => {
538 builder.attribute_updates = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::AttributeValueUpdate::deserialize(deser)?); Ok(()) })?; container });
539 }
540Some(3) => {
541 builder.expected = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::ExpectedAttributeValue::deserialize(deser)?); Ok(()) })?; container });
542 }
543Some(4) => {
544 builder.conditional_operator = Some(crate::types::ConditionalOperator::from(deser.read_string(member)?.as_str()));
545 }
546Some(5) => {
547 builder.return_values = Some(crate::types::ReturnValue::from(deser.read_string(member)?.as_str()));
548 }
549Some(6) => {
550 builder.return_consumed_capacity = Some(crate::types::ReturnConsumedCapacity::from(deser.read_string(member)?.as_str()));
551 }
552Some(7) => {
553 builder.return_item_collection_metrics = Some(crate::types::ReturnItemCollectionMetrics::from(deser.read_string(member)?.as_str()));
554 }
555Some(8) => {
556 builder.update_expression = Some(deser.read_string(member)?);
557 }
558Some(9) => {
559 builder.condition_expression = Some(deser.read_string(member)?);
560 }
561Some(10) => {
562 builder.expression_attribute_names = Some(deser.read_string_string_map(member)?);
563 }
564Some(11) => {
565 builder.expression_attribute_values = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::AttributeValue::deserialize(deser)?); Ok(()) })?; container });
566 }
567Some(12) => {
568 builder.return_values_on_condition_check_failure = Some(crate::types::ReturnValuesOnConditionCheckFailure::from(deser.read_string(member)?.as_str()));
569 }
570 _ => {}
571 }
572 Ok(())
573 })?;
574 builder.table_name = builder.table_name.or(Some(String::new()));
575builder.key = builder.key.or(Some(::std::collections::HashMap::new()));
576builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
577 }
578 }
579impl UpdateItemInput {
580 /// Deserializes this structure from a body deserializer and HTTP response.
581 pub fn deserialize_with_response(
582 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
583 _headers: &::aws_smithy_runtime_api::http::Headers,
584 _status: u16,
585 _body: &[u8],
586 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
587 Self::deserialize(deserializer)
588 }
589 }
590impl UpdateItemInput {
591 /// Creates a new builder-style object to manufacture [`UpdateItemInput`](crate::operation::update_item::UpdateItemInput).
592 pub fn builder() -> crate::operation::update_item::builders::UpdateItemInputBuilder {
593 crate::operation::update_item::builders::UpdateItemInputBuilder::default()
594 }
595}
596
597/// A builder for [`UpdateItemInput`](crate::operation::update_item::UpdateItemInput).
598#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
599#[non_exhaustive]
600pub struct UpdateItemInputBuilder {
601 pub(crate) table_name: ::std::option::Option<::std::string::String>,
602 pub(crate) key: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
603 pub(crate) attribute_updates: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValueUpdate>>,
604 pub(crate) expected: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>>,
605 pub(crate) conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
606 pub(crate) return_values: ::std::option::Option<crate::types::ReturnValue>,
607 pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
608 pub(crate) return_item_collection_metrics: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>,
609 pub(crate) update_expression: ::std::option::Option<::std::string::String>,
610 pub(crate) condition_expression: ::std::option::Option<::std::string::String>,
611 pub(crate) expression_attribute_names: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>,
612 pub(crate) expression_attribute_values: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
613 pub(crate) return_values_on_condition_check_failure: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
614}
615impl UpdateItemInputBuilder {
616 /// <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>
617 /// This field is required.
618 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
619 self.table_name = ::std::option::Option::Some(input.into());
620 self
621 }
622 /// <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>
623 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
624 self.table_name = input; self
625 }
626 /// <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>
627 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
628 &self.table_name
629 }
630 /// Adds a key-value pair to `key`.
631 ///
632 /// To override the contents of this collection use [`set_key`](Self::set_key).
633 ///
634 /// <p>The primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.</p>
635 /// <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>
636 pub fn key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
637 let mut hash_map = self.key.unwrap_or_default();
638 hash_map.insert(k.into(), v);
639 self.key = ::std::option::Option::Some(hash_map);
640 self
641 }
642 /// <p>The primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.</p>
643 /// <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>
644 pub fn set_key(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
645 self.key = input; self
646 }
647 /// <p>The primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.</p>
648 /// <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>
649 pub fn get_key(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
650 &self.key
651 }
652 /// Adds a key-value pair to `attribute_updates`.
653 ///
654 /// To override the contents of this collection use [`set_attribute_updates`](Self::set_attribute_updates).
655 ///
656 /// <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>
657 pub fn attribute_updates(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValueUpdate) -> Self {
658 let mut hash_map = self.attribute_updates.unwrap_or_default();
659 hash_map.insert(k.into(), v);
660 self.attribute_updates = ::std::option::Option::Some(hash_map);
661 self
662 }
663 /// <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>
664 pub fn set_attribute_updates(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValueUpdate>>) -> Self {
665 self.attribute_updates = input; self
666 }
667 /// <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>
668 pub fn get_attribute_updates(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValueUpdate>> {
669 &self.attribute_updates
670 }
671 /// Adds a key-value pair to `expected`.
672 ///
673 /// To override the contents of this collection use [`set_expected`](Self::set_expected).
674 ///
675 /// <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>
676 pub fn expected(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ExpectedAttributeValue) -> Self {
677 let mut hash_map = self.expected.unwrap_or_default();
678 hash_map.insert(k.into(), v);
679 self.expected = ::std::option::Option::Some(hash_map);
680 self
681 }
682 /// <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>
683 pub fn set_expected(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>>) -> Self {
684 self.expected = input; self
685 }
686 /// <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>
687 pub fn get_expected(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>> {
688 &self.expected
689 }
690 /// <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>
691 pub fn conditional_operator(mut self, input: crate::types::ConditionalOperator) -> Self {
692 self.conditional_operator = ::std::option::Option::Some(input);
693 self
694 }
695 /// <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>
696 pub fn set_conditional_operator(mut self, input: ::std::option::Option<crate::types::ConditionalOperator>) -> Self {
697 self.conditional_operator = input; self
698 }
699 /// <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>
700 pub fn get_conditional_operator(&self) -> &::std::option::Option<crate::types::ConditionalOperator> {
701 &self.conditional_operator
702 }
703 /// <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>
704 /// <ul>
705 /// <li>
706 /// <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>
707 /// <li>
708 /// <p><code>ALL_OLD</code> - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.</p></li>
709 /// <li>
710 /// <p><code>UPDATED_OLD</code> - Returns only the updated attributes, as they appeared before the UpdateItem operation.</p></li>
711 /// <li>
712 /// <p><code>ALL_NEW</code> - Returns all of the attributes of the item, as they appear after the UpdateItem operation.</p></li>
713 /// <li>
714 /// <p><code>UPDATED_NEW</code> - Returns only the updated attributes, as they appear after the UpdateItem operation.</p></li>
715 /// </ul>
716 /// <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>
717 /// <p>The values returned are strongly consistent.</p>
718 pub fn return_values(mut self, input: crate::types::ReturnValue) -> Self {
719 self.return_values = ::std::option::Option::Some(input);
720 self
721 }
722 /// <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>
723 /// <ul>
724 /// <li>
725 /// <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>
726 /// <li>
727 /// <p><code>ALL_OLD</code> - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.</p></li>
728 /// <li>
729 /// <p><code>UPDATED_OLD</code> - Returns only the updated attributes, as they appeared before the UpdateItem operation.</p></li>
730 /// <li>
731 /// <p><code>ALL_NEW</code> - Returns all of the attributes of the item, as they appear after the UpdateItem operation.</p></li>
732 /// <li>
733 /// <p><code>UPDATED_NEW</code> - Returns only the updated attributes, as they appear after the UpdateItem operation.</p></li>
734 /// </ul>
735 /// <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>
736 /// <p>The values returned are strongly consistent.</p>
737 pub fn set_return_values(mut self, input: ::std::option::Option<crate::types::ReturnValue>) -> Self {
738 self.return_values = input; self
739 }
740 /// <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>
741 /// <ul>
742 /// <li>
743 /// <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>
744 /// <li>
745 /// <p><code>ALL_OLD</code> - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.</p></li>
746 /// <li>
747 /// <p><code>UPDATED_OLD</code> - Returns only the updated attributes, as they appeared before the UpdateItem operation.</p></li>
748 /// <li>
749 /// <p><code>ALL_NEW</code> - Returns all of the attributes of the item, as they appear after the UpdateItem operation.</p></li>
750 /// <li>
751 /// <p><code>UPDATED_NEW</code> - Returns only the updated attributes, as they appear after the UpdateItem operation.</p></li>
752 /// </ul>
753 /// <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>
754 /// <p>The values returned are strongly consistent.</p>
755 pub fn get_return_values(&self) -> &::std::option::Option<crate::types::ReturnValue> {
756 &self.return_values
757 }
758 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
759 /// <ul>
760 /// <li>
761 /// <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>
762 /// <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>
763 /// <li>
764 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
765 /// <li>
766 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
767 /// </ul>
768 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
769 self.return_consumed_capacity = ::std::option::Option::Some(input);
770 self
771 }
772 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
773 /// <ul>
774 /// <li>
775 /// <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>
776 /// <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>
777 /// <li>
778 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
779 /// <li>
780 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
781 /// </ul>
782 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
783 self.return_consumed_capacity = input; self
784 }
785 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
786 /// <ul>
787 /// <li>
788 /// <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>
789 /// <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>
790 /// <li>
791 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
792 /// <li>
793 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
794 /// </ul>
795 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
796 &self.return_consumed_capacity
797 }
798 /// <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>
799 pub fn return_item_collection_metrics(mut self, input: crate::types::ReturnItemCollectionMetrics) -> Self {
800 self.return_item_collection_metrics = ::std::option::Option::Some(input);
801 self
802 }
803 /// <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>
804 pub fn set_return_item_collection_metrics(mut self, input: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>) -> Self {
805 self.return_item_collection_metrics = input; self
806 }
807 /// <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>
808 pub fn get_return_item_collection_metrics(&self) -> &::std::option::Option<crate::types::ReturnItemCollectionMetrics> {
809 &self.return_item_collection_metrics
810 }
811 /// <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>
812 /// <p>The following action values are available for <code>UpdateExpression</code>.</p>
813 /// <ul>
814 /// <li>
815 /// <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>
816 /// <p><code>SET</code> supports the following functions:</p>
817 /// <ul>
818 /// <li>
819 /// <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>
820 /// <li>
821 /// <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>
822 /// </ul>
823 /// <p>These function names are case-sensitive.</p></li>
824 /// <li>
825 /// <p><code>REMOVE</code> - Removes one or more attributes from an item.</p></li>
826 /// <li>
827 /// <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>
828 /// <ul>
829 /// <li>
830 /// <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>
831 /// <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>
832 /// <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>
833 /// </note></li>
834 /// <li>
835 /// <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>
836 /// <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>
837 /// </ul><important>
838 /// <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>
839 /// </important></li>
840 /// <li>
841 /// <p><code>DELETE</code> - Deletes an element from a set.</p>
842 /// <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>
843 /// <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>
844 /// </important></li>
845 /// </ul>
846 /// <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>
847 /// <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>
848 pub fn update_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
849 self.update_expression = ::std::option::Option::Some(input.into());
850 self
851 }
852 /// <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>
853 /// <p>The following action values are available for <code>UpdateExpression</code>.</p>
854 /// <ul>
855 /// <li>
856 /// <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>
857 /// <p><code>SET</code> supports the following functions:</p>
858 /// <ul>
859 /// <li>
860 /// <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>
861 /// <li>
862 /// <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>
863 /// </ul>
864 /// <p>These function names are case-sensitive.</p></li>
865 /// <li>
866 /// <p><code>REMOVE</code> - Removes one or more attributes from an item.</p></li>
867 /// <li>
868 /// <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>
869 /// <ul>
870 /// <li>
871 /// <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>
872 /// <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>
873 /// <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>
874 /// </note></li>
875 /// <li>
876 /// <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>
877 /// <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>
878 /// </ul><important>
879 /// <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>
880 /// </important></li>
881 /// <li>
882 /// <p><code>DELETE</code> - Deletes an element from a set.</p>
883 /// <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>
884 /// <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>
885 /// </important></li>
886 /// </ul>
887 /// <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>
888 /// <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>
889 pub fn set_update_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
890 self.update_expression = input; self
891 }
892 /// <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>
893 /// <p>The following action values are available for <code>UpdateExpression</code>.</p>
894 /// <ul>
895 /// <li>
896 /// <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>
897 /// <p><code>SET</code> supports the following functions:</p>
898 /// <ul>
899 /// <li>
900 /// <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>
901 /// <li>
902 /// <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>
903 /// </ul>
904 /// <p>These function names are case-sensitive.</p></li>
905 /// <li>
906 /// <p><code>REMOVE</code> - Removes one or more attributes from an item.</p></li>
907 /// <li>
908 /// <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>
909 /// <ul>
910 /// <li>
911 /// <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>
912 /// <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>
913 /// <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>
914 /// </note></li>
915 /// <li>
916 /// <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>
917 /// <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>
918 /// </ul><important>
919 /// <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>
920 /// </important></li>
921 /// <li>
922 /// <p><code>DELETE</code> - Deletes an element from a set.</p>
923 /// <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>
924 /// <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>
925 /// </important></li>
926 /// </ul>
927 /// <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>
928 /// <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>
929 pub fn get_update_expression(&self) -> &::std::option::Option<::std::string::String> {
930 &self.update_expression
931 }
932 /// <p>A condition that must be satisfied in order for a conditional update to succeed.</p>
933 /// <p>An expression can contain any of the following:</p>
934 /// <ul>
935 /// <li>
936 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
937 /// <p>These function names are case-sensitive.</p></li>
938 /// <li>
939 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
940 /// <li>
941 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
942 /// </ul>
943 /// <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>
944 pub fn condition_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
945 self.condition_expression = ::std::option::Option::Some(input.into());
946 self
947 }
948 /// <p>A condition that must be satisfied in order for a conditional update to succeed.</p>
949 /// <p>An expression can contain any of the following:</p>
950 /// <ul>
951 /// <li>
952 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
953 /// <p>These function names are case-sensitive.</p></li>
954 /// <li>
955 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
956 /// <li>
957 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
958 /// </ul>
959 /// <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>
960 pub fn set_condition_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
961 self.condition_expression = input; self
962 }
963 /// <p>A condition that must be satisfied in order for a conditional update to succeed.</p>
964 /// <p>An expression can contain any of the following:</p>
965 /// <ul>
966 /// <li>
967 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
968 /// <p>These function names are case-sensitive.</p></li>
969 /// <li>
970 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
971 /// <li>
972 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
973 /// </ul>
974 /// <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>
975 pub fn get_condition_expression(&self) -> &::std::option::Option<::std::string::String> {
976 &self.condition_expression
977 }
978 /// Adds a key-value pair to `expression_attribute_names`.
979 ///
980 /// To override the contents of this collection use [`set_expression_attribute_names`](Self::set_expression_attribute_names).
981 ///
982 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
983 /// <ul>
984 /// <li>
985 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
986 /// <li>
987 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
988 /// <li>
989 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
990 /// </ul>
991 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
992 /// <ul>
993 /// <li>
994 /// <p><code>Percentile</code></p></li>
995 /// </ul>
996 /// <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>
997 /// <ul>
998 /// <li>
999 /// <p><code>{"#P":"Percentile"}</code></p></li>
1000 /// </ul>
1001 /// <p>You could then use this substitution in an expression, as in this example:</p>
1002 /// <ul>
1003 /// <li>
1004 /// <p><code>#P = :val</code></p></li>
1005 /// </ul><note>
1006 /// <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>
1007 /// </note>
1008 /// <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>
1009 pub fn expression_attribute_names(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
1010 let mut hash_map = self.expression_attribute_names.unwrap_or_default();
1011 hash_map.insert(k.into(), v.into());
1012 self.expression_attribute_names = ::std::option::Option::Some(hash_map);
1013 self
1014 }
1015 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
1016 /// <ul>
1017 /// <li>
1018 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
1019 /// <li>
1020 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
1021 /// <li>
1022 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
1023 /// </ul>
1024 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
1025 /// <ul>
1026 /// <li>
1027 /// <p><code>Percentile</code></p></li>
1028 /// </ul>
1029 /// <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>
1030 /// <ul>
1031 /// <li>
1032 /// <p><code>{"#P":"Percentile"}</code></p></li>
1033 /// </ul>
1034 /// <p>You could then use this substitution in an expression, as in this example:</p>
1035 /// <ul>
1036 /// <li>
1037 /// <p><code>#P = :val</code></p></li>
1038 /// </ul><note>
1039 /// <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>
1040 /// </note>
1041 /// <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>
1042 pub fn set_expression_attribute_names(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>) -> Self {
1043 self.expression_attribute_names = input; self
1044 }
1045 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
1046 /// <ul>
1047 /// <li>
1048 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
1049 /// <li>
1050 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
1051 /// <li>
1052 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
1053 /// </ul>
1054 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
1055 /// <ul>
1056 /// <li>
1057 /// <p><code>Percentile</code></p></li>
1058 /// </ul>
1059 /// <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>
1060 /// <ul>
1061 /// <li>
1062 /// <p><code>{"#P":"Percentile"}</code></p></li>
1063 /// </ul>
1064 /// <p>You could then use this substitution in an expression, as in this example:</p>
1065 /// <ul>
1066 /// <li>
1067 /// <p><code>#P = :val</code></p></li>
1068 /// </ul><note>
1069 /// <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>
1070 /// </note>
1071 /// <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>
1072 pub fn get_expression_attribute_names(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
1073 &self.expression_attribute_names
1074 }
1075 /// Adds a key-value pair to `expression_attribute_values`.
1076 ///
1077 /// To override the contents of this collection use [`set_expression_attribute_values`](Self::set_expression_attribute_values).
1078 ///
1079 /// <p>One or more values that can be substituted in an expression.</p>
1080 /// <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>
1081 /// <p><code>Available | Backordered | Discontinued</code></p>
1082 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
1083 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
1084 /// <p>You could then use these values in an expression, such as this:</p>
1085 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
1086 /// <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>
1087 pub fn expression_attribute_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
1088 let mut hash_map = self.expression_attribute_values.unwrap_or_default();
1089 hash_map.insert(k.into(), v);
1090 self.expression_attribute_values = ::std::option::Option::Some(hash_map);
1091 self
1092 }
1093 /// <p>One or more values that can be substituted in an expression.</p>
1094 /// <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>
1095 /// <p><code>Available | Backordered | Discontinued</code></p>
1096 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
1097 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
1098 /// <p>You could then use these values in an expression, such as this:</p>
1099 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
1100 /// <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>
1101 pub fn set_expression_attribute_values(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
1102 self.expression_attribute_values = input; self
1103 }
1104 /// <p>One or more values that can be substituted in an expression.</p>
1105 /// <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>
1106 /// <p><code>Available | Backordered | Discontinued</code></p>
1107 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
1108 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
1109 /// <p>You could then use these values in an expression, such as this:</p>
1110 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
1111 /// <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>
1112 pub fn get_expression_attribute_values(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
1113 &self.expression_attribute_values
1114 }
1115 /// <p>An optional parameter that returns the item attributes for an <code>UpdateItem</code> operation that failed a condition check.</p>
1116 /// <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>
1117 pub fn return_values_on_condition_check_failure(mut self, input: crate::types::ReturnValuesOnConditionCheckFailure) -> Self {
1118 self.return_values_on_condition_check_failure = ::std::option::Option::Some(input);
1119 self
1120 }
1121 /// <p>An optional parameter that returns the item attributes for an <code>UpdateItem</code> operation that failed a condition check.</p>
1122 /// <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>
1123 pub fn set_return_values_on_condition_check_failure(mut self, input: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>) -> Self {
1124 self.return_values_on_condition_check_failure = input; self
1125 }
1126 /// <p>An optional parameter that returns the item attributes for an <code>UpdateItem</code> operation that failed a condition check.</p>
1127 /// <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>
1128 pub fn get_return_values_on_condition_check_failure(&self) -> &::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure> {
1129 &self.return_values_on_condition_check_failure
1130 }
1131 /// Consumes the builder and constructs a [`UpdateItemInput`](crate::operation::update_item::UpdateItemInput).
1132 pub fn build(self) -> ::std::result::Result<crate::operation::update_item::UpdateItemInput, ::aws_smithy_types::error::operation::BuildError> {
1133 ::std::result::Result::Ok(
1134 crate::operation::update_item::UpdateItemInput {
1135 table_name: self.table_name
1136 ,
1137 key: self.key
1138 ,
1139 attribute_updates: self.attribute_updates
1140 ,
1141 expected: self.expected
1142 ,
1143 conditional_operator: self.conditional_operator
1144 ,
1145 return_values: self.return_values
1146 ,
1147 return_consumed_capacity: self.return_consumed_capacity
1148 ,
1149 return_item_collection_metrics: self.return_item_collection_metrics
1150 ,
1151 update_expression: self.update_expression
1152 ,
1153 condition_expression: self.condition_expression
1154 ,
1155 expression_attribute_names: self.expression_attribute_names
1156 ,
1157 expression_attribute_values: self.expression_attribute_values
1158 ,
1159 return_values_on_condition_check_failure: self.return_values_on_condition_check_failure
1160 ,
1161 }
1162 )
1163 }
1164}
1165