aws_sdk_dynamodb/operation/get_item/_get_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>GetItem</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetItemInput {
7 /// <p>The name of the table containing the requested 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 retrieve.</p>
10 /// <p>For the primary key, you must provide all of the 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>ProjectionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html">AttributesToGet</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
13 pub attributes_to_get: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
14 /// <p>Determines the read consistency model: If set to <code>true</code>, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.</p>
15 pub consistent_read: ::std::option::Option<bool>,
16 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
17 /// <ul>
18 /// <li>
19 /// <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>
20 /// <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>
21 /// <li>
22 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
23 /// <li>
24 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
25 /// </ul>
26 pub return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
27 /// <p>A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.</p>
28 /// <p>If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.</p>
29 /// <p>For more information, 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>
30 pub projection_expression: ::std::option::Option<::std::string::String>,
31 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
32 /// <ul>
33 /// <li>
34 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
35 /// <li>
36 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
37 /// <li>
38 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
39 /// </ul>
40 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
41 /// <ul>
42 /// <li>
43 /// <p><code>Percentile</code></p></li>
44 /// </ul>
45 /// <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>
46 /// <ul>
47 /// <li>
48 /// <p><code>{"#P":"Percentile"}</code></p></li>
49 /// </ul>
50 /// <p>You could then use this substitution in an expression, as in this example:</p>
51 /// <ul>
52 /// <li>
53 /// <p><code>#P = :val</code></p></li>
54 /// </ul><note>
55 /// <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>
56 /// </note>
57 /// <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>
58 pub expression_attribute_names: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>,
59}
60impl GetItemInput {
61 /// <p>The name of the table containing the requested item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
62 pub fn table_name(&self) -> ::std::option::Option<&str> {
63 self.table_name.as_deref()
64 }
65 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to retrieve.</p>
66 /// <p>For the primary key, you must provide all of the 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>
67 pub fn key(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
68 self.key.as_ref()
69 }
70 /// <p>This is a legacy parameter. Use <code>ProjectionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html">AttributesToGet</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
71 ///
72 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attributes_to_get.is_none()`.
73 pub fn attributes_to_get(&self) -> &[::std::string::String] {
74 self.attributes_to_get.as_deref()
75 .unwrap_or_default()
76 }
77 /// <p>Determines the read consistency model: If set to <code>true</code>, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.</p>
78 pub fn consistent_read(&self) -> ::std::option::Option<bool> {
79 self.consistent_read
80 }
81 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
82 /// <ul>
83 /// <li>
84 /// <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>
85 /// <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>
86 /// <li>
87 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
88 /// <li>
89 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
90 /// </ul>
91 pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
92 self.return_consumed_capacity.as_ref()
93 }
94 /// <p>A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.</p>
95 /// <p>If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.</p>
96 /// <p>For more information, 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>
97 pub fn projection_expression(&self) -> ::std::option::Option<&str> {
98 self.projection_expression.as_deref()
99 }
100 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
101 /// <ul>
102 /// <li>
103 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
104 /// <li>
105 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
106 /// <li>
107 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
108 /// </ul>
109 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
110 /// <ul>
111 /// <li>
112 /// <p><code>Percentile</code></p></li>
113 /// </ul>
114 /// <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>
115 /// <ul>
116 /// <li>
117 /// <p><code>{"#P":"Percentile"}</code></p></li>
118 /// </ul>
119 /// <p>You could then use this substitution in an expression, as in this example:</p>
120 /// <ul>
121 /// <li>
122 /// <p><code>#P = :val</code></p></li>
123 /// </ul><note>
124 /// <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>
125 /// </note>
126 /// <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>
127 pub fn expression_attribute_names(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
128 self.expression_attribute_names.as_ref()
129 }
130}
131impl GetItemInput {
132 /// Creates a new builder-style object to manufacture [`GetItemInput`](crate::operation::get_item::GetItemInput).
133 pub fn builder() -> crate::operation::get_item::builders::GetItemInputBuilder {
134 crate::operation::get_item::builders::GetItemInputBuilder::default()
135 }
136}
137
138/// A builder for [`GetItemInput`](crate::operation::get_item::GetItemInput).
139#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
140#[non_exhaustive]
141pub struct GetItemInputBuilder {
142 pub(crate) table_name: ::std::option::Option<::std::string::String>,
143 pub(crate) key: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
144 pub(crate) attributes_to_get: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
145 pub(crate) consistent_read: ::std::option::Option<bool>,
146 pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
147 pub(crate) projection_expression: ::std::option::Option<::std::string::String>,
148 pub(crate) expression_attribute_names: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>,
149}
150impl GetItemInputBuilder {
151 /// <p>The name of the table containing the requested item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
152 /// This field is required.
153 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.table_name = ::std::option::Option::Some(input.into());
155 self
156 }
157 /// <p>The name of the table containing the requested item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
158 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.table_name = input; self
160 }
161 /// <p>The name of the table containing the requested item. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
162 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
163 &self.table_name
164 }
165 /// Adds a key-value pair to `key`.
166 ///
167 /// To override the contents of this collection use [`set_key`](Self::set_key).
168 ///
169 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to retrieve.</p>
170 /// <p>For the primary key, you must provide all of the 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>
171 pub fn key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
172 let mut hash_map = self.key.unwrap_or_default();
173 hash_map.insert(k.into(), v);
174 self.key = ::std::option::Option::Some(hash_map);
175 self
176 }
177 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to retrieve.</p>
178 /// <p>For the primary key, you must provide all of the 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>
179 pub fn set_key(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
180 self.key = input; self
181 }
182 /// <p>A map of attribute names to <code>AttributeValue</code> objects, representing the primary key of the item to retrieve.</p>
183 /// <p>For the primary key, you must provide all of the 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>
184 pub fn get_key(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
185 &self.key
186 }
187 /// Appends an item to `attributes_to_get`.
188 ///
189 /// To override the contents of this collection use [`set_attributes_to_get`](Self::set_attributes_to_get).
190 ///
191 /// <p>This is a legacy parameter. Use <code>ProjectionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html">AttributesToGet</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
192 pub fn attributes_to_get(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193 let mut v = self.attributes_to_get.unwrap_or_default();
194 v.push(input.into());
195 self.attributes_to_get = ::std::option::Option::Some(v);
196 self
197 }
198 /// <p>This is a legacy parameter. Use <code>ProjectionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html">AttributesToGet</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
199 pub fn set_attributes_to_get(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
200 self.attributes_to_get = input; self
201 }
202 /// <p>This is a legacy parameter. Use <code>ProjectionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html">AttributesToGet</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
203 pub fn get_attributes_to_get(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
204 &self.attributes_to_get
205 }
206 /// <p>Determines the read consistency model: If set to <code>true</code>, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.</p>
207 pub fn consistent_read(mut self, input: bool) -> Self {
208 self.consistent_read = ::std::option::Option::Some(input);
209 self
210 }
211 /// <p>Determines the read consistency model: If set to <code>true</code>, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.</p>
212 pub fn set_consistent_read(mut self, input: ::std::option::Option<bool>) -> Self {
213 self.consistent_read = input; self
214 }
215 /// <p>Determines the read consistency model: If set to <code>true</code>, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.</p>
216 pub fn get_consistent_read(&self) -> &::std::option::Option<bool> {
217 &self.consistent_read
218 }
219 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
220 /// <ul>
221 /// <li>
222 /// <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>
223 /// <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>
224 /// <li>
225 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
226 /// <li>
227 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
228 /// </ul>
229 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
230 self.return_consumed_capacity = ::std::option::Option::Some(input);
231 self
232 }
233 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
234 /// <ul>
235 /// <li>
236 /// <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>
237 /// <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>
238 /// <li>
239 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
240 /// <li>
241 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
242 /// </ul>
243 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
244 self.return_consumed_capacity = input; self
245 }
246 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
247 /// <ul>
248 /// <li>
249 /// <p><code>INDEXES</code> - The response includes the aggregate <code>ConsumedCapacity</code> for the operation, together with <code>ConsumedCapacity</code> for each table and secondary index that was accessed.</p>
250 /// <p>Note that some operations, such as <code>GetItem</code> and <code>BatchGetItem</code>, do not access any indexes at all. In these cases, specifying <code>INDEXES</code> will only return <code>ConsumedCapacity</code> information for table(s).</p></li>
251 /// <li>
252 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
253 /// <li>
254 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
255 /// </ul>
256 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
257 &self.return_consumed_capacity
258 }
259 /// <p>A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.</p>
260 /// <p>If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.</p>
261 /// <p>For more information, 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>
262 pub fn projection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263 self.projection_expression = ::std::option::Option::Some(input.into());
264 self
265 }
266 /// <p>A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.</p>
267 /// <p>If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.</p>
268 /// <p>For more information, 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>
269 pub fn set_projection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
270 self.projection_expression = input; self
271 }
272 /// <p>A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.</p>
273 /// <p>If no attribute names are specified, then all attributes are returned. If any of the requested attributes are not found, they do not appear in the result.</p>
274 /// <p>For more information, 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>
275 pub fn get_projection_expression(&self) -> &::std::option::Option<::std::string::String> {
276 &self.projection_expression
277 }
278 /// Adds a key-value pair to `expression_attribute_names`.
279 ///
280 /// To override the contents of this collection use [`set_expression_attribute_names`](Self::set_expression_attribute_names).
281 ///
282 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
283 /// <ul>
284 /// <li>
285 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
286 /// <li>
287 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
288 /// <li>
289 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
290 /// </ul>
291 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
292 /// <ul>
293 /// <li>
294 /// <p><code>Percentile</code></p></li>
295 /// </ul>
296 /// <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>
297 /// <ul>
298 /// <li>
299 /// <p><code>{"#P":"Percentile"}</code></p></li>
300 /// </ul>
301 /// <p>You could then use this substitution in an expression, as in this example:</p>
302 /// <ul>
303 /// <li>
304 /// <p><code>#P = :val</code></p></li>
305 /// </ul><note>
306 /// <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>
307 /// </note>
308 /// <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>
309 pub fn expression_attribute_names(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
310 let mut hash_map = self.expression_attribute_names.unwrap_or_default();
311 hash_map.insert(k.into(), v.into());
312 self.expression_attribute_names = ::std::option::Option::Some(hash_map);
313 self
314 }
315 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
316 /// <ul>
317 /// <li>
318 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
319 /// <li>
320 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
321 /// <li>
322 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
323 /// </ul>
324 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
325 /// <ul>
326 /// <li>
327 /// <p><code>Percentile</code></p></li>
328 /// </ul>
329 /// <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>
330 /// <ul>
331 /// <li>
332 /// <p><code>{"#P":"Percentile"}</code></p></li>
333 /// </ul>
334 /// <p>You could then use this substitution in an expression, as in this example:</p>
335 /// <ul>
336 /// <li>
337 /// <p><code>#P = :val</code></p></li>
338 /// </ul><note>
339 /// <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>
340 /// </note>
341 /// <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>
342 pub fn set_expression_attribute_names(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>) -> Self {
343 self.expression_attribute_names = input; self
344 }
345 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
346 /// <ul>
347 /// <li>
348 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
349 /// <li>
350 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
351 /// <li>
352 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
353 /// </ul>
354 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
355 /// <ul>
356 /// <li>
357 /// <p><code>Percentile</code></p></li>
358 /// </ul>
359 /// <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>
360 /// <ul>
361 /// <li>
362 /// <p><code>{"#P":"Percentile"}</code></p></li>
363 /// </ul>
364 /// <p>You could then use this substitution in an expression, as in this example:</p>
365 /// <ul>
366 /// <li>
367 /// <p><code>#P = :val</code></p></li>
368 /// </ul><note>
369 /// <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>
370 /// </note>
371 /// <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>
372 pub fn get_expression_attribute_names(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
373 &self.expression_attribute_names
374 }
375 /// Consumes the builder and constructs a [`GetItemInput`](crate::operation::get_item::GetItemInput).
376 pub fn build(self) -> ::std::result::Result<crate::operation::get_item::GetItemInput, ::aws_smithy_types::error::operation::BuildError> {
377 ::std::result::Result::Ok(
378 crate::operation::get_item::GetItemInput {
379 table_name: self.table_name
380 ,
381 key: self.key
382 ,
383 attributes_to_get: self.attributes_to_get
384 ,
385 consistent_read: self.consistent_read
386 ,
387 return_consumed_capacity: self.return_consumed_capacity
388 ,
389 projection_expression: self.projection_expression
390 ,
391 expression_attribute_names: self.expression_attribute_names
392 ,
393 }
394 )
395 }
396}
397