aws_sdk_dynamodb/operation/delete_item/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_item::_delete_item_output::DeleteItemOutputBuilder;
3
4pub use crate::operation::delete_item::_delete_item_input::DeleteItemInputBuilder;
5
6impl crate::operation::delete_item::builders::DeleteItemInputBuilder {
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::delete_item::DeleteItemOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::delete_item::DeleteItemError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.delete_item();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DeleteItem`.
24///
25/// <p>Deletes a single item in a table by primary key. You can perform a conditional delete operation that deletes the item if it exists, or if it has an expected attribute value.</p>
26/// <p>In addition to deleting an item, you can also return the item's attribute values in the same operation, using the <code>ReturnValues</code> parameter.</p>
27/// <p>Unless you specify conditions, the <code>DeleteItem</code> is an idempotent operation; running it multiple times on the same item or attribute does <i>not</i> result in an error response.</p>
28/// <p>Conditional deletes are useful for deleting items only if specific conditions are met. If those conditions are met, DynamoDB performs the delete. Otherwise, the item is not deleted.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct DeleteItemFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::delete_item::builders::DeleteItemInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::delete_item::DeleteItemOutput,
38 crate::operation::delete_item::DeleteItemError,
39 > for DeleteItemFluentBuilder
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::delete_item::DeleteItemOutput,
47 crate::operation::delete_item::DeleteItemError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl DeleteItemFluentBuilder {
54 /// Creates a new `DeleteItemFluentBuilder`.
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 DeleteItem as a reference.
63 pub fn as_input(&self) -> &crate::operation::delete_item::builders::DeleteItemInputBuilder {
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(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::delete_item::DeleteItemOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::delete_item::DeleteItemError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::delete_item::DeleteItem::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::delete_item::DeleteItem::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::delete_item::DeleteItemOutput,
100 crate::operation::delete_item::DeleteItemError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>The name of the table from which to delete the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
115 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.table_name(input.into());
117 self
118 }
119 /// <p>The name of the table from which to delete the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
120 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_table_name(input);
122 self
123 }
124 /// <p>The name of the table from which to delete the item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
125 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_table_name()
127 }
128 ///
129 /// Adds a key-value pair to `Key`.
130 ///
131 /// To override the contents of this collection use [`set_key`](Self::set_key).
132 ///
133 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to delete.</p>
134 /// <p>For the primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.</p>
135 pub fn key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
136 self.inner = self.inner.key(k.into(), v);
137 self
138 }
139 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to delete.</p>
140 /// <p>For the primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.</p>
141 pub fn set_key(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>) -> Self {
142 self.inner = self.inner.set_key(input);
143 self
144 }
145 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to delete.</p>
146 /// <p>For the primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.</p>
147 pub fn get_key(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
148 self.inner.get_key()
149 }
150 ///
151 /// Adds a key-value pair to `Expected`.
152 ///
153 /// To override the contents of this collection use [`set_expected`](Self::set_expected).
154 ///
155 /// <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>
156 pub fn expected(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ExpectedAttributeValue) -> Self {
157 self.inner = self.inner.expected(k.into(), v);
158 self
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 set_expected(
162 mut self,
163 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ExpectedAttributeValue>>,
164 ) -> 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>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>
173 pub fn conditional_operator(mut self, input: crate::types::ConditionalOperator) -> Self {
174 self.inner = self.inner.conditional_operator(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.ConditionalOperator.html">ConditionalOperator</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
178 pub fn set_conditional_operator(mut self, input: ::std::option::Option<crate::types::ConditionalOperator>) -> Self {
179 self.inner = self.inner.set_conditional_operator(input);
180 self
181 }
182 /// <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>
183 pub fn get_conditional_operator(&self) -> &::std::option::Option<crate::types::ConditionalOperator> {
184 self.inner.get_conditional_operator()
185 }
186 /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appeared before they were deleted. For <code>DeleteItem</code>, the valid values are:</p>
187 /// <ul>
188 /// <li>
189 /// <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>
190 /// <li>
191 /// <p><code>ALL_OLD</code> - The content of the old item is returned.</p></li>
192 /// </ul>
193 /// <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>
194 /// <p>The <code>ReturnValues</code> parameter is used by several DynamoDB operations; however, <code>DeleteItem</code> does not recognize any values other than <code>NONE</code> or <code>ALL_OLD</code>.</p>
195 /// </note>
196 pub fn return_values(mut self, input: crate::types::ReturnValue) -> Self {
197 self.inner = self.inner.return_values(input);
198 self
199 }
200 /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appeared before they were deleted. For <code>DeleteItem</code>, the valid values are:</p>
201 /// <ul>
202 /// <li>
203 /// <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>
204 /// <li>
205 /// <p><code>ALL_OLD</code> - The content of the old item is returned.</p></li>
206 /// </ul>
207 /// <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>
208 /// <p>The <code>ReturnValues</code> parameter is used by several DynamoDB operations; however, <code>DeleteItem</code> does not recognize any values other than <code>NONE</code> or <code>ALL_OLD</code>.</p>
209 /// </note>
210 pub fn set_return_values(mut self, input: ::std::option::Option<crate::types::ReturnValue>) -> Self {
211 self.inner = self.inner.set_return_values(input);
212 self
213 }
214 /// <p>Use <code>ReturnValues</code> if you want to get the item attributes as they appeared before they were deleted. For <code>DeleteItem</code>, the valid values are:</p>
215 /// <ul>
216 /// <li>
217 /// <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>
218 /// <li>
219 /// <p><code>ALL_OLD</code> - The content of the old item is returned.</p></li>
220 /// </ul>
221 /// <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>
222 /// <p>The <code>ReturnValues</code> parameter is used by several DynamoDB operations; however, <code>DeleteItem</code> does not recognize any values other than <code>NONE</code> or <code>ALL_OLD</code>.</p>
223 /// </note>
224 pub fn get_return_values(&self) -> &::std::option::Option<crate::types::ReturnValue> {
225 self.inner.get_return_values()
226 }
227 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
228 /// <ul>
229 /// <li>
230 /// <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>
231 /// <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>
232 /// <li>
233 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
234 /// <li>
235 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
236 /// </ul>
237 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
238 self.inner = self.inner.return_consumed_capacity(input);
239 self
240 }
241 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
242 /// <ul>
243 /// <li>
244 /// <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>
245 /// <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>
246 /// <li>
247 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
248 /// <li>
249 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
250 /// </ul>
251 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
252 self.inner = self.inner.set_return_consumed_capacity(input);
253 self
254 }
255 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
256 /// <ul>
257 /// <li>
258 /// <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>
259 /// <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>
260 /// <li>
261 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
262 /// <li>
263 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
264 /// </ul>
265 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
266 self.inner.get_return_consumed_capacity()
267 }
268 /// <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>
269 pub fn return_item_collection_metrics(mut self, input: crate::types::ReturnItemCollectionMetrics) -> Self {
270 self.inner = self.inner.return_item_collection_metrics(input);
271 self
272 }
273 /// <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>
274 pub fn set_return_item_collection_metrics(mut self, input: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>) -> Self {
275 self.inner = self.inner.set_return_item_collection_metrics(input);
276 self
277 }
278 /// <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>
279 pub fn get_return_item_collection_metrics(&self) -> &::std::option::Option<crate::types::ReturnItemCollectionMetrics> {
280 self.inner.get_return_item_collection_metrics()
281 }
282 /// <p>A condition that must be satisfied in order for a conditional <code>DeleteItem</code> to succeed.</p>
283 /// <p>An expression can contain any of the following:</p>
284 /// <ul>
285 /// <li>
286 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
287 /// <p>These function names are case-sensitive.</p></li>
288 /// <li>
289 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
290 /// <li>
291 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
292 /// </ul>
293 /// <p>For more information about 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>
294 pub fn condition_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
295 self.inner = self.inner.condition_expression(input.into());
296 self
297 }
298 /// <p>A condition that must be satisfied in order for a conditional <code>DeleteItem</code> to succeed.</p>
299 /// <p>An expression can contain any of the following:</p>
300 /// <ul>
301 /// <li>
302 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
303 /// <p>These function names are case-sensitive.</p></li>
304 /// <li>
305 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
306 /// <li>
307 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
308 /// </ul>
309 /// <p>For more information about 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>
310 pub fn set_condition_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
311 self.inner = self.inner.set_condition_expression(input);
312 self
313 }
314 /// <p>A condition that must be satisfied in order for a conditional <code>DeleteItem</code> to succeed.</p>
315 /// <p>An expression can contain any of the following:</p>
316 /// <ul>
317 /// <li>
318 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
319 /// <p>These function names are case-sensitive.</p></li>
320 /// <li>
321 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
322 /// <li>
323 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
324 /// </ul>
325 /// <p>For more information about 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>
326 pub fn get_condition_expression(&self) -> &::std::option::Option<::std::string::String> {
327 self.inner.get_condition_expression()
328 }
329 ///
330 /// Adds a key-value pair to `ExpressionAttributeNames`.
331 ///
332 /// To override the contents of this collection use [`set_expression_attribute_names`](Self::set_expression_attribute_names).
333 ///
334 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
335 /// <ul>
336 /// <li>
337 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
338 /// <li>
339 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
340 /// <li>
341 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
342 /// </ul>
343 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
344 /// <ul>
345 /// <li>
346 /// <p><code>Percentile</code></p></li>
347 /// </ul>
348 /// <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>
349 /// <ul>
350 /// <li>
351 /// <p><code>{"#P":"Percentile"}</code></p></li>
352 /// </ul>
353 /// <p>You could then use this substitution in an expression, as in this example:</p>
354 /// <ul>
355 /// <li>
356 /// <p><code>#P = :val</code></p></li>
357 /// </ul><note>
358 /// <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>
359 /// </note>
360 /// <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>
361 pub fn expression_attribute_names(
362 mut self,
363 k: impl ::std::convert::Into<::std::string::String>,
364 v: impl ::std::convert::Into<::std::string::String>,
365 ) -> Self {
366 self.inner = self.inner.expression_attribute_names(k.into(), v.into());
367 self
368 }
369 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
370 /// <ul>
371 /// <li>
372 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
373 /// <li>
374 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
375 /// <li>
376 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
377 /// </ul>
378 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
379 /// <ul>
380 /// <li>
381 /// <p><code>Percentile</code></p></li>
382 /// </ul>
383 /// <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>
384 /// <ul>
385 /// <li>
386 /// <p><code>{"#P":"Percentile"}</code></p></li>
387 /// </ul>
388 /// <p>You could then use this substitution in an expression, as in this example:</p>
389 /// <ul>
390 /// <li>
391 /// <p><code>#P = :val</code></p></li>
392 /// </ul><note>
393 /// <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>
394 /// </note>
395 /// <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>
396 pub fn set_expression_attribute_names(
397 mut self,
398 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
399 ) -> Self {
400 self.inner = self.inner.set_expression_attribute_names(input);
401 self
402 }
403 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
404 /// <ul>
405 /// <li>
406 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
407 /// <li>
408 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
409 /// <li>
410 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
411 /// </ul>
412 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
413 /// <ul>
414 /// <li>
415 /// <p><code>Percentile</code></p></li>
416 /// </ul>
417 /// <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>
418 /// <ul>
419 /// <li>
420 /// <p><code>{"#P":"Percentile"}</code></p></li>
421 /// </ul>
422 /// <p>You could then use this substitution in an expression, as in this example:</p>
423 /// <ul>
424 /// <li>
425 /// <p><code>#P = :val</code></p></li>
426 /// </ul><note>
427 /// <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>
428 /// </note>
429 /// <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>
430 pub fn get_expression_attribute_names(
431 &self,
432 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
433 self.inner.get_expression_attribute_names()
434 }
435 ///
436 /// Adds a key-value pair to `ExpressionAttributeValues`.
437 ///
438 /// To override the contents of this collection use [`set_expression_attribute_values`](Self::set_expression_attribute_values).
439 ///
440 /// <p>One or more values that can be substituted in an expression.</p>
441 /// <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>
442 /// <p><code>Available | Backordered | Discontinued</code></p>
443 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
444 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
445 /// <p>You could then use these values in an expression, such as this:</p>
446 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
447 /// <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>
448 pub fn expression_attribute_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
449 self.inner = self.inner.expression_attribute_values(k.into(), v);
450 self
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 set_expression_attribute_values(
461 mut self,
462 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
463 ) -> Self {
464 self.inner = self.inner.set_expression_attribute_values(input);
465 self
466 }
467 /// <p>One or more values that can be substituted in an expression.</p>
468 /// <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>
469 /// <p><code>Available | Backordered | Discontinued</code></p>
470 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
471 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
472 /// <p>You could then use these values in an expression, such as this:</p>
473 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
474 /// <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>
475 pub fn get_expression_attribute_values(
476 &self,
477 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
478 self.inner.get_expression_attribute_values()
479 }
480 /// <p>An optional parameter that returns the item attributes for a <code>DeleteItem</code> operation that failed a condition check.</p>
481 /// <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>
482 pub fn return_values_on_condition_check_failure(mut self, input: crate::types::ReturnValuesOnConditionCheckFailure) -> Self {
483 self.inner = self.inner.return_values_on_condition_check_failure(input);
484 self
485 }
486 /// <p>An optional parameter that returns the item attributes for a <code>DeleteItem</code> operation that failed a condition check.</p>
487 /// <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>
488 pub fn set_return_values_on_condition_check_failure(
489 mut self,
490 input: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
491 ) -> Self {
492 self.inner = self.inner.set_return_values_on_condition_check_failure(input);
493 self
494 }
495 /// <p>An optional parameter that returns the item attributes for a <code>DeleteItem</code> operation that failed a condition check.</p>
496 /// <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>
497 pub fn get_return_values_on_condition_check_failure(&self) -> &::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure> {
498 self.inner.get_return_values_on_condition_check_failure()
499 }
500}