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><</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><=</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>></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>>= </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()
178 .unwrap_or_default()
179 }
180 /// <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>
181 pub fn limit(&self) -> ::std::option::Option<i32> {
182 self.limit
183 }
184 /// <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>
185 /// <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>
186 pub fn consistent_read(&self) -> ::std::option::Option<bool> {
187 self.consistent_read
188 }
189 /// <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>
190 pub fn key_conditions(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::Condition>> {
191 self.key_conditions.as_ref()
192 }
193 /// <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>
194 pub fn query_filter(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::Condition>> {
195 self.query_filter.as_ref()
196 }
197 /// <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>
198 pub fn conditional_operator(&self) -> ::std::option::Option<&crate::types::ConditionalOperator> {
199 self.conditional_operator.as_ref()
200 }
201 /// <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>
202 /// <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>
203 /// <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>
204 pub fn scan_index_forward(&self) -> ::std::option::Option<bool> {
205 self.scan_index_forward
206 }
207 /// <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>
208 /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
209 pub fn exclusive_start_key(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
210 self.exclusive_start_key.as_ref()
211 }
212 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
213 /// <ul>
214 /// <li>
215 /// <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>
216 /// <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>
217 /// <li>
218 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
219 /// <li>
220 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
221 /// </ul>
222 pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
223 self.return_consumed_capacity.as_ref()
224 }
225 /// <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>
226 /// <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>
227 /// <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>
228 pub fn projection_expression(&self) -> ::std::option::Option<&str> {
229 self.projection_expression.as_deref()
230 }
231 /// <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>
232 /// <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>
233 /// <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>
234 /// </note>
235 /// <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>
236 pub fn filter_expression(&self) -> ::std::option::Option<&str> {
237 self.filter_expression.as_deref()
238 }
239 /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
240 /// <p>The condition must perform an equality test on a single partition key value.</p>
241 /// <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>
242 /// <p>The partition key equality test is required, and must be specified in the following format:</p>
243 /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
244 /// <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>
245 /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
246 /// <p>Valid comparisons for the sort key condition are as follows:</p>
247 /// <ul>
248 /// <li>
249 /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
250 /// <li>
251 /// <p><code>sortKeyName</code> <code><</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
252 /// <li>
253 /// <p><code>sortKeyName</code> <code><=</code> <code>:sortkeyval</code> - true if the sort key value is less than or equal to <code>:sortkeyval</code>.</p></li>
254 /// <li>
255 /// <p><code>sortKeyName</code> <code>></code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
256 /// <li>
257 /// <p><code>sortKeyName</code> <code>>= </code> <code>:sortkeyval</code> - true if the sort key value is greater than or equal to <code>:sortkeyval</code>.</p></li>
258 /// <li>
259 /// <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>
260 /// <li>
261 /// <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>
262 /// </ul>
263 /// <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>
264 /// <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>
265 /// <ul>
266 /// <li>
267 /// <p><code>Size = :myval</code></p></li>
268 /// </ul>
269 /// <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>
270 /// <ul>
271 /// <li>
272 /// <p><code>#S = :myval</code></p></li>
273 /// </ul>
274 /// <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>
275 /// <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>
276 pub fn key_condition_expression(&self) -> ::std::option::Option<&str> {
277 self.key_condition_expression.as_deref()
278 }
279 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
280 /// <ul>
281 /// <li>
282 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
283 /// <li>
284 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
285 /// <li>
286 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
287 /// </ul>
288 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
289 /// <ul>
290 /// <li>
291 /// <p><code>Percentile</code></p></li>
292 /// </ul>
293 /// <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>
294 /// <ul>
295 /// <li>
296 /// <p><code>{"#P":"Percentile"}</code></p></li>
297 /// </ul>
298 /// <p>You could then use this substitution in an expression, as in this example:</p>
299 /// <ul>
300 /// <li>
301 /// <p><code>#P = :val</code></p></li>
302 /// </ul><note>
303 /// <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>
304 /// </note>
305 /// <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>
306 pub fn expression_attribute_names(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
307 self.expression_attribute_names.as_ref()
308 }
309 /// <p>One or more values that can be substituted in an expression.</p>
310 /// <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>
311 /// <p><code>Available | Backordered | Discontinued</code></p>
312 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
313 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
314 /// <p>You could then use these values in an expression, such as this:</p>
315 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
316 /// <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>
317 pub fn expression_attribute_values(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
318 self.expression_attribute_values.as_ref()
319 }
320}
321impl QueryInput {
322 /// Creates a new builder-style object to manufacture [`QueryInput`](crate::operation::query::QueryInput).
323 pub fn builder() -> crate::operation::query::builders::QueryInputBuilder {
324 crate::operation::query::builders::QueryInputBuilder::default()
325 }
326}
327
328/// A builder for [`QueryInput`](crate::operation::query::QueryInput).
329#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
330#[non_exhaustive]
331pub struct QueryInputBuilder {
332 pub(crate) table_name: ::std::option::Option<::std::string::String>,
333 pub(crate) index_name: ::std::option::Option<::std::string::String>,
334 pub(crate) select: ::std::option::Option<crate::types::Select>,
335 pub(crate) attributes_to_get: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
336 pub(crate) limit: ::std::option::Option<i32>,
337 pub(crate) consistent_read: ::std::option::Option<bool>,
338 pub(crate) key_conditions: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>>,
339 pub(crate) query_filter: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>>,
340 pub(crate) conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
341 pub(crate) scan_index_forward: ::std::option::Option<bool>,
342 pub(crate) exclusive_start_key: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
343 pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
344 pub(crate) projection_expression: ::std::option::Option<::std::string::String>,
345 pub(crate) filter_expression: ::std::option::Option<::std::string::String>,
346 pub(crate) key_condition_expression: ::std::option::Option<::std::string::String>,
347 pub(crate) expression_attribute_names: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>,
348 pub(crate) expression_attribute_values: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
349}
350impl QueryInputBuilder {
351 /// <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>
352 /// This field is required.
353 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
354 self.table_name = ::std::option::Option::Some(input.into());
355 self
356 }
357 /// <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>
358 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
359 self.table_name = input; self
360 }
361 /// <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>
362 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
363 &self.table_name
364 }
365 /// <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>
366 pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
367 self.index_name = ::std::option::Option::Some(input.into());
368 self
369 }
370 /// <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>
371 pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
372 self.index_name = input; self
373 }
374 /// <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>
375 pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
376 &self.index_name
377 }
378 /// <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>
379 /// <ul>
380 /// <li>
381 /// <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>
382 /// <li>
383 /// <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>
384 /// <li>
385 /// <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>
386 /// <li>
387 /// <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>
388 /// <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>
389 /// <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>
390 /// </ul>
391 /// <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>
392 /// <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>
393 /// </note>
394 pub fn select(mut self, input: crate::types::Select) -> Self {
395 self.select = ::std::option::Option::Some(input);
396 self
397 }
398 /// <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>
399 /// <ul>
400 /// <li>
401 /// <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>
402 /// <li>
403 /// <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>
404 /// <li>
405 /// <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>
406 /// <li>
407 /// <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>
408 /// <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>
409 /// <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>
410 /// </ul>
411 /// <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>
412 /// <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>
413 /// </note>
414 pub fn set_select(mut self, input: ::std::option::Option<crate::types::Select>) -> Self {
415 self.select = input; self
416 }
417 /// <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>
418 /// <ul>
419 /// <li>
420 /// <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>
421 /// <li>
422 /// <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>
423 /// <li>
424 /// <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>
425 /// <li>
426 /// <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>
427 /// <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>
428 /// <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>
429 /// </ul>
430 /// <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>
431 /// <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>
432 /// </note>
433 pub fn get_select(&self) -> &::std::option::Option<crate::types::Select> {
434 &self.select
435 }
436 /// Appends an item to `attributes_to_get`.
437 ///
438 /// To override the contents of this collection use [`set_attributes_to_get`](Self::set_attributes_to_get).
439 ///
440 /// <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>
441 pub fn attributes_to_get(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
442 let mut v = self.attributes_to_get.unwrap_or_default();
443 v.push(input.into());
444 self.attributes_to_get = ::std::option::Option::Some(v);
445 self
446 }
447 /// <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>
448 pub fn set_attributes_to_get(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
449 self.attributes_to_get = input; 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 get_attributes_to_get(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
453 &self.attributes_to_get
454 }
455 /// <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>
456 pub fn limit(mut self, input: i32) -> Self {
457 self.limit = ::std::option::Option::Some(input);
458 self
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 set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
462 self.limit = input; self
463 }
464 /// <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>
465 pub fn get_limit(&self) -> &::std::option::Option<i32> {
466 &self.limit
467 }
468 /// <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>
469 /// <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>
470 pub fn consistent_read(mut self, input: bool) -> Self {
471 self.consistent_read = ::std::option::Option::Some(input);
472 self
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 set_consistent_read(mut self, input: ::std::option::Option<bool>) -> Self {
477 self.consistent_read = input; self
478 }
479 /// <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>
480 /// <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>
481 pub fn get_consistent_read(&self) -> &::std::option::Option<bool> {
482 &self.consistent_read
483 }
484 /// Adds a key-value pair to `key_conditions`.
485 ///
486 /// To override the contents of this collection use [`set_key_conditions`](Self::set_key_conditions).
487 ///
488 /// <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>
489 pub fn key_conditions(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Condition) -> Self {
490 let mut hash_map = self.key_conditions.unwrap_or_default();
491 hash_map.insert(k.into(), v);
492 self.key_conditions = ::std::option::Option::Some(hash_map);
493 self
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 set_key_conditions(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>>) -> Self {
497 self.key_conditions = input; self
498 }
499 /// <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>
500 pub fn get_key_conditions(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>> {
501 &self.key_conditions
502 }
503 /// Adds a key-value pair to `query_filter`.
504 ///
505 /// To override the contents of this collection use [`set_query_filter`](Self::set_query_filter).
506 ///
507 /// <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>
508 pub fn query_filter(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Condition) -> Self {
509 let mut hash_map = self.query_filter.unwrap_or_default();
510 hash_map.insert(k.into(), v);
511 self.query_filter = ::std::option::Option::Some(hash_map);
512 self
513 }
514 /// <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>
515 pub fn set_query_filter(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>>) -> Self {
516 self.query_filter = input; self
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 get_query_filter(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>> {
520 &self.query_filter
521 }
522 /// <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>
523 pub fn conditional_operator(mut self, input: crate::types::ConditionalOperator) -> Self {
524 self.conditional_operator = ::std::option::Option::Some(input);
525 self
526 }
527 /// <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>
528 pub fn set_conditional_operator(mut self, input: ::std::option::Option<crate::types::ConditionalOperator>) -> Self {
529 self.conditional_operator = input; self
530 }
531 /// <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>
532 pub fn get_conditional_operator(&self) -> &::std::option::Option<crate::types::ConditionalOperator> {
533 &self.conditional_operator
534 }
535 /// <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>
536 /// <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>
537 /// <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>
538 pub fn scan_index_forward(mut self, input: bool) -> Self {
539 self.scan_index_forward = ::std::option::Option::Some(input);
540 self
541 }
542 /// <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>
543 /// <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>
544 /// <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>
545 pub fn set_scan_index_forward(mut self, input: ::std::option::Option<bool>) -> Self {
546 self.scan_index_forward = input; self
547 }
548 /// <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>
549 /// <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>
550 /// <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>
551 pub fn get_scan_index_forward(&self) -> &::std::option::Option<bool> {
552 &self.scan_index_forward
553 }
554 /// Adds a key-value pair to `exclusive_start_key`.
555 ///
556 /// To override the contents of this collection use [`set_exclusive_start_key`](Self::set_exclusive_start_key).
557 ///
558 /// <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>
559 /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
560 pub fn exclusive_start_key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
561 let mut hash_map = self.exclusive_start_key.unwrap_or_default();
562 hash_map.insert(k.into(), v);
563 self.exclusive_start_key = ::std::option::Option::Some(hash_map);
564 self
565 }
566 /// <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>
567 /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
568 pub fn set_exclusive_start_key(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
569 self.exclusive_start_key = input; self
570 }
571 /// <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>
572 /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
573 pub fn get_exclusive_start_key(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
574 &self.exclusive_start_key
575 }
576 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
577 /// <ul>
578 /// <li>
579 /// <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>
580 /// <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>
581 /// <li>
582 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
583 /// <li>
584 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
585 /// </ul>
586 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
587 self.return_consumed_capacity = ::std::option::Option::Some(input);
588 self
589 }
590 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
591 /// <ul>
592 /// <li>
593 /// <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>
594 /// <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>
595 /// <li>
596 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
597 /// <li>
598 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
599 /// </ul>
600 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
601 self.return_consumed_capacity = input; self
602 }
603 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
604 /// <ul>
605 /// <li>
606 /// <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>
607 /// <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>
608 /// <li>
609 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
610 /// <li>
611 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
612 /// </ul>
613 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
614 &self.return_consumed_capacity
615 }
616 /// <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>
617 /// <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>
618 /// <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>
619 pub fn projection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
620 self.projection_expression = ::std::option::Option::Some(input.into());
621 self
622 }
623 /// <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>
624 /// <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>
625 /// <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>
626 pub fn set_projection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
627 self.projection_expression = input; self
628 }
629 /// <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>
630 /// <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>
631 /// <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>
632 pub fn get_projection_expression(&self) -> &::std::option::Option<::std::string::String> {
633 &self.projection_expression
634 }
635 /// <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>
636 /// <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>
637 /// <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>
638 /// </note>
639 /// <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>
640 pub fn filter_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
641 self.filter_expression = ::std::option::Option::Some(input.into());
642 self
643 }
644 /// <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>
645 /// <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>
646 /// <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>
647 /// </note>
648 /// <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>
649 pub fn set_filter_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
650 self.filter_expression = input; self
651 }
652 /// <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>
653 /// <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>
654 /// <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>
655 /// </note>
656 /// <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>
657 pub fn get_filter_expression(&self) -> &::std::option::Option<::std::string::String> {
658 &self.filter_expression
659 }
660 /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
661 /// <p>The condition must perform an equality test on a single partition key value.</p>
662 /// <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>
663 /// <p>The partition key equality test is required, and must be specified in the following format:</p>
664 /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
665 /// <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>
666 /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
667 /// <p>Valid comparisons for the sort key condition are as follows:</p>
668 /// <ul>
669 /// <li>
670 /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
671 /// <li>
672 /// <p><code>sortKeyName</code> <code><</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
673 /// <li>
674 /// <p><code>sortKeyName</code> <code><=</code> <code>:sortkeyval</code> - true if the sort key value is less than or equal to <code>:sortkeyval</code>.</p></li>
675 /// <li>
676 /// <p><code>sortKeyName</code> <code>></code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
677 /// <li>
678 /// <p><code>sortKeyName</code> <code>>= </code> <code>:sortkeyval</code> - true if the sort key value is greater than or equal to <code>:sortkeyval</code>.</p></li>
679 /// <li>
680 /// <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>
681 /// <li>
682 /// <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>
683 /// </ul>
684 /// <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>
685 /// <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>
686 /// <ul>
687 /// <li>
688 /// <p><code>Size = :myval</code></p></li>
689 /// </ul>
690 /// <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>
691 /// <ul>
692 /// <li>
693 /// <p><code>#S = :myval</code></p></li>
694 /// </ul>
695 /// <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>
696 /// <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>
697 pub fn key_condition_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
698 self.key_condition_expression = ::std::option::Option::Some(input.into());
699 self
700 }
701 /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
702 /// <p>The condition must perform an equality test on a single partition key value.</p>
703 /// <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>
704 /// <p>The partition key equality test is required, and must be specified in the following format:</p>
705 /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
706 /// <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>
707 /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
708 /// <p>Valid comparisons for the sort key condition are as follows:</p>
709 /// <ul>
710 /// <li>
711 /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
712 /// <li>
713 /// <p><code>sortKeyName</code> <code><</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
714 /// <li>
715 /// <p><code>sortKeyName</code> <code><=</code> <code>:sortkeyval</code> - true if the sort key value is less than or equal to <code>:sortkeyval</code>.</p></li>
716 /// <li>
717 /// <p><code>sortKeyName</code> <code>></code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
718 /// <li>
719 /// <p><code>sortKeyName</code> <code>>= </code> <code>:sortkeyval</code> - true if the sort key value is greater than or equal to <code>:sortkeyval</code>.</p></li>
720 /// <li>
721 /// <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>
722 /// <li>
723 /// <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>
724 /// </ul>
725 /// <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>
726 /// <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>
727 /// <ul>
728 /// <li>
729 /// <p><code>Size = :myval</code></p></li>
730 /// </ul>
731 /// <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>
732 /// <ul>
733 /// <li>
734 /// <p><code>#S = :myval</code></p></li>
735 /// </ul>
736 /// <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>
737 /// <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>
738 pub fn set_key_condition_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
739 self.key_condition_expression = input; self
740 }
741 /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
742 /// <p>The condition must perform an equality test on a single partition key value.</p>
743 /// <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>
744 /// <p>The partition key equality test is required, and must be specified in the following format:</p>
745 /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
746 /// <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>
747 /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
748 /// <p>Valid comparisons for the sort key condition are as follows:</p>
749 /// <ul>
750 /// <li>
751 /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
752 /// <li>
753 /// <p><code>sortKeyName</code> <code><</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
754 /// <li>
755 /// <p><code>sortKeyName</code> <code><=</code> <code>:sortkeyval</code> - true if the sort key value is less than or equal to <code>:sortkeyval</code>.</p></li>
756 /// <li>
757 /// <p><code>sortKeyName</code> <code>></code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
758 /// <li>
759 /// <p><code>sortKeyName</code> <code>>= </code> <code>:sortkeyval</code> - true if the sort key value is greater than or equal to <code>:sortkeyval</code>.</p></li>
760 /// <li>
761 /// <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>
762 /// <li>
763 /// <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>
764 /// </ul>
765 /// <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>
766 /// <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>
767 /// <ul>
768 /// <li>
769 /// <p><code>Size = :myval</code></p></li>
770 /// </ul>
771 /// <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>
772 /// <ul>
773 /// <li>
774 /// <p><code>#S = :myval</code></p></li>
775 /// </ul>
776 /// <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>
777 /// <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>
778 pub fn get_key_condition_expression(&self) -> &::std::option::Option<::std::string::String> {
779 &self.key_condition_expression
780 }
781 /// Adds a key-value pair to `expression_attribute_names`.
782 ///
783 /// To override the contents of this collection use [`set_expression_attribute_names`](Self::set_expression_attribute_names).
784 ///
785 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
786 /// <ul>
787 /// <li>
788 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
789 /// <li>
790 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
791 /// <li>
792 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
793 /// </ul>
794 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
795 /// <ul>
796 /// <li>
797 /// <p><code>Percentile</code></p></li>
798 /// </ul>
799 /// <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>
800 /// <ul>
801 /// <li>
802 /// <p><code>{"#P":"Percentile"}</code></p></li>
803 /// </ul>
804 /// <p>You could then use this substitution in an expression, as in this example:</p>
805 /// <ul>
806 /// <li>
807 /// <p><code>#P = :val</code></p></li>
808 /// </ul><note>
809 /// <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>
810 /// </note>
811 /// <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>
812 pub fn expression_attribute_names(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
813 let mut hash_map = self.expression_attribute_names.unwrap_or_default();
814 hash_map.insert(k.into(), v.into());
815 self.expression_attribute_names = ::std::option::Option::Some(hash_map);
816 self
817 }
818 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
819 /// <ul>
820 /// <li>
821 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
822 /// <li>
823 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
824 /// <li>
825 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
826 /// </ul>
827 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
828 /// <ul>
829 /// <li>
830 /// <p><code>Percentile</code></p></li>
831 /// </ul>
832 /// <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>
833 /// <ul>
834 /// <li>
835 /// <p><code>{"#P":"Percentile"}</code></p></li>
836 /// </ul>
837 /// <p>You could then use this substitution in an expression, as in this example:</p>
838 /// <ul>
839 /// <li>
840 /// <p><code>#P = :val</code></p></li>
841 /// </ul><note>
842 /// <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>
843 /// </note>
844 /// <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>
845 pub fn set_expression_attribute_names(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>) -> Self {
846 self.expression_attribute_names = input; self
847 }
848 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
849 /// <ul>
850 /// <li>
851 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
852 /// <li>
853 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
854 /// <li>
855 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
856 /// </ul>
857 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
858 /// <ul>
859 /// <li>
860 /// <p><code>Percentile</code></p></li>
861 /// </ul>
862 /// <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>
863 /// <ul>
864 /// <li>
865 /// <p><code>{"#P":"Percentile"}</code></p></li>
866 /// </ul>
867 /// <p>You could then use this substitution in an expression, as in this example:</p>
868 /// <ul>
869 /// <li>
870 /// <p><code>#P = :val</code></p></li>
871 /// </ul><note>
872 /// <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>
873 /// </note>
874 /// <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>
875 pub fn get_expression_attribute_names(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
876 &self.expression_attribute_names
877 }
878 /// Adds a key-value pair to `expression_attribute_values`.
879 ///
880 /// To override the contents of this collection use [`set_expression_attribute_values`](Self::set_expression_attribute_values).
881 ///
882 /// <p>One or more values that can be substituted in an expression.</p>
883 /// <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>
884 /// <p><code>Available | Backordered | Discontinued</code></p>
885 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
886 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
887 /// <p>You could then use these values in an expression, such as this:</p>
888 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
889 /// <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>
890 pub fn expression_attribute_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
891 let mut hash_map = self.expression_attribute_values.unwrap_or_default();
892 hash_map.insert(k.into(), v);
893 self.expression_attribute_values = ::std::option::Option::Some(hash_map);
894 self
895 }
896 /// <p>One or more values that can be substituted in an expression.</p>
897 /// <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>
898 /// <p><code>Available | Backordered | Discontinued</code></p>
899 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
900 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
901 /// <p>You could then use these values in an expression, such as this:</p>
902 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
903 /// <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>
904 pub fn set_expression_attribute_values(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
905 self.expression_attribute_values = input; self
906 }
907 /// <p>One or more values that can be substituted in an expression.</p>
908 /// <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>
909 /// <p><code>Available | Backordered | Discontinued</code></p>
910 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
911 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
912 /// <p>You could then use these values in an expression, such as this:</p>
913 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
914 /// <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>
915 pub fn get_expression_attribute_values(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
916 &self.expression_attribute_values
917 }
918 /// Consumes the builder and constructs a [`QueryInput`](crate::operation::query::QueryInput).
919 pub fn build(self) -> ::std::result::Result<crate::operation::query::QueryInput, ::aws_smithy_types::error::operation::BuildError> {
920 ::std::result::Result::Ok(
921 crate::operation::query::QueryInput {
922 table_name: self.table_name
923 ,
924 index_name: self.index_name
925 ,
926 select: self.select
927 ,
928 attributes_to_get: self.attributes_to_get
929 ,
930 limit: self.limit
931 ,
932 consistent_read: self.consistent_read
933 ,
934 key_conditions: self.key_conditions
935 ,
936 query_filter: self.query_filter
937 ,
938 conditional_operator: self.conditional_operator
939 ,
940 scan_index_forward: self.scan_index_forward
941 ,
942 exclusive_start_key: self.exclusive_start_key
943 ,
944 return_consumed_capacity: self.return_consumed_capacity
945 ,
946 projection_expression: self.projection_expression
947 ,
948 filter_expression: self.filter_expression
949 ,
950 key_condition_expression: self.key_condition_expression
951 ,
952 expression_attribute_names: self.expression_attribute_names
953 ,
954 expression_attribute_values: self.expression_attribute_values
955 ,
956 }
957 )
958 }
959}
960