aws_sdk_dynamodb/operation/put_item/_put_item_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of a <code>PutItem</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PutItemInput {
7 /// <p>The name of the table to contain the item. 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>A map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.</p>
10 /// <p>You must provide all of the attributes for the primary key. 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 both values for both the partition key and the sort key.</p>
11 /// <p>If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table's attribute definition.</p>
12 /// <p>Empty String and Binary attribute values are allowed. Attribute values of type String and Binary must have a length greater than zero if the attribute is used as a key attribute for a table or index.</p>
13 /// <p>For more information about primary keys, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey">Primary Key</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
14 /// <p>Each element in the <code>Item</code> map is an <code>AttributeValue</code> object.</p>
15 pub item: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
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.Expected.html">Expected</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
17 pub expected: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>>,
18 /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appeared before they were updated with the <code>PutItem</code> request. For <code>PutItem</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> - If <code>PutItem</code> overwrote an attribute name-value pair, then the content of the old item is returned.</p></li>
24 /// </ul>
25 /// <p>The values returned are strongly consistent.</p>
26 /// <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><note>
27 /// <p>The <code>ReturnValues</code> parameter is used by several DynamoDB operations; however, <code>PutItem</code> does not recognize any values other than <code>NONE</code> or <code>ALL_OLD</code>.</p>
28 /// </note>
29 pub return_values: ::std::option::Option<crate::types::ReturnValue>,
30 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
31 /// <ul>
32 /// <li>
33 /// <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>
34 /// <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>
35 /// <li>
36 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
37 /// <li>
38 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
39 /// </ul>
40 pub return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
41 /// <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>
42 pub return_item_collection_metrics: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>,
43 /// <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>
44 pub conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
45 /// <p>A condition that must be satisfied in order for a conditional <code>PutItem</code> operation to succeed.</p>
46 /// <p>An expression can contain any of the following:</p>
47 /// <ul>
48 /// <li>
49 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
50 /// <p>These function names are case-sensitive.</p></li>
51 /// <li>
52 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
53 /// <li>
54 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
55 /// </ul>
56 /// <p>For more information on condition expressions, 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>
57 pub condition_expression: ::std::option::Option<::std::string::String>,
58 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
59 /// <ul>
60 /// <li>
61 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
62 /// <li>
63 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
64 /// <li>
65 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
66 /// </ul>
67 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
68 /// <ul>
69 /// <li>
70 /// <p><code>Percentile</code></p></li>
71 /// </ul>
72 /// <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>
73 /// <ul>
74 /// <li>
75 /// <p><code>{"#P":"Percentile"}</code></p></li>
76 /// </ul>
77 /// <p>You could then use this substitution in an expression, as in this example:</p>
78 /// <ul>
79 /// <li>
80 /// <p><code>#P = :val</code></p></li>
81 /// </ul><note>
82 /// <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>
83 /// </note>
84 /// <p>For more information on 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>
85 pub expression_attribute_names: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>,
86 /// <p>One or more values that can be substituted in an expression.</p>
87 /// <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 <i>ProductStatus</i> attribute was one of the following:</p>
88 /// <p><code>Available | Backordered | Discontinued</code></p>
89 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
90 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
91 /// <p>You could then use these values in an expression, such as this:</p>
92 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
93 /// <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>
94 pub expression_attribute_values: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
95 /// <p>An optional parameter that returns the item attributes for a <code>PutItem</code> operation that failed a condition check.</p>
96 /// <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>
97 pub return_values_on_condition_check_failure: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
98}
99impl PutItemInput {
100 /// <p>The name of the table to contain the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
101 pub fn table_name(&self) -> ::std::option::Option<&str> {
102 self.table_name.as_deref()
103 }
104 /// <p>A map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.</p>
105 /// <p>You must provide all of the attributes for the primary key. 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 both values for both the partition key and the sort key.</p>
106 /// <p>If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table's attribute definition.</p>
107 /// <p>Empty String and Binary attribute values are allowed. Attribute values of type String and Binary must have a length greater than zero if the attribute is used as a key attribute for a table or index.</p>
108 /// <p>For more information about primary keys, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey">Primary Key</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
109 /// <p>Each element in the <code>Item</code> map is an <code>AttributeValue</code> object.</p>
110 pub fn item(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
111 self.item.as_ref()
112 }
113 /// <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>
114 pub fn expected(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>> {
115 self.expected.as_ref()
116 }
117 /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appeared before they were updated with the <code>PutItem</code> request. For <code>PutItem</code>, the valid values are:</p>
118 /// <ul>
119 /// <li>
120 /// <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>
121 /// <li>
122 /// <p><code>ALL_OLD</code> - If <code>PutItem</code> overwrote an attribute name-value pair, then the content of the old item is returned.</p></li>
123 /// </ul>
124 /// <p>The values returned are strongly consistent.</p>
125 /// <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><note>
126 /// <p>The <code>ReturnValues</code> parameter is used by several DynamoDB operations; however, <code>PutItem</code> does not recognize any values other than <code>NONE</code> or <code>ALL_OLD</code>.</p>
127 /// </note>
128 pub fn return_values(&self) -> ::std::option::Option<&crate::types::ReturnValue> {
129 self.return_values.as_ref()
130 }
131 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
132 /// <ul>
133 /// <li>
134 /// <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>
135 /// <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>
136 /// <li>
137 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
138 /// <li>
139 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
140 /// </ul>
141 pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
142 self.return_consumed_capacity.as_ref()
143 }
144 /// <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>
145 pub fn return_item_collection_metrics(&self) -> ::std::option::Option<&crate::types::ReturnItemCollectionMetrics> {
146 self.return_item_collection_metrics.as_ref()
147 }
148 /// <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>
149 pub fn conditional_operator(&self) -> ::std::option::Option<&crate::types::ConditionalOperator> {
150 self.conditional_operator.as_ref()
151 }
152 /// <p>A condition that must be satisfied in order for a conditional <code>PutItem</code> operation to succeed.</p>
153 /// <p>An expression can contain any of the following:</p>
154 /// <ul>
155 /// <li>
156 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
157 /// <p>These function names are case-sensitive.</p></li>
158 /// <li>
159 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
160 /// <li>
161 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
162 /// </ul>
163 /// <p>For more information on condition expressions, 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>
164 pub fn condition_expression(&self) -> ::std::option::Option<&str> {
165 self.condition_expression.as_deref()
166 }
167 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
168 /// <ul>
169 /// <li>
170 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
171 /// <li>
172 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
173 /// <li>
174 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
175 /// </ul>
176 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
177 /// <ul>
178 /// <li>
179 /// <p><code>Percentile</code></p></li>
180 /// </ul>
181 /// <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>
182 /// <ul>
183 /// <li>
184 /// <p><code>{"#P":"Percentile"}</code></p></li>
185 /// </ul>
186 /// <p>You could then use this substitution in an expression, as in this example:</p>
187 /// <ul>
188 /// <li>
189 /// <p><code>#P = :val</code></p></li>
190 /// </ul><note>
191 /// <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>
192 /// </note>
193 /// <p>For more information on 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>
194 pub fn expression_attribute_names(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
195 self.expression_attribute_names.as_ref()
196 }
197 /// <p>One or more values that can be substituted in an expression.</p>
198 /// <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 <i>ProductStatus</i> attribute was one of the following:</p>
199 /// <p><code>Available | Backordered | Discontinued</code></p>
200 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
201 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
202 /// <p>You could then use these values in an expression, such as this:</p>
203 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
204 /// <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>
205 pub fn expression_attribute_values(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
206 self.expression_attribute_values.as_ref()
207 }
208 /// <p>An optional parameter that returns the item attributes for a <code>PutItem</code> operation that failed a condition check.</p>
209 /// <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>
210 pub fn return_values_on_condition_check_failure(&self) -> ::std::option::Option<&crate::types::ReturnValuesOnConditionCheckFailure> {
211 self.return_values_on_condition_check_failure.as_ref()
212 }
213}
214impl PutItemInput {
215 /// Creates a new builder-style object to manufacture [`PutItemInput`](crate::operation::put_item::PutItemInput).
216 pub fn builder() -> crate::operation::put_item::builders::PutItemInputBuilder {
217 crate::operation::put_item::builders::PutItemInputBuilder::default()
218 }
219}
220
221/// A builder for [`PutItemInput`](crate::operation::put_item::PutItemInput).
222#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
223#[non_exhaustive]
224pub struct PutItemInputBuilder {
225 pub(crate) table_name: ::std::option::Option<::std::string::String>,
226 pub(crate) item: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
227 pub(crate) expected: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>>,
228 pub(crate) return_values: ::std::option::Option<crate::types::ReturnValue>,
229 pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
230 pub(crate) return_item_collection_metrics: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>,
231 pub(crate) conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
232 pub(crate) condition_expression: ::std::option::Option<::std::string::String>,
233 pub(crate) expression_attribute_names: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>,
234 pub(crate) expression_attribute_values: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
235 pub(crate) return_values_on_condition_check_failure: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
236}
237impl PutItemInputBuilder {
238 /// <p>The name of the table to contain the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
239 /// This field is required.
240 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
241 self.table_name = ::std::option::Option::Some(input.into());
242 self
243 }
244 /// <p>The name of the table to contain the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
245 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246 self.table_name = input; self
247 }
248 /// <p>The name of the table to contain the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
249 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
250 &self.table_name
251 }
252 /// Adds a key-value pair to `item`.
253 ///
254 /// To override the contents of this collection use [`set_item`](Self::set_item).
255 ///
256 /// <p>A map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.</p>
257 /// <p>You must provide all of the attributes for the primary key. 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 both values for both the partition key and the sort key.</p>
258 /// <p>If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table's attribute definition.</p>
259 /// <p>Empty String and Binary attribute values are allowed. Attribute values of type String and Binary must have a length greater than zero if the attribute is used as a key attribute for a table or index.</p>
260 /// <p>For more information about primary keys, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey">Primary Key</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
261 /// <p>Each element in the <code>Item</code> map is an <code>AttributeValue</code> object.</p>
262 pub fn item(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
263 let mut hash_map = self.item.unwrap_or_default();
264 hash_map.insert(k.into(), v);
265 self.item = ::std::option::Option::Some(hash_map);
266 self
267 }
268 /// <p>A map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.</p>
269 /// <p>You must provide all of the attributes for the primary key. 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 both values for both the partition key and the sort key.</p>
270 /// <p>If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table's attribute definition.</p>
271 /// <p>Empty String and Binary attribute values are allowed. Attribute values of type String and Binary must have a length greater than zero if the attribute is used as a key attribute for a table or index.</p>
272 /// <p>For more information about primary keys, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey">Primary Key</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
273 /// <p>Each element in the <code>Item</code> map is an <code>AttributeValue</code> object.</p>
274 pub fn set_item(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
275 self.item = input; self
276 }
277 /// <p>A map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.</p>
278 /// <p>You must provide all of the attributes for the primary key. 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 both values for both the partition key and the sort key.</p>
279 /// <p>If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table's attribute definition.</p>
280 /// <p>Empty String and Binary attribute values are allowed. Attribute values of type String and Binary must have a length greater than zero if the attribute is used as a key attribute for a table or index.</p>
281 /// <p>For more information about primary keys, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey">Primary Key</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
282 /// <p>Each element in the <code>Item</code> map is an <code>AttributeValue</code> object.</p>
283 pub fn get_item(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
284 &self.item
285 }
286 /// Adds a key-value pair to `expected`.
287 ///
288 /// To override the contents of this collection use [`set_expected`](Self::set_expected).
289 ///
290 /// <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>
291 pub fn expected(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ExpectedAttributeValue) -> Self {
292 let mut hash_map = self.expected.unwrap_or_default();
293 hash_map.insert(k.into(), v);
294 self.expected = ::std::option::Option::Some(hash_map);
295 self
296 }
297 /// <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>
298 pub fn set_expected(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>>) -> Self {
299 self.expected = input; self
300 }
301 /// <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>
302 pub fn get_expected(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>> {
303 &self.expected
304 }
305 /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appeared before they were updated with the <code>PutItem</code> request. For <code>PutItem</code>, the valid values are:</p>
306 /// <ul>
307 /// <li>
308 /// <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>
309 /// <li>
310 /// <p><code>ALL_OLD</code> - If <code>PutItem</code> overwrote an attribute name-value pair, then the content of the old item is returned.</p></li>
311 /// </ul>
312 /// <p>The values returned are strongly consistent.</p>
313 /// <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><note>
314 /// <p>The <code>ReturnValues</code> parameter is used by several DynamoDB operations; however, <code>PutItem</code> does not recognize any values other than <code>NONE</code> or <code>ALL_OLD</code>.</p>
315 /// </note>
316 pub fn return_values(mut self, input: crate::types::ReturnValue) -> Self {
317 self.return_values = ::std::option::Option::Some(input);
318 self
319 }
320 /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appeared before they were updated with the <code>PutItem</code> request. For <code>PutItem</code>, the valid values are:</p>
321 /// <ul>
322 /// <li>
323 /// <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>
324 /// <li>
325 /// <p><code>ALL_OLD</code> - If <code>PutItem</code> overwrote an attribute name-value pair, then the content of the old item is returned.</p></li>
326 /// </ul>
327 /// <p>The values returned are strongly consistent.</p>
328 /// <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><note>
329 /// <p>The <code>ReturnValues</code> parameter is used by several DynamoDB operations; however, <code>PutItem</code> does not recognize any values other than <code>NONE</code> or <code>ALL_OLD</code>.</p>
330 /// </note>
331 pub fn set_return_values(mut self, input: ::std::option::Option<crate::types::ReturnValue>) -> Self {
332 self.return_values = input; self
333 }
334 /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appeared before they were updated with the <code>PutItem</code> request. For <code>PutItem</code>, the valid values are:</p>
335 /// <ul>
336 /// <li>
337 /// <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>
338 /// <li>
339 /// <p><code>ALL_OLD</code> - If <code>PutItem</code> overwrote an attribute name-value pair, then the content of the old item is returned.</p></li>
340 /// </ul>
341 /// <p>The values returned are strongly consistent.</p>
342 /// <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><note>
343 /// <p>The <code>ReturnValues</code> parameter is used by several DynamoDB operations; however, <code>PutItem</code> does not recognize any values other than <code>NONE</code> or <code>ALL_OLD</code>.</p>
344 /// </note>
345 pub fn get_return_values(&self) -> &::std::option::Option<crate::types::ReturnValue> {
346 &self.return_values
347 }
348 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
349 /// <ul>
350 /// <li>
351 /// <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>
352 /// <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>
353 /// <li>
354 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
355 /// <li>
356 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
357 /// </ul>
358 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
359 self.return_consumed_capacity = ::std::option::Option::Some(input);
360 self
361 }
362 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
363 /// <ul>
364 /// <li>
365 /// <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>
366 /// <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>
367 /// <li>
368 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
369 /// <li>
370 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
371 /// </ul>
372 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
373 self.return_consumed_capacity = input; self
374 }
375 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
376 /// <ul>
377 /// <li>
378 /// <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>
379 /// <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>
380 /// <li>
381 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
382 /// <li>
383 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
384 /// </ul>
385 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
386 &self.return_consumed_capacity
387 }
388 /// <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>
389 pub fn return_item_collection_metrics(mut self, input: crate::types::ReturnItemCollectionMetrics) -> Self {
390 self.return_item_collection_metrics = ::std::option::Option::Some(input);
391 self
392 }
393 /// <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>
394 pub fn set_return_item_collection_metrics(mut self, input: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>) -> Self {
395 self.return_item_collection_metrics = input; self
396 }
397 /// <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>
398 pub fn get_return_item_collection_metrics(&self) -> &::std::option::Option<crate::types::ReturnItemCollectionMetrics> {
399 &self.return_item_collection_metrics
400 }
401 /// <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>
402 pub fn conditional_operator(mut self, input: crate::types::ConditionalOperator) -> Self {
403 self.conditional_operator = ::std::option::Option::Some(input);
404 self
405 }
406 /// <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>
407 pub fn set_conditional_operator(mut self, input: ::std::option::Option<crate::types::ConditionalOperator>) -> Self {
408 self.conditional_operator = input; self
409 }
410 /// <p>This is a legacy parameter. Use <code>ConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html">ConditionalOperator</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
411 pub fn get_conditional_operator(&self) -> &::std::option::Option<crate::types::ConditionalOperator> {
412 &self.conditional_operator
413 }
414 /// <p>A condition that must be satisfied in order for a conditional <code>PutItem</code> operation to succeed.</p>
415 /// <p>An expression can contain any of the following:</p>
416 /// <ul>
417 /// <li>
418 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
419 /// <p>These function names are case-sensitive.</p></li>
420 /// <li>
421 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
422 /// <li>
423 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
424 /// </ul>
425 /// <p>For more information on condition expressions, 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>
426 pub fn condition_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
427 self.condition_expression = ::std::option::Option::Some(input.into());
428 self
429 }
430 /// <p>A condition that must be satisfied in order for a conditional <code>PutItem</code> operation to succeed.</p>
431 /// <p>An expression can contain any of the following:</p>
432 /// <ul>
433 /// <li>
434 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
435 /// <p>These function names are case-sensitive.</p></li>
436 /// <li>
437 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
438 /// <li>
439 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
440 /// </ul>
441 /// <p>For more information on condition expressions, 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>
442 pub fn set_condition_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
443 self.condition_expression = input; self
444 }
445 /// <p>A condition that must be satisfied in order for a conditional <code>PutItem</code> operation to succeed.</p>
446 /// <p>An expression can contain any of the following:</p>
447 /// <ul>
448 /// <li>
449 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
450 /// <p>These function names are case-sensitive.</p></li>
451 /// <li>
452 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
453 /// <li>
454 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
455 /// </ul>
456 /// <p>For more information on condition expressions, 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>
457 pub fn get_condition_expression(&self) -> &::std::option::Option<::std::string::String> {
458 &self.condition_expression
459 }
460 /// Adds a key-value pair to `expression_attribute_names`.
461 ///
462 /// To override the contents of this collection use [`set_expression_attribute_names`](Self::set_expression_attribute_names).
463 ///
464 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
465 /// <ul>
466 /// <li>
467 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
468 /// <li>
469 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
470 /// <li>
471 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
472 /// </ul>
473 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
474 /// <ul>
475 /// <li>
476 /// <p><code>Percentile</code></p></li>
477 /// </ul>
478 /// <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>
479 /// <ul>
480 /// <li>
481 /// <p><code>{"#P":"Percentile"}</code></p></li>
482 /// </ul>
483 /// <p>You could then use this substitution in an expression, as in this example:</p>
484 /// <ul>
485 /// <li>
486 /// <p><code>#P = :val</code></p></li>
487 /// </ul><note>
488 /// <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>
489 /// </note>
490 /// <p>For more information on 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>
491 pub fn expression_attribute_names(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
492 let mut hash_map = self.expression_attribute_names.unwrap_or_default();
493 hash_map.insert(k.into(), v.into());
494 self.expression_attribute_names = ::std::option::Option::Some(hash_map);
495 self
496 }
497 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
498 /// <ul>
499 /// <li>
500 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
501 /// <li>
502 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
503 /// <li>
504 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
505 /// </ul>
506 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
507 /// <ul>
508 /// <li>
509 /// <p><code>Percentile</code></p></li>
510 /// </ul>
511 /// <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>
512 /// <ul>
513 /// <li>
514 /// <p><code>{"#P":"Percentile"}</code></p></li>
515 /// </ul>
516 /// <p>You could then use this substitution in an expression, as in this example:</p>
517 /// <ul>
518 /// <li>
519 /// <p><code>#P = :val</code></p></li>
520 /// </ul><note>
521 /// <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>
522 /// </note>
523 /// <p>For more information on 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>
524 pub fn set_expression_attribute_names(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>) -> Self {
525 self.expression_attribute_names = input; self
526 }
527 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
528 /// <ul>
529 /// <li>
530 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
531 /// <li>
532 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
533 /// <li>
534 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
535 /// </ul>
536 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
537 /// <ul>
538 /// <li>
539 /// <p><code>Percentile</code></p></li>
540 /// </ul>
541 /// <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>
542 /// <ul>
543 /// <li>
544 /// <p><code>{"#P":"Percentile"}</code></p></li>
545 /// </ul>
546 /// <p>You could then use this substitution in an expression, as in this example:</p>
547 /// <ul>
548 /// <li>
549 /// <p><code>#P = :val</code></p></li>
550 /// </ul><note>
551 /// <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>
552 /// </note>
553 /// <p>For more information on 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>
554 pub fn get_expression_attribute_names(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
555 &self.expression_attribute_names
556 }
557 /// Adds a key-value pair to `expression_attribute_values`.
558 ///
559 /// To override the contents of this collection use [`set_expression_attribute_values`](Self::set_expression_attribute_values).
560 ///
561 /// <p>One or more values that can be substituted in an expression.</p>
562 /// <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 <i>ProductStatus</i> attribute was one of the following:</p>
563 /// <p><code>Available | Backordered | Discontinued</code></p>
564 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
565 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
566 /// <p>You could then use these values in an expression, such as this:</p>
567 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
568 /// <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>
569 pub fn expression_attribute_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
570 let mut hash_map = self.expression_attribute_values.unwrap_or_default();
571 hash_map.insert(k.into(), v);
572 self.expression_attribute_values = ::std::option::Option::Some(hash_map);
573 self
574 }
575 /// <p>One or more values that can be substituted in an expression.</p>
576 /// <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 <i>ProductStatus</i> attribute was one of the following:</p>
577 /// <p><code>Available | Backordered | Discontinued</code></p>
578 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
579 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
580 /// <p>You could then use these values in an expression, such as this:</p>
581 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
582 /// <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>
583 pub fn set_expression_attribute_values(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
584 self.expression_attribute_values = input; self
585 }
586 /// <p>One or more values that can be substituted in an expression.</p>
587 /// <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 <i>ProductStatus</i> attribute was one of the following:</p>
588 /// <p><code>Available | Backordered | Discontinued</code></p>
589 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
590 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
591 /// <p>You could then use these values in an expression, such as this:</p>
592 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
593 /// <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>
594 pub fn get_expression_attribute_values(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
595 &self.expression_attribute_values
596 }
597 /// <p>An optional parameter that returns the item attributes for a <code>PutItem</code> operation that failed a condition check.</p>
598 /// <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>
599 pub fn return_values_on_condition_check_failure(mut self, input: crate::types::ReturnValuesOnConditionCheckFailure) -> Self {
600 self.return_values_on_condition_check_failure = ::std::option::Option::Some(input);
601 self
602 }
603 /// <p>An optional parameter that returns the item attributes for a <code>PutItem</code> operation that failed a condition check.</p>
604 /// <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>
605 pub fn set_return_values_on_condition_check_failure(mut self, input: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>) -> Self {
606 self.return_values_on_condition_check_failure = input; self
607 }
608 /// <p>An optional parameter that returns the item attributes for a <code>PutItem</code> operation that failed a condition check.</p>
609 /// <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>
610 pub fn get_return_values_on_condition_check_failure(&self) -> &::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure> {
611 &self.return_values_on_condition_check_failure
612 }
613 /// Consumes the builder and constructs a [`PutItemInput`](crate::operation::put_item::PutItemInput).
614 pub fn build(self) -> ::std::result::Result<crate::operation::put_item::PutItemInput, ::aws_smithy_types::error::operation::BuildError> {
615 ::std::result::Result::Ok(
616 crate::operation::put_item::PutItemInput {
617 table_name: self.table_name
618 ,
619 item: self.item
620 ,
621 expected: self.expected
622 ,
623 return_values: self.return_values
624 ,
625 return_consumed_capacity: self.return_consumed_capacity
626 ,
627 return_item_collection_metrics: self.return_item_collection_metrics
628 ,
629 conditional_operator: self.conditional_operator
630 ,
631 condition_expression: self.condition_expression
632 ,
633 expression_attribute_names: self.expression_attribute_names
634 ,
635 expression_attribute_values: self.expression_attribute_values
636 ,
637 return_values_on_condition_check_failure: self.return_values_on_condition_check_failure
638 ,
639 }
640 )
641 }
642}
643