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