aws_sdk_dynamodb/operation/put_item/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_item::_put_item_output::PutItemOutputBuilder;
3
4pub use crate::operation::put_item::_put_item_input::PutItemInputBuilder;
5
6impl crate::operation::put_item::builders::PutItemInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::put_item::PutItemOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_item::PutItemError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_item();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutItem`.
24///
25/// <p>Creates a new item, or replaces an old item with a new item. If an item that has the same primary key as the new item already exists in the specified table, the new item completely replaces the existing item. You can perform a conditional put operation (add a new item if one with the specified primary key doesn't exist), or replace an existing item if it has certain attribute values. You can return the item's attribute values in the same operation, using the <code>ReturnValues</code> parameter.</p>
26/// <p>When you add an item, the primary key attributes are the only required attributes.</p>
27/// <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. Set type attributes cannot be empty.</p>
28/// <p>Invalid Requests with empty values will be rejected with a <code>ValidationException</code> exception.</p><note>
29/// <p>To prevent a new item from replacing an existing item, use a conditional expression that contains the <code>attribute_not_exists</code> function with the name of the attribute being used as the partition key for the table. Since every record must contain that attribute, the <code>attribute_not_exists</code> function will only succeed if no matching item exists.</p>
30/// </note>
31/// <p>For more information about <code>PutItem</code>, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html">Working with Items</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct PutItemFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::put_item::builders::PutItemInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl crate::client::customize::internal::CustomizableSend<crate::operation::put_item::PutItemOutput, crate::operation::put_item::PutItemError>
39    for PutItemFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<crate::operation::put_item::PutItemOutput, crate::operation::put_item::PutItemError>,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl PutItemFluentBuilder {
51    /// Creates a new `PutItemFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the PutItem as a reference.
60    pub fn as_input(&self) -> &crate::operation::put_item::builders::PutItemInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::put_item::PutItemOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::put_item::PutItemError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::put_item::PutItem::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::put_item::PutItem::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<crate::operation::put_item::PutItemOutput, crate::operation::put_item::PutItemError, Self>
96    {
97        crate::client::customize::CustomizableOperation::new(self)
98    }
99    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
100        self.set_config_override(::std::option::Option::Some(config_override.into()));
101        self
102    }
103
104    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
105        self.config_override = config_override;
106        self
107    }
108    /// <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>
109    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.inner = self.inner.table_name(input.into());
111        self
112    }
113    /// <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>
114    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.inner = self.inner.set_table_name(input);
116        self
117    }
118    /// <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>
119    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
120        self.inner.get_table_name()
121    }
122    ///
123    /// Adds a key-value pair to `Item`.
124    ///
125    /// To override the contents of this collection use [`set_item`](Self::set_item).
126    ///
127    /// <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>
128    /// <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>
129    /// <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>
130    /// <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>
131    /// <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>
132    /// <p>Each element in the <code>Item</code> map is an <code>AttributeValue</code> object.</p>
133    pub fn item(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
134        self.inner = self.inner.item(k.into(), v);
135        self
136    }
137    /// <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>
138    /// <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>
139    /// <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>
140    /// <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>
141    /// <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>
142    /// <p>Each element in the <code>Item</code> map is an <code>AttributeValue</code> object.</p>
143    pub fn set_item(
144        mut self,
145        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
146    ) -> Self {
147        self.inner = self.inner.set_item(input);
148        self
149    }
150    /// <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>
151    /// <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>
152    /// <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>
153    /// <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>
154    /// <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>
155    /// <p>Each element in the <code>Item</code> map is an <code>AttributeValue</code> object.</p>
156    pub fn get_item(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
157        self.inner.get_item()
158    }
159    ///
160    /// Adds a key-value pair to `Expected`.
161    ///
162    /// To override the contents of this collection use [`set_expected`](Self::set_expected).
163    ///
164    /// <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>
165    pub fn expected(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ExpectedAttributeValue) -> Self {
166        self.inner = self.inner.expected(k.into(), v);
167        self
168    }
169    /// <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>
170    pub fn set_expected(
171        mut self,
172        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ExpectedAttributeValue>>,
173    ) -> Self {
174        self.inner = self.inner.set_expected(input);
175        self
176    }
177    /// <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>
178    pub fn get_expected(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ExpectedAttributeValue>> {
179        self.inner.get_expected()
180    }
181    /// <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>
182    /// <ul>
183    /// <li>
184    /// <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>
185    /// <li>
186    /// <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>
187    /// </ul>
188    /// <p>The values returned are strongly consistent.</p>
189    /// <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>
190    /// <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>
191    /// </note>
192    pub fn return_values(mut self, input: crate::types::ReturnValue) -> Self {
193        self.inner = self.inner.return_values(input);
194        self
195    }
196    /// <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>
197    /// <ul>
198    /// <li>
199    /// <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>
200    /// <li>
201    /// <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>
202    /// </ul>
203    /// <p>The values returned are strongly consistent.</p>
204    /// <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>
205    /// <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>
206    /// </note>
207    pub fn set_return_values(mut self, input: ::std::option::Option<crate::types::ReturnValue>) -> Self {
208        self.inner = self.inner.set_return_values(input);
209        self
210    }
211    /// <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>
212    /// <ul>
213    /// <li>
214    /// <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>
215    /// <li>
216    /// <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>
217    /// </ul>
218    /// <p>The values returned are strongly consistent.</p>
219    /// <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>
220    /// <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>
221    /// </note>
222    pub fn get_return_values(&self) -> &::std::option::Option<crate::types::ReturnValue> {
223        self.inner.get_return_values()
224    }
225    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
226    /// <ul>
227    /// <li>
228    /// <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>
229    /// <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>
230    /// <li>
231    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
232    /// <li>
233    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
234    /// </ul>
235    pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
236        self.inner = self.inner.return_consumed_capacity(input);
237        self
238    }
239    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
240    /// <ul>
241    /// <li>
242    /// <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>
243    /// <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>
244    /// <li>
245    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
246    /// <li>
247    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
248    /// </ul>
249    pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
250        self.inner = self.inner.set_return_consumed_capacity(input);
251        self
252    }
253    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
254    /// <ul>
255    /// <li>
256    /// <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>
257    /// <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>
258    /// <li>
259    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
260    /// <li>
261    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
262    /// </ul>
263    pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
264        self.inner.get_return_consumed_capacity()
265    }
266    /// <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>
267    pub fn return_item_collection_metrics(mut self, input: crate::types::ReturnItemCollectionMetrics) -> Self {
268        self.inner = self.inner.return_item_collection_metrics(input);
269        self
270    }
271    /// <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>
272    pub fn set_return_item_collection_metrics(mut self, input: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>) -> Self {
273        self.inner = self.inner.set_return_item_collection_metrics(input);
274        self
275    }
276    /// <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>
277    pub fn get_return_item_collection_metrics(&self) -> &::std::option::Option<crate::types::ReturnItemCollectionMetrics> {
278        self.inner.get_return_item_collection_metrics()
279    }
280    /// <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>
281    pub fn conditional_operator(mut self, input: crate::types::ConditionalOperator) -> Self {
282        self.inner = self.inner.conditional_operator(input);
283        self
284    }
285    /// <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>
286    pub fn set_conditional_operator(mut self, input: ::std::option::Option<crate::types::ConditionalOperator>) -> Self {
287        self.inner = self.inner.set_conditional_operator(input);
288        self
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.ConditionalOperator.html">ConditionalOperator</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
291    pub fn get_conditional_operator(&self) -> &::std::option::Option<crate::types::ConditionalOperator> {
292        self.inner.get_conditional_operator()
293    }
294    /// <p>A condition that must be satisfied in order for a conditional <code>PutItem</code> operation to succeed.</p>
295    /// <p>An expression can contain any of the following:</p>
296    /// <ul>
297    /// <li>
298    /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
299    /// <p>These function names are case-sensitive.</p></li>
300    /// <li>
301    /// <p>Comparison operators: <code>= | &lt;&gt; | &lt; | &gt; | &lt;= | &gt;= | BETWEEN | IN </code></p></li>
302    /// <li>
303    /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
304    /// </ul>
305    /// <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>
306    pub fn condition_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
307        self.inner = self.inner.condition_expression(input.into());
308        self
309    }
310    /// <p>A condition that must be satisfied in order for a conditional <code>PutItem</code> operation to succeed.</p>
311    /// <p>An expression can contain any of the following:</p>
312    /// <ul>
313    /// <li>
314    /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
315    /// <p>These function names are case-sensitive.</p></li>
316    /// <li>
317    /// <p>Comparison operators: <code>= | &lt;&gt; | &lt; | &gt; | &lt;= | &gt;= | BETWEEN | IN </code></p></li>
318    /// <li>
319    /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
320    /// </ul>
321    /// <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>
322    pub fn set_condition_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
323        self.inner = self.inner.set_condition_expression(input);
324        self
325    }
326    /// <p>A condition that must be satisfied in order for a conditional <code>PutItem</code> operation to succeed.</p>
327    /// <p>An expression can contain any of the following:</p>
328    /// <ul>
329    /// <li>
330    /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
331    /// <p>These function names are case-sensitive.</p></li>
332    /// <li>
333    /// <p>Comparison operators: <code>= | &lt;&gt; | &lt; | &gt; | &lt;= | &gt;= | BETWEEN | IN </code></p></li>
334    /// <li>
335    /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
336    /// </ul>
337    /// <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>
338    pub fn get_condition_expression(&self) -> &::std::option::Option<::std::string::String> {
339        self.inner.get_condition_expression()
340    }
341    ///
342    /// Adds a key-value pair to `ExpressionAttributeNames`.
343    ///
344    /// To override the contents of this collection use [`set_expression_attribute_names`](Self::set_expression_attribute_names).
345    ///
346    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
347    /// <ul>
348    /// <li>
349    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
350    /// <li>
351    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
352    /// <li>
353    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
354    /// </ul>
355    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
356    /// <ul>
357    /// <li>
358    /// <p><code>Percentile</code></p></li>
359    /// </ul>
360    /// <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>
361    /// <ul>
362    /// <li>
363    /// <p><code>{"#P":"Percentile"}</code></p></li>
364    /// </ul>
365    /// <p>You could then use this substitution in an expression, as in this example:</p>
366    /// <ul>
367    /// <li>
368    /// <p><code>#P = :val</code></p></li>
369    /// </ul><note>
370    /// <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>
371    /// </note>
372    /// <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>
373    pub fn expression_attribute_names(
374        mut self,
375        k: impl ::std::convert::Into<::std::string::String>,
376        v: impl ::std::convert::Into<::std::string::String>,
377    ) -> Self {
378        self.inner = self.inner.expression_attribute_names(k.into(), v.into());
379        self
380    }
381    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
382    /// <ul>
383    /// <li>
384    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
385    /// <li>
386    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
387    /// <li>
388    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
389    /// </ul>
390    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
391    /// <ul>
392    /// <li>
393    /// <p><code>Percentile</code></p></li>
394    /// </ul>
395    /// <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>
396    /// <ul>
397    /// <li>
398    /// <p><code>{"#P":"Percentile"}</code></p></li>
399    /// </ul>
400    /// <p>You could then use this substitution in an expression, as in this example:</p>
401    /// <ul>
402    /// <li>
403    /// <p><code>#P = :val</code></p></li>
404    /// </ul><note>
405    /// <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>
406    /// </note>
407    /// <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>
408    pub fn set_expression_attribute_names(
409        mut self,
410        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
411    ) -> Self {
412        self.inner = self.inner.set_expression_attribute_names(input);
413        self
414    }
415    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
416    /// <ul>
417    /// <li>
418    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
419    /// <li>
420    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
421    /// <li>
422    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
423    /// </ul>
424    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
425    /// <ul>
426    /// <li>
427    /// <p><code>Percentile</code></p></li>
428    /// </ul>
429    /// <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>
430    /// <ul>
431    /// <li>
432    /// <p><code>{"#P":"Percentile"}</code></p></li>
433    /// </ul>
434    /// <p>You could then use this substitution in an expression, as in this example:</p>
435    /// <ul>
436    /// <li>
437    /// <p><code>#P = :val</code></p></li>
438    /// </ul><note>
439    /// <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>
440    /// </note>
441    /// <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>
442    pub fn get_expression_attribute_names(
443        &self,
444    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
445        self.inner.get_expression_attribute_names()
446    }
447    ///
448    /// Adds a key-value pair to `ExpressionAttributeValues`.
449    ///
450    /// To override the contents of this collection use [`set_expression_attribute_values`](Self::set_expression_attribute_values).
451    ///
452    /// <p>One or more values that can be substituted in an expression.</p>
453    /// <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>
454    /// <p><code>Available | Backordered | Discontinued</code></p>
455    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
456    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
457    /// <p>You could then use these values in an expression, such as this:</p>
458    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
459    /// <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>
460    pub fn expression_attribute_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
461        self.inner = self.inner.expression_attribute_values(k.into(), v);
462        self
463    }
464    /// <p>One or more values that can be substituted in an expression.</p>
465    /// <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>
466    /// <p><code>Available | Backordered | Discontinued</code></p>
467    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
468    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
469    /// <p>You could then use these values in an expression, such as this:</p>
470    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
471    /// <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>
472    pub fn set_expression_attribute_values(
473        mut self,
474        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
475    ) -> Self {
476        self.inner = self.inner.set_expression_attribute_values(input);
477        self
478    }
479    /// <p>One or more values that can be substituted in an expression.</p>
480    /// <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>
481    /// <p><code>Available | Backordered | Discontinued</code></p>
482    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
483    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
484    /// <p>You could then use these values in an expression, such as this:</p>
485    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
486    /// <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>
487    pub fn get_expression_attribute_values(
488        &self,
489    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
490        self.inner.get_expression_attribute_values()
491    }
492    /// <p>An optional parameter that returns the item attributes for a <code>PutItem</code> operation that failed a condition check.</p>
493    /// <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>
494    pub fn return_values_on_condition_check_failure(mut self, input: crate::types::ReturnValuesOnConditionCheckFailure) -> Self {
495        self.inner = self.inner.return_values_on_condition_check_failure(input);
496        self
497    }
498    /// <p>An optional parameter that returns the item attributes for a <code>PutItem</code> operation that failed a condition check.</p>
499    /// <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>
500    pub fn set_return_values_on_condition_check_failure(
501        mut self,
502        input: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
503    ) -> Self {
504        self.inner = self.inner.set_return_values_on_condition_check_failure(input);
505        self
506    }
507    /// <p>An optional parameter that returns the item attributes for a <code>PutItem</code> operation that failed a condition check.</p>
508    /// <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>
509    pub fn get_return_values_on_condition_check_failure(&self) -> &::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure> {
510        self.inner.get_return_values_on_condition_check_failure()
511    }
512}