aws_sdk_dynamodb/operation/query/
_query_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>Query</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct QueryInput {
7    /// <p>The name of the table containing the requested items. 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>The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the <code>IndexName</code> parameter, you must also provide <code>TableName.</code></p>
10    pub index_name: ::std::option::Option<::std::string::String>,
11    /// <p>The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.</p>
12    /// <ul>
13    /// <li>
14    /// <p><code>ALL_ATTRIBUTES</code> - Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required.</p></li>
15    /// <li>
16    /// <p><code>ALL_PROJECTED_ATTRIBUTES</code> - Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifying <code>ALL_ATTRIBUTES</code>.</p></li>
17    /// <li>
18    /// <p><code>COUNT</code> - Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations.</p></li>
19    /// <li>
20    /// <p><code>SPECIFIC_ATTRIBUTES</code> - Returns only the attributes listed in <code>ProjectionExpression</code>. This return value is equivalent to specifying <code>ProjectionExpression</code> without specifying any value for <code>Select</code>.</p>
21    /// <p>If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.</p>
22    /// <p>If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.</p></li>
23    /// </ul>
24    /// <p>If neither <code>Select</code> nor <code>ProjectionExpression</code> are specified, DynamoDB defaults to <code>ALL_ATTRIBUTES</code> when accessing a table, and <code>ALL_PROJECTED_ATTRIBUTES</code> when accessing an index. You cannot use both <code>Select</code> and <code>ProjectionExpression</code> together in a single request, unless the value for <code>Select</code> is <code>SPECIFIC_ATTRIBUTES</code>. (This usage is equivalent to specifying <code>ProjectionExpression</code> without any value for <code>Select</code>.)</p><note>
25    /// <p>If you use the <code>ProjectionExpression</code> parameter, then the value for <code>Select</code> can only be <code>SPECIFIC_ATTRIBUTES</code>. Any other value for <code>Select</code> will return an error.</p>
26    /// </note>
27    pub select: ::std::option::Option<crate::types::Select>,
28    /// <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>
29    pub attributes_to_get: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
30    /// <p>The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation to continue the operation. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html">Query and Scan</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
31    pub limit: ::std::option::Option<i32>,
32    /// <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>
33    /// <p>Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with <code>ConsistentRead</code> set to <code>true</code>, you will receive a <code>ValidationException</code>.</p>
34    pub consistent_read: ::std::option::Option<bool>,
35    /// <p>This is a legacy parameter. Use <code>KeyConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html">KeyConditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
36    pub key_conditions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Condition>>,
37    /// <p>This is a legacy parameter. Use <code>FilterExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html">QueryFilter</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
38    pub query_filter: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Condition>>,
39    /// <p>This is a legacy parameter. Use <code>FilterExpression</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>
40    pub conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
41    /// <p>Specifies the order for index traversal: If <code>true</code> (default), the traversal is performed in ascending order; if <code>false</code>, the traversal is performed in descending order.</p>
42    /// <p>Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.</p>
43    /// <p>If <code>ScanIndexForward</code> is <code>true</code>, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If <code>ScanIndexForward</code> is <code>false</code>, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.</p>
44    pub scan_index_forward: ::std::option::Option<bool>,
45    /// <p>The primary key of the first item that this operation will evaluate. Use the value that was returned for <code>LastEvaluatedKey</code> in the previous operation.</p>
46    /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
47    pub exclusive_start_key: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
48    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
49    /// <ul>
50    /// <li>
51    /// <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>
52    /// <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>
53    /// <li>
54    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
55    /// <li>
56    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
57    /// </ul>
58    pub return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
59    /// <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>
60    /// <p>If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.</p>
61    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html">Accessing Item Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
62    pub projection_expression: ::std::option::Option<::std::string::String>,
63    /// <p>A string that contains conditions that DynamoDB applies after the <code>Query</code> operation, but before the data is returned to you. Items that do not satisfy the <code>FilterExpression</code> criteria are not returned.</p>
64    /// <p>A <code>FilterExpression</code> does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.</p><note>
65    /// <p>A <code>FilterExpression</code> is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.</p>
66    /// </note>
67    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.FilterExpression.html">Filter Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
68    pub filter_expression: ::std::option::Option<::std::string::String>,
69    /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
70    /// <p>The condition must perform an equality test on a single partition key value.</p>
71    /// <p>The condition can optionally perform one of several comparison tests on a single sort key value. This allows <code>Query</code> to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.</p>
72    /// <p>The partition key equality test is required, and must be specified in the following format:</p>
73    /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
74    /// <p>If you also want to provide a condition for the sort key, it must be combined using <code>AND</code> with the condition for the sort key. Following is an example, using the <b>=</b> comparison operator for the sort key:</p>
75    /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
76    /// <p>Valid comparisons for the sort key condition are as follows:</p>
77    /// <ul>
78    /// <li>
79    /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
80    /// <li>
81    /// <p><code>sortKeyName</code> <code>&lt;</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
82    /// <li>
83    /// <p><code>sortKeyName</code> <code>&lt;=</code> <code>:sortkeyval</code> - true if the sort key value is less than or equal to <code>:sortkeyval</code>.</p></li>
84    /// <li>
85    /// <p><code>sortKeyName</code> <code>&gt;</code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
86    /// <li>
87    /// <p><code>sortKeyName</code> <code>&gt;= </code> <code>:sortkeyval</code> - true if the sort key value is greater than or equal to <code>:sortkeyval</code>.</p></li>
88    /// <li>
89    /// <p><code>sortKeyName</code> <code>BETWEEN</code> <code>:sortkeyval1</code> <code>AND</code> <code>:sortkeyval2</code> - true if the sort key value is greater than or equal to <code>:sortkeyval1</code>, and less than or equal to <code>:sortkeyval2</code>.</p></li>
90    /// <li>
91    /// <p><code>begins_with (</code> <code>sortKeyName</code>, <code>:sortkeyval</code> <code>)</code> - true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function name <code>begins_with</code> is case-sensitive.</p></li>
92    /// </ul>
93    /// <p>Use the <code>ExpressionAttributeValues</code> parameter to replace tokens such as <code>:partitionval</code> and <code>:sortval</code> with actual values at runtime.</p>
94    /// <p>You can optionally use the <code>ExpressionAttributeNames</code> parameter to replace the names of the partition key and sort key with placeholder tokens. This option might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following <code>KeyConditionExpression</code> parameter causes an error because <i>Size</i> is a reserved word:</p>
95    /// <ul>
96    /// <li>
97    /// <p><code>Size = :myval</code></p></li>
98    /// </ul>
99    /// <p>To work around this, define a placeholder (such a <code>#S</code>) to represent the attribute name <i>Size</i>. <code>KeyConditionExpression</code> then is as follows:</p>
100    /// <ul>
101    /// <li>
102    /// <p><code>#S = :myval</code></p></li>
103    /// </ul>
104    /// <p>For a 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>.</p>
105    /// <p>For more information on <code>ExpressionAttributeNames</code> and <code>ExpressionAttributeValues</code>, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html">Using Placeholders for Attribute Names and Values</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
106    pub key_condition_expression: ::std::option::Option<::std::string::String>,
107    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
108    /// <ul>
109    /// <li>
110    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
111    /// <li>
112    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
113    /// <li>
114    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
115    /// </ul>
116    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
117    /// <ul>
118    /// <li>
119    /// <p><code>Percentile</code></p></li>
120    /// </ul>
121    /// <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>
122    /// <ul>
123    /// <li>
124    /// <p><code>{"#P":"Percentile"}</code></p></li>
125    /// </ul>
126    /// <p>You could then use this substitution in an expression, as in this example:</p>
127    /// <ul>
128    /// <li>
129    /// <p><code>#P = :val</code></p></li>
130    /// </ul><note>
131    /// <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>
132    /// </note>
133    /// <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>
134    pub expression_attribute_names: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
135    /// <p>One or more values that can be substituted in an expression.</p>
136    /// <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>
137    /// <p><code>Available | Backordered | Discontinued</code></p>
138    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
139    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
140    /// <p>You could then use these values in an expression, such as this:</p>
141    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
142    /// <p>For more information on expression attribute values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Specifying Conditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
143    pub expression_attribute_values: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
144}
145impl QueryInput {
146    /// <p>The name of the table containing the requested items. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
147    pub fn table_name(&self) -> ::std::option::Option<&str> {
148        self.table_name.as_deref()
149    }
150    /// <p>The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the <code>IndexName</code> parameter, you must also provide <code>TableName.</code></p>
151    pub fn index_name(&self) -> ::std::option::Option<&str> {
152        self.index_name.as_deref()
153    }
154    /// <p>The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.</p>
155    /// <ul>
156    /// <li>
157    /// <p><code>ALL_ATTRIBUTES</code> - Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required.</p></li>
158    /// <li>
159    /// <p><code>ALL_PROJECTED_ATTRIBUTES</code> - Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifying <code>ALL_ATTRIBUTES</code>.</p></li>
160    /// <li>
161    /// <p><code>COUNT</code> - Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations.</p></li>
162    /// <li>
163    /// <p><code>SPECIFIC_ATTRIBUTES</code> - Returns only the attributes listed in <code>ProjectionExpression</code>. This return value is equivalent to specifying <code>ProjectionExpression</code> without specifying any value for <code>Select</code>.</p>
164    /// <p>If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.</p>
165    /// <p>If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.</p></li>
166    /// </ul>
167    /// <p>If neither <code>Select</code> nor <code>ProjectionExpression</code> are specified, DynamoDB defaults to <code>ALL_ATTRIBUTES</code> when accessing a table, and <code>ALL_PROJECTED_ATTRIBUTES</code> when accessing an index. You cannot use both <code>Select</code> and <code>ProjectionExpression</code> together in a single request, unless the value for <code>Select</code> is <code>SPECIFIC_ATTRIBUTES</code>. (This usage is equivalent to specifying <code>ProjectionExpression</code> without any value for <code>Select</code>.)</p><note>
168    /// <p>If you use the <code>ProjectionExpression</code> parameter, then the value for <code>Select</code> can only be <code>SPECIFIC_ATTRIBUTES</code>. Any other value for <code>Select</code> will return an error.</p>
169    /// </note>
170    pub fn select(&self) -> ::std::option::Option<&crate::types::Select> {
171        self.select.as_ref()
172    }
173    /// <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>
174    ///
175    /// 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()`.
176    pub fn attributes_to_get(&self) -> &[::std::string::String] {
177        self.attributes_to_get.as_deref().unwrap_or_default()
178    }
179    /// <p>The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation to continue the operation. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html">Query and Scan</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
180    pub fn limit(&self) -> ::std::option::Option<i32> {
181        self.limit
182    }
183    /// <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>
184    /// <p>Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with <code>ConsistentRead</code> set to <code>true</code>, you will receive a <code>ValidationException</code>.</p>
185    pub fn consistent_read(&self) -> ::std::option::Option<bool> {
186        self.consistent_read
187    }
188    /// <p>This is a legacy parameter. Use <code>KeyConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html">KeyConditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
189    pub fn key_conditions(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::Condition>> {
190        self.key_conditions.as_ref()
191    }
192    /// <p>This is a legacy parameter. Use <code>FilterExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html">QueryFilter</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
193    pub fn query_filter(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::Condition>> {
194        self.query_filter.as_ref()
195    }
196    /// <p>This is a legacy parameter. Use <code>FilterExpression</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>
197    pub fn conditional_operator(&self) -> ::std::option::Option<&crate::types::ConditionalOperator> {
198        self.conditional_operator.as_ref()
199    }
200    /// <p>Specifies the order for index traversal: If <code>true</code> (default), the traversal is performed in ascending order; if <code>false</code>, the traversal is performed in descending order.</p>
201    /// <p>Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.</p>
202    /// <p>If <code>ScanIndexForward</code> is <code>true</code>, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If <code>ScanIndexForward</code> is <code>false</code>, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.</p>
203    pub fn scan_index_forward(&self) -> ::std::option::Option<bool> {
204        self.scan_index_forward
205    }
206    /// <p>The primary key of the first item that this operation will evaluate. Use the value that was returned for <code>LastEvaluatedKey</code> in the previous operation.</p>
207    /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
208    pub fn exclusive_start_key(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
209        self.exclusive_start_key.as_ref()
210    }
211    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
212    /// <ul>
213    /// <li>
214    /// <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>
215    /// <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>
216    /// <li>
217    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
218    /// <li>
219    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
220    /// </ul>
221    pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
222        self.return_consumed_capacity.as_ref()
223    }
224    /// <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>
225    /// <p>If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.</p>
226    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html">Accessing Item Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
227    pub fn projection_expression(&self) -> ::std::option::Option<&str> {
228        self.projection_expression.as_deref()
229    }
230    /// <p>A string that contains conditions that DynamoDB applies after the <code>Query</code> operation, but before the data is returned to you. Items that do not satisfy the <code>FilterExpression</code> criteria are not returned.</p>
231    /// <p>A <code>FilterExpression</code> does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.</p><note>
232    /// <p>A <code>FilterExpression</code> is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.</p>
233    /// </note>
234    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.FilterExpression.html">Filter Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
235    pub fn filter_expression(&self) -> ::std::option::Option<&str> {
236        self.filter_expression.as_deref()
237    }
238    /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
239    /// <p>The condition must perform an equality test on a single partition key value.</p>
240    /// <p>The condition can optionally perform one of several comparison tests on a single sort key value. This allows <code>Query</code> to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.</p>
241    /// <p>The partition key equality test is required, and must be specified in the following format:</p>
242    /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
243    /// <p>If you also want to provide a condition for the sort key, it must be combined using <code>AND</code> with the condition for the sort key. Following is an example, using the <b>=</b> comparison operator for the sort key:</p>
244    /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
245    /// <p>Valid comparisons for the sort key condition are as follows:</p>
246    /// <ul>
247    /// <li>
248    /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
249    /// <li>
250    /// <p><code>sortKeyName</code> <code>&lt;</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
251    /// <li>
252    /// <p><code>sortKeyName</code> <code>&lt;=</code> <code>:sortkeyval</code> - true if the sort key value is less than or equal to <code>:sortkeyval</code>.</p></li>
253    /// <li>
254    /// <p><code>sortKeyName</code> <code>&gt;</code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
255    /// <li>
256    /// <p><code>sortKeyName</code> <code>&gt;= </code> <code>:sortkeyval</code> - true if the sort key value is greater than or equal to <code>:sortkeyval</code>.</p></li>
257    /// <li>
258    /// <p><code>sortKeyName</code> <code>BETWEEN</code> <code>:sortkeyval1</code> <code>AND</code> <code>:sortkeyval2</code> - true if the sort key value is greater than or equal to <code>:sortkeyval1</code>, and less than or equal to <code>:sortkeyval2</code>.</p></li>
259    /// <li>
260    /// <p><code>begins_with (</code> <code>sortKeyName</code>, <code>:sortkeyval</code> <code>)</code> - true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function name <code>begins_with</code> is case-sensitive.</p></li>
261    /// </ul>
262    /// <p>Use the <code>ExpressionAttributeValues</code> parameter to replace tokens such as <code>:partitionval</code> and <code>:sortval</code> with actual values at runtime.</p>
263    /// <p>You can optionally use the <code>ExpressionAttributeNames</code> parameter to replace the names of the partition key and sort key with placeholder tokens. This option might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following <code>KeyConditionExpression</code> parameter causes an error because <i>Size</i> is a reserved word:</p>
264    /// <ul>
265    /// <li>
266    /// <p><code>Size = :myval</code></p></li>
267    /// </ul>
268    /// <p>To work around this, define a placeholder (such a <code>#S</code>) to represent the attribute name <i>Size</i>. <code>KeyConditionExpression</code> then is as follows:</p>
269    /// <ul>
270    /// <li>
271    /// <p><code>#S = :myval</code></p></li>
272    /// </ul>
273    /// <p>For a 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>.</p>
274    /// <p>For more information on <code>ExpressionAttributeNames</code> and <code>ExpressionAttributeValues</code>, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html">Using Placeholders for Attribute Names and Values</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
275    pub fn key_condition_expression(&self) -> ::std::option::Option<&str> {
276        self.key_condition_expression.as_deref()
277    }
278    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
279    /// <ul>
280    /// <li>
281    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
282    /// <li>
283    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
284    /// <li>
285    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
286    /// </ul>
287    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
288    /// <ul>
289    /// <li>
290    /// <p><code>Percentile</code></p></li>
291    /// </ul>
292    /// <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>
293    /// <ul>
294    /// <li>
295    /// <p><code>{"#P":"Percentile"}</code></p></li>
296    /// </ul>
297    /// <p>You could then use this substitution in an expression, as in this example:</p>
298    /// <ul>
299    /// <li>
300    /// <p><code>#P = :val</code></p></li>
301    /// </ul><note>
302    /// <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>
303    /// </note>
304    /// <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>
305    pub fn expression_attribute_names(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
306        self.expression_attribute_names.as_ref()
307    }
308    /// <p>One or more values that can be substituted in an expression.</p>
309    /// <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>
310    /// <p><code>Available | Backordered | Discontinued</code></p>
311    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
312    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
313    /// <p>You could then use these values in an expression, such as this:</p>
314    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
315    /// <p>For more information on expression attribute values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Specifying Conditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
316    pub fn expression_attribute_values(
317        &self,
318    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
319        self.expression_attribute_values.as_ref()
320    }
321}
322impl QueryInput {
323    /// Creates a new builder-style object to manufacture [`QueryInput`](crate::operation::query::QueryInput).
324    pub fn builder() -> crate::operation::query::builders::QueryInputBuilder {
325        crate::operation::query::builders::QueryInputBuilder::default()
326    }
327}
328
329/// A builder for [`QueryInput`](crate::operation::query::QueryInput).
330#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
331#[non_exhaustive]
332pub struct QueryInputBuilder {
333    pub(crate) table_name: ::std::option::Option<::std::string::String>,
334    pub(crate) index_name: ::std::option::Option<::std::string::String>,
335    pub(crate) select: ::std::option::Option<crate::types::Select>,
336    pub(crate) attributes_to_get: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
337    pub(crate) limit: ::std::option::Option<i32>,
338    pub(crate) consistent_read: ::std::option::Option<bool>,
339    pub(crate) key_conditions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Condition>>,
340    pub(crate) query_filter: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Condition>>,
341    pub(crate) conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
342    pub(crate) scan_index_forward: ::std::option::Option<bool>,
343    pub(crate) exclusive_start_key: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
344    pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
345    pub(crate) projection_expression: ::std::option::Option<::std::string::String>,
346    pub(crate) filter_expression: ::std::option::Option<::std::string::String>,
347    pub(crate) key_condition_expression: ::std::option::Option<::std::string::String>,
348    pub(crate) expression_attribute_names: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
349    pub(crate) expression_attribute_values: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
350}
351impl QueryInputBuilder {
352    /// <p>The name of the table containing the requested items. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
353    /// This field is required.
354    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
355        self.table_name = ::std::option::Option::Some(input.into());
356        self
357    }
358    /// <p>The name of the table containing the requested items. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
359    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
360        self.table_name = input;
361        self
362    }
363    /// <p>The name of the table containing the requested items. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
364    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
365        &self.table_name
366    }
367    /// <p>The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the <code>IndexName</code> parameter, you must also provide <code>TableName.</code></p>
368    pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
369        self.index_name = ::std::option::Option::Some(input.into());
370        self
371    }
372    /// <p>The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the <code>IndexName</code> parameter, you must also provide <code>TableName.</code></p>
373    pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
374        self.index_name = input;
375        self
376    }
377    /// <p>The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the <code>IndexName</code> parameter, you must also provide <code>TableName.</code></p>
378    pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
379        &self.index_name
380    }
381    /// <p>The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.</p>
382    /// <ul>
383    /// <li>
384    /// <p><code>ALL_ATTRIBUTES</code> - Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required.</p></li>
385    /// <li>
386    /// <p><code>ALL_PROJECTED_ATTRIBUTES</code> - Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifying <code>ALL_ATTRIBUTES</code>.</p></li>
387    /// <li>
388    /// <p><code>COUNT</code> - Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations.</p></li>
389    /// <li>
390    /// <p><code>SPECIFIC_ATTRIBUTES</code> - Returns only the attributes listed in <code>ProjectionExpression</code>. This return value is equivalent to specifying <code>ProjectionExpression</code> without specifying any value for <code>Select</code>.</p>
391    /// <p>If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.</p>
392    /// <p>If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.</p></li>
393    /// </ul>
394    /// <p>If neither <code>Select</code> nor <code>ProjectionExpression</code> are specified, DynamoDB defaults to <code>ALL_ATTRIBUTES</code> when accessing a table, and <code>ALL_PROJECTED_ATTRIBUTES</code> when accessing an index. You cannot use both <code>Select</code> and <code>ProjectionExpression</code> together in a single request, unless the value for <code>Select</code> is <code>SPECIFIC_ATTRIBUTES</code>. (This usage is equivalent to specifying <code>ProjectionExpression</code> without any value for <code>Select</code>.)</p><note>
395    /// <p>If you use the <code>ProjectionExpression</code> parameter, then the value for <code>Select</code> can only be <code>SPECIFIC_ATTRIBUTES</code>. Any other value for <code>Select</code> will return an error.</p>
396    /// </note>
397    pub fn select(mut self, input: crate::types::Select) -> Self {
398        self.select = ::std::option::Option::Some(input);
399        self
400    }
401    /// <p>The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.</p>
402    /// <ul>
403    /// <li>
404    /// <p><code>ALL_ATTRIBUTES</code> - Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required.</p></li>
405    /// <li>
406    /// <p><code>ALL_PROJECTED_ATTRIBUTES</code> - Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifying <code>ALL_ATTRIBUTES</code>.</p></li>
407    /// <li>
408    /// <p><code>COUNT</code> - Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations.</p></li>
409    /// <li>
410    /// <p><code>SPECIFIC_ATTRIBUTES</code> - Returns only the attributes listed in <code>ProjectionExpression</code>. This return value is equivalent to specifying <code>ProjectionExpression</code> without specifying any value for <code>Select</code>.</p>
411    /// <p>If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.</p>
412    /// <p>If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.</p></li>
413    /// </ul>
414    /// <p>If neither <code>Select</code> nor <code>ProjectionExpression</code> are specified, DynamoDB defaults to <code>ALL_ATTRIBUTES</code> when accessing a table, and <code>ALL_PROJECTED_ATTRIBUTES</code> when accessing an index. You cannot use both <code>Select</code> and <code>ProjectionExpression</code> together in a single request, unless the value for <code>Select</code> is <code>SPECIFIC_ATTRIBUTES</code>. (This usage is equivalent to specifying <code>ProjectionExpression</code> without any value for <code>Select</code>.)</p><note>
415    /// <p>If you use the <code>ProjectionExpression</code> parameter, then the value for <code>Select</code> can only be <code>SPECIFIC_ATTRIBUTES</code>. Any other value for <code>Select</code> will return an error.</p>
416    /// </note>
417    pub fn set_select(mut self, input: ::std::option::Option<crate::types::Select>) -> Self {
418        self.select = input;
419        self
420    }
421    /// <p>The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index.</p>
422    /// <ul>
423    /// <li>
424    /// <p><code>ALL_ATTRIBUTES</code> - Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required.</p></li>
425    /// <li>
426    /// <p><code>ALL_PROJECTED_ATTRIBUTES</code> - Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifying <code>ALL_ATTRIBUTES</code>.</p></li>
427    /// <li>
428    /// <p><code>COUNT</code> - Returns the number of matching items, rather than the matching items themselves. Note that this uses the same quantity of read capacity units as getting the items, and is subject to the same item size calculations.</p></li>
429    /// <li>
430    /// <p><code>SPECIFIC_ATTRIBUTES</code> - Returns only the attributes listed in <code>ProjectionExpression</code>. This return value is equivalent to specifying <code>ProjectionExpression</code> without specifying any value for <code>Select</code>.</p>
431    /// <p>If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB fetches each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency.</p>
432    /// <p>If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table.</p></li>
433    /// </ul>
434    /// <p>If neither <code>Select</code> nor <code>ProjectionExpression</code> are specified, DynamoDB defaults to <code>ALL_ATTRIBUTES</code> when accessing a table, and <code>ALL_PROJECTED_ATTRIBUTES</code> when accessing an index. You cannot use both <code>Select</code> and <code>ProjectionExpression</code> together in a single request, unless the value for <code>Select</code> is <code>SPECIFIC_ATTRIBUTES</code>. (This usage is equivalent to specifying <code>ProjectionExpression</code> without any value for <code>Select</code>.)</p><note>
435    /// <p>If you use the <code>ProjectionExpression</code> parameter, then the value for <code>Select</code> can only be <code>SPECIFIC_ATTRIBUTES</code>. Any other value for <code>Select</code> will return an error.</p>
436    /// </note>
437    pub fn get_select(&self) -> &::std::option::Option<crate::types::Select> {
438        &self.select
439    }
440    /// Appends an item to `attributes_to_get`.
441    ///
442    /// To override the contents of this collection use [`set_attributes_to_get`](Self::set_attributes_to_get).
443    ///
444    /// <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>
445    pub fn attributes_to_get(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
446        let mut v = self.attributes_to_get.unwrap_or_default();
447        v.push(input.into());
448        self.attributes_to_get = ::std::option::Option::Some(v);
449        self
450    }
451    /// <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>
452    pub fn set_attributes_to_get(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
453        self.attributes_to_get = input;
454        self
455    }
456    /// <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>
457    pub fn get_attributes_to_get(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
458        &self.attributes_to_get
459    }
460    /// <p>The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation to continue the operation. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html">Query and Scan</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
461    pub fn limit(mut self, input: i32) -> Self {
462        self.limit = ::std::option::Option::Some(input);
463        self
464    }
465    /// <p>The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation to continue the operation. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html">Query and Scan</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
466    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
467        self.limit = input;
468        self
469    }
470    /// <p>The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation to continue the operation. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html">Query and Scan</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
471    pub fn get_limit(&self) -> &::std::option::Option<i32> {
472        &self.limit
473    }
474    /// <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>
475    /// <p>Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with <code>ConsistentRead</code> set to <code>true</code>, you will receive a <code>ValidationException</code>.</p>
476    pub fn consistent_read(mut self, input: bool) -> Self {
477        self.consistent_read = ::std::option::Option::Some(input);
478        self
479    }
480    /// <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>
481    /// <p>Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with <code>ConsistentRead</code> set to <code>true</code>, you will receive a <code>ValidationException</code>.</p>
482    pub fn set_consistent_read(mut self, input: ::std::option::Option<bool>) -> Self {
483        self.consistent_read = input;
484        self
485    }
486    /// <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>
487    /// <p>Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with <code>ConsistentRead</code> set to <code>true</code>, you will receive a <code>ValidationException</code>.</p>
488    pub fn get_consistent_read(&self) -> &::std::option::Option<bool> {
489        &self.consistent_read
490    }
491    /// Adds a key-value pair to `key_conditions`.
492    ///
493    /// To override the contents of this collection use [`set_key_conditions`](Self::set_key_conditions).
494    ///
495    /// <p>This is a legacy parameter. Use <code>KeyConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html">KeyConditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
496    pub fn key_conditions(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Condition) -> Self {
497        let mut hash_map = self.key_conditions.unwrap_or_default();
498        hash_map.insert(k.into(), v);
499        self.key_conditions = ::std::option::Option::Some(hash_map);
500        self
501    }
502    /// <p>This is a legacy parameter. Use <code>KeyConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html">KeyConditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
503    pub fn set_key_conditions(
504        mut self,
505        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Condition>>,
506    ) -> Self {
507        self.key_conditions = input;
508        self
509    }
510    /// <p>This is a legacy parameter. Use <code>KeyConditionExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html">KeyConditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
511    pub fn get_key_conditions(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Condition>> {
512        &self.key_conditions
513    }
514    /// Adds a key-value pair to `query_filter`.
515    ///
516    /// To override the contents of this collection use [`set_query_filter`](Self::set_query_filter).
517    ///
518    /// <p>This is a legacy parameter. Use <code>FilterExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html">QueryFilter</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
519    pub fn query_filter(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Condition) -> Self {
520        let mut hash_map = self.query_filter.unwrap_or_default();
521        hash_map.insert(k.into(), v);
522        self.query_filter = ::std::option::Option::Some(hash_map);
523        self
524    }
525    /// <p>This is a legacy parameter. Use <code>FilterExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html">QueryFilter</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
526    pub fn set_query_filter(
527        mut self,
528        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Condition>>,
529    ) -> Self {
530        self.query_filter = input;
531        self
532    }
533    /// <p>This is a legacy parameter. Use <code>FilterExpression</code> instead. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html">QueryFilter</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
534    pub fn get_query_filter(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::Condition>> {
535        &self.query_filter
536    }
537    /// <p>This is a legacy parameter. Use <code>FilterExpression</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>
538    pub fn conditional_operator(mut self, input: crate::types::ConditionalOperator) -> Self {
539        self.conditional_operator = ::std::option::Option::Some(input);
540        self
541    }
542    /// <p>This is a legacy parameter. Use <code>FilterExpression</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>
543    pub fn set_conditional_operator(mut self, input: ::std::option::Option<crate::types::ConditionalOperator>) -> Self {
544        self.conditional_operator = input;
545        self
546    }
547    /// <p>This is a legacy parameter. Use <code>FilterExpression</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>
548    pub fn get_conditional_operator(&self) -> &::std::option::Option<crate::types::ConditionalOperator> {
549        &self.conditional_operator
550    }
551    /// <p>Specifies the order for index traversal: If <code>true</code> (default), the traversal is performed in ascending order; if <code>false</code>, the traversal is performed in descending order.</p>
552    /// <p>Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.</p>
553    /// <p>If <code>ScanIndexForward</code> is <code>true</code>, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If <code>ScanIndexForward</code> is <code>false</code>, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.</p>
554    pub fn scan_index_forward(mut self, input: bool) -> Self {
555        self.scan_index_forward = ::std::option::Option::Some(input);
556        self
557    }
558    /// <p>Specifies the order for index traversal: If <code>true</code> (default), the traversal is performed in ascending order; if <code>false</code>, the traversal is performed in descending order.</p>
559    /// <p>Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.</p>
560    /// <p>If <code>ScanIndexForward</code> is <code>true</code>, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If <code>ScanIndexForward</code> is <code>false</code>, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.</p>
561    pub fn set_scan_index_forward(mut self, input: ::std::option::Option<bool>) -> Self {
562        self.scan_index_forward = input;
563        self
564    }
565    /// <p>Specifies the order for index traversal: If <code>true</code> (default), the traversal is performed in ascending order; if <code>false</code>, the traversal is performed in descending order.</p>
566    /// <p>Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.</p>
567    /// <p>If <code>ScanIndexForward</code> is <code>true</code>, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If <code>ScanIndexForward</code> is <code>false</code>, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.</p>
568    pub fn get_scan_index_forward(&self) -> &::std::option::Option<bool> {
569        &self.scan_index_forward
570    }
571    /// Adds a key-value pair to `exclusive_start_key`.
572    ///
573    /// To override the contents of this collection use [`set_exclusive_start_key`](Self::set_exclusive_start_key).
574    ///
575    /// <p>The primary key of the first item that this operation will evaluate. Use the value that was returned for <code>LastEvaluatedKey</code> in the previous operation.</p>
576    /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
577    pub fn exclusive_start_key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
578        let mut hash_map = self.exclusive_start_key.unwrap_or_default();
579        hash_map.insert(k.into(), v);
580        self.exclusive_start_key = ::std::option::Option::Some(hash_map);
581        self
582    }
583    /// <p>The primary key of the first item that this operation will evaluate. Use the value that was returned for <code>LastEvaluatedKey</code> in the previous operation.</p>
584    /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
585    pub fn set_exclusive_start_key(
586        mut self,
587        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
588    ) -> Self {
589        self.exclusive_start_key = input;
590        self
591    }
592    /// <p>The primary key of the first item that this operation will evaluate. Use the value that was returned for <code>LastEvaluatedKey</code> in the previous operation.</p>
593    /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
594    pub fn get_exclusive_start_key(
595        &self,
596    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
597        &self.exclusive_start_key
598    }
599    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
600    /// <ul>
601    /// <li>
602    /// <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>
603    /// <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>
604    /// <li>
605    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
606    /// <li>
607    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
608    /// </ul>
609    pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
610        self.return_consumed_capacity = ::std::option::Option::Some(input);
611        self
612    }
613    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
614    /// <ul>
615    /// <li>
616    /// <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>
617    /// <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>
618    /// <li>
619    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
620    /// <li>
621    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
622    /// </ul>
623    pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
624        self.return_consumed_capacity = input;
625        self
626    }
627    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
628    /// <ul>
629    /// <li>
630    /// <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>
631    /// <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>
632    /// <li>
633    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
634    /// <li>
635    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
636    /// </ul>
637    pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
638        &self.return_consumed_capacity
639    }
640    /// <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>
641    /// <p>If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.</p>
642    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html">Accessing Item Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
643    pub fn projection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
644        self.projection_expression = ::std::option::Option::Some(input.into());
645        self
646    }
647    /// <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>
648    /// <p>If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.</p>
649    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html">Accessing Item Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
650    pub fn set_projection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
651        self.projection_expression = input;
652        self
653    }
654    /// <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>
655    /// <p>If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.</p>
656    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html">Accessing Item Attributes</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
657    pub fn get_projection_expression(&self) -> &::std::option::Option<::std::string::String> {
658        &self.projection_expression
659    }
660    /// <p>A string that contains conditions that DynamoDB applies after the <code>Query</code> operation, but before the data is returned to you. Items that do not satisfy the <code>FilterExpression</code> criteria are not returned.</p>
661    /// <p>A <code>FilterExpression</code> does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.</p><note>
662    /// <p>A <code>FilterExpression</code> is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.</p>
663    /// </note>
664    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.FilterExpression.html">Filter Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
665    pub fn filter_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
666        self.filter_expression = ::std::option::Option::Some(input.into());
667        self
668    }
669    /// <p>A string that contains conditions that DynamoDB applies after the <code>Query</code> operation, but before the data is returned to you. Items that do not satisfy the <code>FilterExpression</code> criteria are not returned.</p>
670    /// <p>A <code>FilterExpression</code> does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.</p><note>
671    /// <p>A <code>FilterExpression</code> is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.</p>
672    /// </note>
673    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.FilterExpression.html">Filter Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
674    pub fn set_filter_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
675        self.filter_expression = input;
676        self
677    }
678    /// <p>A string that contains conditions that DynamoDB applies after the <code>Query</code> operation, but before the data is returned to you. Items that do not satisfy the <code>FilterExpression</code> criteria are not returned.</p>
679    /// <p>A <code>FilterExpression</code> does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.</p><note>
680    /// <p>A <code>FilterExpression</code> is applied after the items have already been read; the process of filtering does not consume any additional read capacity units.</p>
681    /// </note>
682    /// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.FilterExpression.html">Filter Expressions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
683    pub fn get_filter_expression(&self) -> &::std::option::Option<::std::string::String> {
684        &self.filter_expression
685    }
686    /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
687    /// <p>The condition must perform an equality test on a single partition key value.</p>
688    /// <p>The condition can optionally perform one of several comparison tests on a single sort key value. This allows <code>Query</code> to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.</p>
689    /// <p>The partition key equality test is required, and must be specified in the following format:</p>
690    /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
691    /// <p>If you also want to provide a condition for the sort key, it must be combined using <code>AND</code> with the condition for the sort key. Following is an example, using the <b>=</b> comparison operator for the sort key:</p>
692    /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
693    /// <p>Valid comparisons for the sort key condition are as follows:</p>
694    /// <ul>
695    /// <li>
696    /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
697    /// <li>
698    /// <p><code>sortKeyName</code> <code>&lt;</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
699    /// <li>
700    /// <p><code>sortKeyName</code> <code>&lt;=</code> <code>:sortkeyval</code> - true if the sort key value is less than or equal to <code>:sortkeyval</code>.</p></li>
701    /// <li>
702    /// <p><code>sortKeyName</code> <code>&gt;</code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
703    /// <li>
704    /// <p><code>sortKeyName</code> <code>&gt;= </code> <code>:sortkeyval</code> - true if the sort key value is greater than or equal to <code>:sortkeyval</code>.</p></li>
705    /// <li>
706    /// <p><code>sortKeyName</code> <code>BETWEEN</code> <code>:sortkeyval1</code> <code>AND</code> <code>:sortkeyval2</code> - true if the sort key value is greater than or equal to <code>:sortkeyval1</code>, and less than or equal to <code>:sortkeyval2</code>.</p></li>
707    /// <li>
708    /// <p><code>begins_with (</code> <code>sortKeyName</code>, <code>:sortkeyval</code> <code>)</code> - true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function name <code>begins_with</code> is case-sensitive.</p></li>
709    /// </ul>
710    /// <p>Use the <code>ExpressionAttributeValues</code> parameter to replace tokens such as <code>:partitionval</code> and <code>:sortval</code> with actual values at runtime.</p>
711    /// <p>You can optionally use the <code>ExpressionAttributeNames</code> parameter to replace the names of the partition key and sort key with placeholder tokens. This option might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following <code>KeyConditionExpression</code> parameter causes an error because <i>Size</i> is a reserved word:</p>
712    /// <ul>
713    /// <li>
714    /// <p><code>Size = :myval</code></p></li>
715    /// </ul>
716    /// <p>To work around this, define a placeholder (such a <code>#S</code>) to represent the attribute name <i>Size</i>. <code>KeyConditionExpression</code> then is as follows:</p>
717    /// <ul>
718    /// <li>
719    /// <p><code>#S = :myval</code></p></li>
720    /// </ul>
721    /// <p>For a 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>.</p>
722    /// <p>For more information on <code>ExpressionAttributeNames</code> and <code>ExpressionAttributeValues</code>, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html">Using Placeholders for Attribute Names and Values</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
723    pub fn key_condition_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
724        self.key_condition_expression = ::std::option::Option::Some(input.into());
725        self
726    }
727    /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
728    /// <p>The condition must perform an equality test on a single partition key value.</p>
729    /// <p>The condition can optionally perform one of several comparison tests on a single sort key value. This allows <code>Query</code> to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.</p>
730    /// <p>The partition key equality test is required, and must be specified in the following format:</p>
731    /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
732    /// <p>If you also want to provide a condition for the sort key, it must be combined using <code>AND</code> with the condition for the sort key. Following is an example, using the <b>=</b> comparison operator for the sort key:</p>
733    /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
734    /// <p>Valid comparisons for the sort key condition are as follows:</p>
735    /// <ul>
736    /// <li>
737    /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
738    /// <li>
739    /// <p><code>sortKeyName</code> <code>&lt;</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
740    /// <li>
741    /// <p><code>sortKeyName</code> <code>&lt;=</code> <code>:sortkeyval</code> - true if the sort key value is less than or equal to <code>:sortkeyval</code>.</p></li>
742    /// <li>
743    /// <p><code>sortKeyName</code> <code>&gt;</code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
744    /// <li>
745    /// <p><code>sortKeyName</code> <code>&gt;= </code> <code>:sortkeyval</code> - true if the sort key value is greater than or equal to <code>:sortkeyval</code>.</p></li>
746    /// <li>
747    /// <p><code>sortKeyName</code> <code>BETWEEN</code> <code>:sortkeyval1</code> <code>AND</code> <code>:sortkeyval2</code> - true if the sort key value is greater than or equal to <code>:sortkeyval1</code>, and less than or equal to <code>:sortkeyval2</code>.</p></li>
748    /// <li>
749    /// <p><code>begins_with (</code> <code>sortKeyName</code>, <code>:sortkeyval</code> <code>)</code> - true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function name <code>begins_with</code> is case-sensitive.</p></li>
750    /// </ul>
751    /// <p>Use the <code>ExpressionAttributeValues</code> parameter to replace tokens such as <code>:partitionval</code> and <code>:sortval</code> with actual values at runtime.</p>
752    /// <p>You can optionally use the <code>ExpressionAttributeNames</code> parameter to replace the names of the partition key and sort key with placeholder tokens. This option might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following <code>KeyConditionExpression</code> parameter causes an error because <i>Size</i> is a reserved word:</p>
753    /// <ul>
754    /// <li>
755    /// <p><code>Size = :myval</code></p></li>
756    /// </ul>
757    /// <p>To work around this, define a placeholder (such a <code>#S</code>) to represent the attribute name <i>Size</i>. <code>KeyConditionExpression</code> then is as follows:</p>
758    /// <ul>
759    /// <li>
760    /// <p><code>#S = :myval</code></p></li>
761    /// </ul>
762    /// <p>For a 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>.</p>
763    /// <p>For more information on <code>ExpressionAttributeNames</code> and <code>ExpressionAttributeValues</code>, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html">Using Placeholders for Attribute Names and Values</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
764    pub fn set_key_condition_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
765        self.key_condition_expression = input;
766        self
767    }
768    /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
769    /// <p>The condition must perform an equality test on a single partition key value.</p>
770    /// <p>The condition can optionally perform one of several comparison tests on a single sort key value. This allows <code>Query</code> to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values.</p>
771    /// <p>The partition key equality test is required, and must be specified in the following format:</p>
772    /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
773    /// <p>If you also want to provide a condition for the sort key, it must be combined using <code>AND</code> with the condition for the sort key. Following is an example, using the <b>=</b> comparison operator for the sort key:</p>
774    /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
775    /// <p>Valid comparisons for the sort key condition are as follows:</p>
776    /// <ul>
777    /// <li>
778    /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
779    /// <li>
780    /// <p><code>sortKeyName</code> <code>&lt;</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
781    /// <li>
782    /// <p><code>sortKeyName</code> <code>&lt;=</code> <code>:sortkeyval</code> - true if the sort key value is less than or equal to <code>:sortkeyval</code>.</p></li>
783    /// <li>
784    /// <p><code>sortKeyName</code> <code>&gt;</code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
785    /// <li>
786    /// <p><code>sortKeyName</code> <code>&gt;= </code> <code>:sortkeyval</code> - true if the sort key value is greater than or equal to <code>:sortkeyval</code>.</p></li>
787    /// <li>
788    /// <p><code>sortKeyName</code> <code>BETWEEN</code> <code>:sortkeyval1</code> <code>AND</code> <code>:sortkeyval2</code> - true if the sort key value is greater than or equal to <code>:sortkeyval1</code>, and less than or equal to <code>:sortkeyval2</code>.</p></li>
789    /// <li>
790    /// <p><code>begins_with (</code> <code>sortKeyName</code>, <code>:sortkeyval</code> <code>)</code> - true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function name <code>begins_with</code> is case-sensitive.</p></li>
791    /// </ul>
792    /// <p>Use the <code>ExpressionAttributeValues</code> parameter to replace tokens such as <code>:partitionval</code> and <code>:sortval</code> with actual values at runtime.</p>
793    /// <p>You can optionally use the <code>ExpressionAttributeNames</code> parameter to replace the names of the partition key and sort key with placeholder tokens. This option might be necessary if an attribute name conflicts with a DynamoDB reserved word. For example, the following <code>KeyConditionExpression</code> parameter causes an error because <i>Size</i> is a reserved word:</p>
794    /// <ul>
795    /// <li>
796    /// <p><code>Size = :myval</code></p></li>
797    /// </ul>
798    /// <p>To work around this, define a placeholder (such a <code>#S</code>) to represent the attribute name <i>Size</i>. <code>KeyConditionExpression</code> then is as follows:</p>
799    /// <ul>
800    /// <li>
801    /// <p><code>#S = :myval</code></p></li>
802    /// </ul>
803    /// <p>For a 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>.</p>
804    /// <p>For more information on <code>ExpressionAttributeNames</code> and <code>ExpressionAttributeValues</code>, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html">Using Placeholders for Attribute Names and Values</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
805    pub fn get_key_condition_expression(&self) -> &::std::option::Option<::std::string::String> {
806        &self.key_condition_expression
807    }
808    /// Adds a key-value pair to `expression_attribute_names`.
809    ///
810    /// To override the contents of this collection use [`set_expression_attribute_names`](Self::set_expression_attribute_names).
811    ///
812    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
813    /// <ul>
814    /// <li>
815    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
816    /// <li>
817    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
818    /// <li>
819    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
820    /// </ul>
821    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
822    /// <ul>
823    /// <li>
824    /// <p><code>Percentile</code></p></li>
825    /// </ul>
826    /// <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>
827    /// <ul>
828    /// <li>
829    /// <p><code>{"#P":"Percentile"}</code></p></li>
830    /// </ul>
831    /// <p>You could then use this substitution in an expression, as in this example:</p>
832    /// <ul>
833    /// <li>
834    /// <p><code>#P = :val</code></p></li>
835    /// </ul><note>
836    /// <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>
837    /// </note>
838    /// <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>
839    pub fn expression_attribute_names(
840        mut self,
841        k: impl ::std::convert::Into<::std::string::String>,
842        v: impl ::std::convert::Into<::std::string::String>,
843    ) -> Self {
844        let mut hash_map = self.expression_attribute_names.unwrap_or_default();
845        hash_map.insert(k.into(), v.into());
846        self.expression_attribute_names = ::std::option::Option::Some(hash_map);
847        self
848    }
849    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
850    /// <ul>
851    /// <li>
852    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
853    /// <li>
854    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
855    /// <li>
856    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
857    /// </ul>
858    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
859    /// <ul>
860    /// <li>
861    /// <p><code>Percentile</code></p></li>
862    /// </ul>
863    /// <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>
864    /// <ul>
865    /// <li>
866    /// <p><code>{"#P":"Percentile"}</code></p></li>
867    /// </ul>
868    /// <p>You could then use this substitution in an expression, as in this example:</p>
869    /// <ul>
870    /// <li>
871    /// <p><code>#P = :val</code></p></li>
872    /// </ul><note>
873    /// <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>
874    /// </note>
875    /// <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>
876    pub fn set_expression_attribute_names(
877        mut self,
878        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
879    ) -> Self {
880        self.expression_attribute_names = input;
881        self
882    }
883    /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
884    /// <ul>
885    /// <li>
886    /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
887    /// <li>
888    /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
889    /// <li>
890    /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
891    /// </ul>
892    /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
893    /// <ul>
894    /// <li>
895    /// <p><code>Percentile</code></p></li>
896    /// </ul>
897    /// <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>
898    /// <ul>
899    /// <li>
900    /// <p><code>{"#P":"Percentile"}</code></p></li>
901    /// </ul>
902    /// <p>You could then use this substitution in an expression, as in this example:</p>
903    /// <ul>
904    /// <li>
905    /// <p><code>#P = :val</code></p></li>
906    /// </ul><note>
907    /// <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>
908    /// </note>
909    /// <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>
910    pub fn get_expression_attribute_names(
911        &self,
912    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
913        &self.expression_attribute_names
914    }
915    /// Adds a key-value pair to `expression_attribute_values`.
916    ///
917    /// To override the contents of this collection use [`set_expression_attribute_values`](Self::set_expression_attribute_values).
918    ///
919    /// <p>One or more values that can be substituted in an expression.</p>
920    /// <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>
921    /// <p><code>Available | Backordered | Discontinued</code></p>
922    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
923    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
924    /// <p>You could then use these values in an expression, such as this:</p>
925    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
926    /// <p>For more information on expression attribute values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Specifying Conditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
927    pub fn expression_attribute_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
928        let mut hash_map = self.expression_attribute_values.unwrap_or_default();
929        hash_map.insert(k.into(), v);
930        self.expression_attribute_values = ::std::option::Option::Some(hash_map);
931        self
932    }
933    /// <p>One or more values that can be substituted in an expression.</p>
934    /// <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>
935    /// <p><code>Available | Backordered | Discontinued</code></p>
936    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
937    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
938    /// <p>You could then use these values in an expression, such as this:</p>
939    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
940    /// <p>For more information on expression attribute values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Specifying Conditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
941    pub fn set_expression_attribute_values(
942        mut self,
943        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
944    ) -> Self {
945        self.expression_attribute_values = input;
946        self
947    }
948    /// <p>One or more values that can be substituted in an expression.</p>
949    /// <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>
950    /// <p><code>Available | Backordered | Discontinued</code></p>
951    /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
952    /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
953    /// <p>You could then use these values in an expression, such as this:</p>
954    /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
955    /// <p>For more information on expression attribute values, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html">Specifying Conditions</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
956    pub fn get_expression_attribute_values(
957        &self,
958    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
959        &self.expression_attribute_values
960    }
961    /// Consumes the builder and constructs a [`QueryInput`](crate::operation::query::QueryInput).
962    pub fn build(self) -> ::std::result::Result<crate::operation::query::QueryInput, ::aws_smithy_types::error::operation::BuildError> {
963        ::std::result::Result::Ok(crate::operation::query::QueryInput {
964            table_name: self.table_name,
965            index_name: self.index_name,
966            select: self.select,
967            attributes_to_get: self.attributes_to_get,
968            limit: self.limit,
969            consistent_read: self.consistent_read,
970            key_conditions: self.key_conditions,
971            query_filter: self.query_filter,
972            conditional_operator: self.conditional_operator,
973            scan_index_forward: self.scan_index_forward,
974            exclusive_start_key: self.exclusive_start_key,
975            return_consumed_capacity: self.return_consumed_capacity,
976            projection_expression: self.projection_expression,
977            filter_expression: self.filter_expression,
978            key_condition_expression: self.key_condition_expression,
979            expression_attribute_names: self.expression_attribute_names,
980            expression_attribute_values: self.expression_attribute_values,
981        })
982    }
983}