aws_sdk_dynamodb/operation/delete_item/_delete_item_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of a <code>DeleteItem</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DeleteItemInput {
7 /// <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>
8 pub table_name: ::std::option::Option<::std::string::String>,
9 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to delete.</p>
10 /// <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>
11 pub key: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
12 /// <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>
13 pub expected: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>>,
14 /// <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>
15 pub conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
16 /// <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>
17 /// <ul>
18 /// <li>
19 /// <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>
20 /// <li>
21 /// <p><code>ALL_OLD</code> - The content of the old item is returned.</p></li>
22 /// </ul>
23 /// <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>
24 /// <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>
25 /// </note>
26 pub return_values: ::std::option::Option<crate::types::ReturnValue>,
27 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
28 /// <ul>
29 /// <li>
30 /// <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>
31 /// <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>
32 /// <li>
33 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
34 /// <li>
35 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
36 /// </ul>
37 pub return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
38 /// <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>
39 pub return_item_collection_metrics: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>,
40 /// <p>A condition that must be satisfied in order for a conditional <code>DeleteItem</code> to succeed.</p>
41 /// <p>An expression can contain any of the following:</p>
42 /// <ul>
43 /// <li>
44 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
45 /// <p>These function names are case-sensitive.</p></li>
46 /// <li>
47 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
48 /// <li>
49 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
50 /// </ul>
51 /// <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>
52 pub condition_expression: ::std::option::Option<::std::string::String>,
53 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
54 /// <ul>
55 /// <li>
56 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
57 /// <li>
58 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
59 /// <li>
60 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
61 /// </ul>
62 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
63 /// <ul>
64 /// <li>
65 /// <p><code>Percentile</code></p></li>
66 /// </ul>
67 /// <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>
68 /// <ul>
69 /// <li>
70 /// <p><code>{"#P":"Percentile"}</code></p></li>
71 /// </ul>
72 /// <p>You could then use this substitution in an expression, as in this example:</p>
73 /// <ul>
74 /// <li>
75 /// <p><code>#P = :val</code></p></li>
76 /// </ul><note>
77 /// <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>
78 /// </note>
79 /// <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>
80 pub expression_attribute_names: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>,
81 /// <p>One or more values that can be substituted in an expression.</p>
82 /// <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>
83 /// <p><code>Available | Backordered | Discontinued</code></p>
84 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
85 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
86 /// <p>You could then use these values in an expression, such as this:</p>
87 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
88 /// <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>
89 pub expression_attribute_values: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
90 /// <p>An optional parameter that returns the item attributes for a <code>DeleteItem</code> operation that failed a condition check.</p>
91 /// <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>
92 pub return_values_on_condition_check_failure: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
93}
94impl DeleteItemInput {
95 /// <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>
96 pub fn table_name(&self) -> ::std::option::Option<&str> {
97 self.table_name.as_deref()
98 }
99 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to delete.</p>
100 /// <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>
101 pub fn key(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
102 self.key.as_ref()
103 }
104 /// <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>
105 pub fn expected(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>> {
106 self.expected.as_ref()
107 }
108 /// <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>
109 pub fn conditional_operator(&self) -> ::std::option::Option<&crate::types::ConditionalOperator> {
110 self.conditional_operator.as_ref()
111 }
112 /// <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>
113 /// <ul>
114 /// <li>
115 /// <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>
116 /// <li>
117 /// <p><code>ALL_OLD</code> - The content of the old item is returned.</p></li>
118 /// </ul>
119 /// <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>
120 /// <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>
121 /// </note>
122 pub fn return_values(&self) -> ::std::option::Option<&crate::types::ReturnValue> {
123 self.return_values.as_ref()
124 }
125 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
126 /// <ul>
127 /// <li>
128 /// <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>
129 /// <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>
130 /// <li>
131 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
132 /// <li>
133 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
134 /// </ul>
135 pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
136 self.return_consumed_capacity.as_ref()
137 }
138 /// <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>
139 pub fn return_item_collection_metrics(&self) -> ::std::option::Option<&crate::types::ReturnItemCollectionMetrics> {
140 self.return_item_collection_metrics.as_ref()
141 }
142 /// <p>A condition that must be satisfied in order for a conditional <code>DeleteItem</code> to succeed.</p>
143 /// <p>An expression can contain any of the following:</p>
144 /// <ul>
145 /// <li>
146 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
147 /// <p>These function names are case-sensitive.</p></li>
148 /// <li>
149 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
150 /// <li>
151 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
152 /// </ul>
153 /// <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>
154 pub fn condition_expression(&self) -> ::std::option::Option<&str> {
155 self.condition_expression.as_deref()
156 }
157 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
158 /// <ul>
159 /// <li>
160 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
161 /// <li>
162 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
163 /// <li>
164 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
165 /// </ul>
166 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
167 /// <ul>
168 /// <li>
169 /// <p><code>Percentile</code></p></li>
170 /// </ul>
171 /// <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>
172 /// <ul>
173 /// <li>
174 /// <p><code>{"#P":"Percentile"}</code></p></li>
175 /// </ul>
176 /// <p>You could then use this substitution in an expression, as in this example:</p>
177 /// <ul>
178 /// <li>
179 /// <p><code>#P = :val</code></p></li>
180 /// </ul><note>
181 /// <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>
182 /// </note>
183 /// <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>
184 pub fn expression_attribute_names(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
185 self.expression_attribute_names.as_ref()
186 }
187 /// <p>One or more values that can be substituted in an expression.</p>
188 /// <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>
189 /// <p><code>Available | Backordered | Discontinued</code></p>
190 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
191 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
192 /// <p>You could then use these values in an expression, such as this:</p>
193 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
194 /// <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>
195 pub fn expression_attribute_values(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
196 self.expression_attribute_values.as_ref()
197 }
198 /// <p>An optional parameter that returns the item attributes for a <code>DeleteItem</code> operation that failed a condition check.</p>
199 /// <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>
200 pub fn return_values_on_condition_check_failure(&self) -> ::std::option::Option<&crate::types::ReturnValuesOnConditionCheckFailure> {
201 self.return_values_on_condition_check_failure.as_ref()
202 }
203}
204static DELETEITEMINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.dynamodb.synthetic#DeleteItemInput", "com.amazonaws.dynamodb.synthetic", "DeleteItemInput");
205static DELETEITEMINPUT_MEMBER_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
206 ::aws_smithy_schema::ShapeId::from_static(
207 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$TableName",
208 "com.amazonaws.dynamodb.synthetic",
209 "DeleteItemInput",
210 ),
211 ::aws_smithy_schema::ShapeType::String,
212 "TableName",
213 0,
214 );
215static DELETEITEMINPUT_MEMBER_KEY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
216 ::aws_smithy_schema::ShapeId::from_static(
217 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$Key",
218 "com.amazonaws.dynamodb.synthetic",
219 "DeleteItemInput",
220 ),
221 ::aws_smithy_schema::ShapeType::Map,
222 "Key",
223 1,
224 );
225static DELETEITEMINPUT_MEMBER_EXPECTED: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
226 ::aws_smithy_schema::ShapeId::from_static(
227 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$Expected",
228 "com.amazonaws.dynamodb.synthetic",
229 "DeleteItemInput",
230 ),
231 ::aws_smithy_schema::ShapeType::Map,
232 "Expected",
233 2,
234 );
235static DELETEITEMINPUT_MEMBER_CONDITIONAL_OPERATOR: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
236 ::aws_smithy_schema::ShapeId::from_static(
237 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$ConditionalOperator",
238 "com.amazonaws.dynamodb.synthetic",
239 "DeleteItemInput",
240 ),
241 ::aws_smithy_schema::ShapeType::String,
242 "ConditionalOperator",
243 3,
244 );
245static DELETEITEMINPUT_MEMBER_RETURN_VALUES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
246 ::aws_smithy_schema::ShapeId::from_static(
247 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$ReturnValues",
248 "com.amazonaws.dynamodb.synthetic",
249 "DeleteItemInput",
250 ),
251 ::aws_smithy_schema::ShapeType::String,
252 "ReturnValues",
253 4,
254 );
255static DELETEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
256 ::aws_smithy_schema::ShapeId::from_static(
257 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$ReturnConsumedCapacity",
258 "com.amazonaws.dynamodb.synthetic",
259 "DeleteItemInput",
260 ),
261 ::aws_smithy_schema::ShapeType::String,
262 "ReturnConsumedCapacity",
263 5,
264 );
265static DELETEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
266 ::aws_smithy_schema::ShapeId::from_static(
267 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$ReturnItemCollectionMetrics",
268 "com.amazonaws.dynamodb.synthetic",
269 "DeleteItemInput",
270 ),
271 ::aws_smithy_schema::ShapeType::String,
272 "ReturnItemCollectionMetrics",
273 6,
274 );
275static DELETEITEMINPUT_MEMBER_CONDITION_EXPRESSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
276 ::aws_smithy_schema::ShapeId::from_static(
277 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$ConditionExpression",
278 "com.amazonaws.dynamodb.synthetic",
279 "DeleteItemInput",
280 ),
281 ::aws_smithy_schema::ShapeType::String,
282 "ConditionExpression",
283 7,
284 );
285static DELETEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
286 ::aws_smithy_schema::ShapeId::from_static(
287 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$ExpressionAttributeNames",
288 "com.amazonaws.dynamodb.synthetic",
289 "DeleteItemInput",
290 ),
291 ::aws_smithy_schema::ShapeType::Map,
292 "ExpressionAttributeNames",
293 8,
294 );
295static DELETEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
296 ::aws_smithy_schema::ShapeId::from_static(
297 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$ExpressionAttributeValues",
298 "com.amazonaws.dynamodb.synthetic",
299 "DeleteItemInput",
300 ),
301 ::aws_smithy_schema::ShapeType::Map,
302 "ExpressionAttributeValues",
303 9,
304 );
305static DELETEITEMINPUT_MEMBER_RETURN_VALUES_ON_CONDITION_CHECK_FAILURE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
306 ::aws_smithy_schema::ShapeId::from_static(
307 "com.amazonaws.dynamodb.synthetic#DeleteItemInput$ReturnValuesOnConditionCheckFailure",
308 "com.amazonaws.dynamodb.synthetic",
309 "DeleteItemInput",
310 ),
311 ::aws_smithy_schema::ShapeType::String,
312 "ReturnValuesOnConditionCheckFailure",
313 10,
314 );
315static DELETEITEMINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
316 DELETEITEMINPUT_SCHEMA_ID,
317 ::aws_smithy_schema::ShapeType::Structure,
318 &[&DELETEITEMINPUT_MEMBER_TABLE_NAME, &DELETEITEMINPUT_MEMBER_KEY, &DELETEITEMINPUT_MEMBER_EXPECTED, &DELETEITEMINPUT_MEMBER_CONDITIONAL_OPERATOR, &DELETEITEMINPUT_MEMBER_RETURN_VALUES, &DELETEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY, &DELETEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS, &DELETEITEMINPUT_MEMBER_CONDITION_EXPRESSION, &DELETEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES, &DELETEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES, &DELETEITEMINPUT_MEMBER_RETURN_VALUES_ON_CONDITION_CHECK_FAILURE],
319 );
320impl DeleteItemInput {
321 /// The schema for this shape.
322 pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &DELETEITEMINPUT_SCHEMA;
323 }
324impl ::aws_smithy_schema::serde::SerializableStruct for DeleteItemInput {
325 #[allow(unused_variables, clippy::diverging_sub_expression)]
326 fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
327 if let Some(ref val) = self.table_name {
328 ser.write_string(&DELETEITEMINPUT_MEMBER_TABLE_NAME, val)?;
329 }
330if let Some(ref val) = self.key {
331
332 ser.write_map(&DELETEITEMINPUT_MEMBER_KEY, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
333 for (key, value) in val {
334 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
335 ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
336 }
337 Ok(())
338 })?;
339
340 }
341if let Some(ref val) = self.expected {
342
343 ser.write_map(&DELETEITEMINPUT_MEMBER_EXPECTED, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
344 for (key, value) in val {
345 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
346 ser.write_struct(crate::types::ExpectedAttributeValue::SCHEMA, value)?;
347 }
348 Ok(())
349 })?;
350
351 }
352if let Some(ref val) = self.conditional_operator {
353 ser.write_string(&DELETEITEMINPUT_MEMBER_CONDITIONAL_OPERATOR, val.as_str())?;
354 }
355if let Some(ref val) = self.return_values {
356 ser.write_string(&DELETEITEMINPUT_MEMBER_RETURN_VALUES, val.as_str())?;
357 }
358if let Some(ref val) = self.return_consumed_capacity {
359 ser.write_string(&DELETEITEMINPUT_MEMBER_RETURN_CONSUMED_CAPACITY, val.as_str())?;
360 }
361if let Some(ref val) = self.return_item_collection_metrics {
362 ser.write_string(&DELETEITEMINPUT_MEMBER_RETURN_ITEM_COLLECTION_METRICS, val.as_str())?;
363 }
364if let Some(ref val) = self.condition_expression {
365 ser.write_string(&DELETEITEMINPUT_MEMBER_CONDITION_EXPRESSION, val)?;
366 }
367if let Some(ref val) = self.expression_attribute_names {
368
369 ser.write_map(&DELETEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
370 for (key, value) in val {
371 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
372 ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
373 }
374 Ok(())
375 })?;
376
377 }
378if let Some(ref val) = self.expression_attribute_values {
379
380 ser.write_map(&DELETEITEMINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
381 for (key, value) in val {
382 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
383 ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
384 }
385 Ok(())
386 })?;
387
388 }
389if let Some(ref val) = self.return_values_on_condition_check_failure {
390 ser.write_string(&DELETEITEMINPUT_MEMBER_RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, val.as_str())?;
391 }
392 Ok(())
393 }
394 }
395impl DeleteItemInput {
396 /// Deserializes this structure from a [`ShapeDeserializer`].
397 pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
398 #[allow(unused_variables, unused_mut)]
399 let mut builder = Self::builder();
400 #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
401 deserializer.read_struct(&DELETEITEMINPUT_SCHEMA, &mut |member, deser| {
402 match member.member_index() {
403 Some(0) => {
404 builder.table_name = Some(deser.read_string(member)?);
405 }
406Some(1) => {
407 builder.key = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::AttributeValue::deserialize(deser)?); Ok(()) })?; container });
408 }
409Some(2) => {
410 builder.expected = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::ExpectedAttributeValue::deserialize(deser)?); Ok(()) })?; container });
411 }
412Some(3) => {
413 builder.conditional_operator = Some(crate::types::ConditionalOperator::from(deser.read_string(member)?.as_str()));
414 }
415Some(4) => {
416 builder.return_values = Some(crate::types::ReturnValue::from(deser.read_string(member)?.as_str()));
417 }
418Some(5) => {
419 builder.return_consumed_capacity = Some(crate::types::ReturnConsumedCapacity::from(deser.read_string(member)?.as_str()));
420 }
421Some(6) => {
422 builder.return_item_collection_metrics = Some(crate::types::ReturnItemCollectionMetrics::from(deser.read_string(member)?.as_str()));
423 }
424Some(7) => {
425 builder.condition_expression = Some(deser.read_string(member)?);
426 }
427Some(8) => {
428 builder.expression_attribute_names = Some(deser.read_string_string_map(member)?);
429 }
430Some(9) => {
431 builder.expression_attribute_values = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::AttributeValue::deserialize(deser)?); Ok(()) })?; container });
432 }
433Some(10) => {
434 builder.return_values_on_condition_check_failure = Some(crate::types::ReturnValuesOnConditionCheckFailure::from(deser.read_string(member)?.as_str()));
435 }
436 _ => {}
437 }
438 Ok(())
439 })?;
440 builder.table_name = builder.table_name.or(Some(String::new()));
441builder.key = builder.key.or(Some(::std::collections::HashMap::new()));
442builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
443 }
444 }
445impl DeleteItemInput {
446 /// Deserializes this structure from a body deserializer and HTTP response.
447 pub fn deserialize_with_response(
448 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
449 _headers: &::aws_smithy_runtime_api::http::Headers,
450 _status: u16,
451 _body: &[u8],
452 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
453 Self::deserialize(deserializer)
454 }
455 }
456impl DeleteItemInput {
457 /// Creates a new builder-style object to manufacture [`DeleteItemInput`](crate::operation::delete_item::DeleteItemInput).
458 pub fn builder() -> crate::operation::delete_item::builders::DeleteItemInputBuilder {
459 crate::operation::delete_item::builders::DeleteItemInputBuilder::default()
460 }
461}
462
463/// A builder for [`DeleteItemInput`](crate::operation::delete_item::DeleteItemInput).
464#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
465#[non_exhaustive]
466pub struct DeleteItemInputBuilder {
467 pub(crate) table_name: ::std::option::Option<::std::string::String>,
468 pub(crate) key: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
469 pub(crate) expected: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>>,
470 pub(crate) conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
471 pub(crate) return_values: ::std::option::Option<crate::types::ReturnValue>,
472 pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
473 pub(crate) return_item_collection_metrics: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>,
474 pub(crate) condition_expression: ::std::option::Option<::std::string::String>,
475 pub(crate) expression_attribute_names: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>,
476 pub(crate) expression_attribute_values: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
477 pub(crate) return_values_on_condition_check_failure: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
478}
479impl DeleteItemInputBuilder {
480 /// <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>
481 /// This field is required.
482 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
483 self.table_name = ::std::option::Option::Some(input.into());
484 self
485 }
486 /// <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>
487 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
488 self.table_name = input; self
489 }
490 /// <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>
491 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
492 &self.table_name
493 }
494 /// Adds a key-value pair to `key`.
495 ///
496 /// To override the contents of this collection use [`set_key`](Self::set_key).
497 ///
498 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to delete.</p>
499 /// <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>
500 pub fn key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
501 let mut hash_map = self.key.unwrap_or_default();
502 hash_map.insert(k.into(), v);
503 self.key = ::std::option::Option::Some(hash_map);
504 self
505 }
506 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to delete.</p>
507 /// <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>
508 pub fn set_key(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
509 self.key = input; self
510 }
511 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to delete.</p>
512 /// <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>
513 pub fn get_key(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
514 &self.key
515 }
516 /// Adds a key-value pair to `expected`.
517 ///
518 /// To override the contents of this collection use [`set_expected`](Self::set_expected).
519 ///
520 /// <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>
521 pub fn expected(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ExpectedAttributeValue) -> Self {
522 let mut hash_map = self.expected.unwrap_or_default();
523 hash_map.insert(k.into(), v);
524 self.expected = ::std::option::Option::Some(hash_map);
525 self
526 }
527 /// <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>
528 pub fn set_expected(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>>) -> Self {
529 self.expected = input; self
530 }
531 /// <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>
532 pub fn get_expected(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::ExpectedAttributeValue>> {
533 &self.expected
534 }
535 /// <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>
536 pub fn conditional_operator(mut self, input: crate::types::ConditionalOperator) -> Self {
537 self.conditional_operator = ::std::option::Option::Some(input);
538 self
539 }
540 /// <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>
541 pub fn set_conditional_operator(mut self, input: ::std::option::Option<crate::types::ConditionalOperator>) -> Self {
542 self.conditional_operator = input; self
543 }
544 /// <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>
545 pub fn get_conditional_operator(&self) -> &::std::option::Option<crate::types::ConditionalOperator> {
546 &self.conditional_operator
547 }
548 /// <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>
549 /// <ul>
550 /// <li>
551 /// <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>
552 /// <li>
553 /// <p><code>ALL_OLD</code> - The content of the old item is returned.</p></li>
554 /// </ul>
555 /// <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>
556 /// <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>
557 /// </note>
558 pub fn return_values(mut self, input: crate::types::ReturnValue) -> Self {
559 self.return_values = ::std::option::Option::Some(input);
560 self
561 }
562 /// <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>
563 /// <ul>
564 /// <li>
565 /// <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>
566 /// <li>
567 /// <p><code>ALL_OLD</code> - The content of the old item is returned.</p></li>
568 /// </ul>
569 /// <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>
570 /// <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>
571 /// </note>
572 pub fn set_return_values(mut self, input: ::std::option::Option<crate::types::ReturnValue>) -> Self {
573 self.return_values = input; self
574 }
575 /// <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>
576 /// <ul>
577 /// <li>
578 /// <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>
579 /// <li>
580 /// <p><code>ALL_OLD</code> - The content of the old item is returned.</p></li>
581 /// </ul>
582 /// <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>
583 /// <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>
584 /// </note>
585 pub fn get_return_values(&self) -> &::std::option::Option<crate::types::ReturnValue> {
586 &self.return_values
587 }
588 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
589 /// <ul>
590 /// <li>
591 /// <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>
592 /// <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>
593 /// <li>
594 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
595 /// <li>
596 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
597 /// </ul>
598 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
599 self.return_consumed_capacity = ::std::option::Option::Some(input);
600 self
601 }
602 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
603 /// <ul>
604 /// <li>
605 /// <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>
606 /// <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>
607 /// <li>
608 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
609 /// <li>
610 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
611 /// </ul>
612 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
613 self.return_consumed_capacity = input; self
614 }
615 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
616 /// <ul>
617 /// <li>
618 /// <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>
619 /// <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>
620 /// <li>
621 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
622 /// <li>
623 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
624 /// </ul>
625 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
626 &self.return_consumed_capacity
627 }
628 /// <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>
629 pub fn return_item_collection_metrics(mut self, input: crate::types::ReturnItemCollectionMetrics) -> Self {
630 self.return_item_collection_metrics = ::std::option::Option::Some(input);
631 self
632 }
633 /// <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>
634 pub fn set_return_item_collection_metrics(mut self, input: ::std::option::Option<crate::types::ReturnItemCollectionMetrics>) -> Self {
635 self.return_item_collection_metrics = input; self
636 }
637 /// <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>
638 pub fn get_return_item_collection_metrics(&self) -> &::std::option::Option<crate::types::ReturnItemCollectionMetrics> {
639 &self.return_item_collection_metrics
640 }
641 /// <p>A condition that must be satisfied in order for a conditional <code>DeleteItem</code> to succeed.</p>
642 /// <p>An expression can contain any of the following:</p>
643 /// <ul>
644 /// <li>
645 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
646 /// <p>These function names are case-sensitive.</p></li>
647 /// <li>
648 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
649 /// <li>
650 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
651 /// </ul>
652 /// <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>
653 pub fn condition_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
654 self.condition_expression = ::std::option::Option::Some(input.into());
655 self
656 }
657 /// <p>A condition that must be satisfied in order for a conditional <code>DeleteItem</code> to succeed.</p>
658 /// <p>An expression can contain any of the following:</p>
659 /// <ul>
660 /// <li>
661 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
662 /// <p>These function names are case-sensitive.</p></li>
663 /// <li>
664 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
665 /// <li>
666 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
667 /// </ul>
668 /// <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>
669 pub fn set_condition_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
670 self.condition_expression = input; self
671 }
672 /// <p>A condition that must be satisfied in order for a conditional <code>DeleteItem</code> to succeed.</p>
673 /// <p>An expression can contain any of the following:</p>
674 /// <ul>
675 /// <li>
676 /// <p>Functions: <code>attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size</code></p>
677 /// <p>These function names are case-sensitive.</p></li>
678 /// <li>
679 /// <p>Comparison operators: <code>= | <> | < | > | <= | >= | BETWEEN | IN </code></p></li>
680 /// <li>
681 /// <p>Logical operators: <code>AND | OR | NOT</code></p></li>
682 /// </ul>
683 /// <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>
684 pub fn get_condition_expression(&self) -> &::std::option::Option<::std::string::String> {
685 &self.condition_expression
686 }
687 /// Adds a key-value pair to `expression_attribute_names`.
688 ///
689 /// To override the contents of this collection use [`set_expression_attribute_names`](Self::set_expression_attribute_names).
690 ///
691 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
692 /// <ul>
693 /// <li>
694 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
695 /// <li>
696 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
697 /// <li>
698 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
699 /// </ul>
700 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
701 /// <ul>
702 /// <li>
703 /// <p><code>Percentile</code></p></li>
704 /// </ul>
705 /// <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>
706 /// <ul>
707 /// <li>
708 /// <p><code>{"#P":"Percentile"}</code></p></li>
709 /// </ul>
710 /// <p>You could then use this substitution in an expression, as in this example:</p>
711 /// <ul>
712 /// <li>
713 /// <p><code>#P = :val</code></p></li>
714 /// </ul><note>
715 /// <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>
716 /// </note>
717 /// <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>
718 pub fn expression_attribute_names(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
719 let mut hash_map = self.expression_attribute_names.unwrap_or_default();
720 hash_map.insert(k.into(), v.into());
721 self.expression_attribute_names = ::std::option::Option::Some(hash_map);
722 self
723 }
724 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
725 /// <ul>
726 /// <li>
727 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
728 /// <li>
729 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
730 /// <li>
731 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
732 /// </ul>
733 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
734 /// <ul>
735 /// <li>
736 /// <p><code>Percentile</code></p></li>
737 /// </ul>
738 /// <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>
739 /// <ul>
740 /// <li>
741 /// <p><code>{"#P":"Percentile"}</code></p></li>
742 /// </ul>
743 /// <p>You could then use this substitution in an expression, as in this example:</p>
744 /// <ul>
745 /// <li>
746 /// <p><code>#P = :val</code></p></li>
747 /// </ul><note>
748 /// <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>
749 /// </note>
750 /// <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>
751 pub fn set_expression_attribute_names(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>) -> Self {
752 self.expression_attribute_names = input; self
753 }
754 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
755 /// <ul>
756 /// <li>
757 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
758 /// <li>
759 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
760 /// <li>
761 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
762 /// </ul>
763 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
764 /// <ul>
765 /// <li>
766 /// <p><code>Percentile</code></p></li>
767 /// </ul>
768 /// <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>
769 /// <ul>
770 /// <li>
771 /// <p><code>{"#P":"Percentile"}</code></p></li>
772 /// </ul>
773 /// <p>You could then use this substitution in an expression, as in this example:</p>
774 /// <ul>
775 /// <li>
776 /// <p><code>#P = :val</code></p></li>
777 /// </ul><note>
778 /// <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>
779 /// </note>
780 /// <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>
781 pub fn get_expression_attribute_names(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
782 &self.expression_attribute_names
783 }
784 /// Adds a key-value pair to `expression_attribute_values`.
785 ///
786 /// To override the contents of this collection use [`set_expression_attribute_values`](Self::set_expression_attribute_values).
787 ///
788 /// <p>One or more values that can be substituted in an expression.</p>
789 /// <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>
790 /// <p><code>Available | Backordered | Discontinued</code></p>
791 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
792 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
793 /// <p>You could then use these values in an expression, such as this:</p>
794 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
795 /// <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>
796 pub fn expression_attribute_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
797 let mut hash_map = self.expression_attribute_values.unwrap_or_default();
798 hash_map.insert(k.into(), v);
799 self.expression_attribute_values = ::std::option::Option::Some(hash_map);
800 self
801 }
802 /// <p>One or more values that can be substituted in an expression.</p>
803 /// <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>
804 /// <p><code>Available | Backordered | Discontinued</code></p>
805 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
806 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
807 /// <p>You could then use these values in an expression, such as this:</p>
808 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
809 /// <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>
810 pub fn set_expression_attribute_values(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
811 self.expression_attribute_values = input; self
812 }
813 /// <p>One or more values that can be substituted in an expression.</p>
814 /// <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>
815 /// <p><code>Available | Backordered | Discontinued</code></p>
816 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
817 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
818 /// <p>You could then use these values in an expression, such as this:</p>
819 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
820 /// <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>
821 pub fn get_expression_attribute_values(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
822 &self.expression_attribute_values
823 }
824 /// <p>An optional parameter that returns the item attributes for a <code>DeleteItem</code> operation that failed a condition check.</p>
825 /// <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>
826 pub fn return_values_on_condition_check_failure(mut self, input: crate::types::ReturnValuesOnConditionCheckFailure) -> Self {
827 self.return_values_on_condition_check_failure = ::std::option::Option::Some(input);
828 self
829 }
830 /// <p>An optional parameter that returns the item attributes for a <code>DeleteItem</code> operation that failed a condition check.</p>
831 /// <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>
832 pub fn set_return_values_on_condition_check_failure(mut self, input: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>) -> Self {
833 self.return_values_on_condition_check_failure = input; self
834 }
835 /// <p>An optional parameter that returns the item attributes for a <code>DeleteItem</code> operation that failed a condition check.</p>
836 /// <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>
837 pub fn get_return_values_on_condition_check_failure(&self) -> &::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure> {
838 &self.return_values_on_condition_check_failure
839 }
840 /// Consumes the builder and constructs a [`DeleteItemInput`](crate::operation::delete_item::DeleteItemInput).
841 pub fn build(self) -> ::std::result::Result<crate::operation::delete_item::DeleteItemInput, ::aws_smithy_types::error::operation::BuildError> {
842 ::std::result::Result::Ok(
843 crate::operation::delete_item::DeleteItemInput {
844 table_name: self.table_name
845 ,
846 key: self.key
847 ,
848 expected: self.expected
849 ,
850 conditional_operator: self.conditional_operator
851 ,
852 return_values: self.return_values
853 ,
854 return_consumed_capacity: self.return_consumed_capacity
855 ,
856 return_item_collection_metrics: self.return_item_collection_metrics
857 ,
858 condition_expression: self.condition_expression
859 ,
860 expression_attribute_names: self.expression_attribute_names
861 ,
862 expression_attribute_values: self.expression_attribute_values
863 ,
864 return_values_on_condition_check_failure: self.return_values_on_condition_check_failure
865 ,
866 }
867 )
868 }
869}
870