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