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}
321static QUERYINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.dynamodb.synthetic#QueryInput", "com.amazonaws.dynamodb.synthetic", "QueryInput");
322static QUERYINPUT_MEMBER_TABLE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
323 ::aws_smithy_schema::ShapeId::from_static(
324 "com.amazonaws.dynamodb.synthetic#QueryInput$TableName",
325 "com.amazonaws.dynamodb.synthetic",
326 "QueryInput",
327 ),
328 ::aws_smithy_schema::ShapeType::String,
329 "TableName",
330 0,
331 );
332static QUERYINPUT_MEMBER_INDEX_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
333 ::aws_smithy_schema::ShapeId::from_static(
334 "com.amazonaws.dynamodb.synthetic#QueryInput$IndexName",
335 "com.amazonaws.dynamodb.synthetic",
336 "QueryInput",
337 ),
338 ::aws_smithy_schema::ShapeType::String,
339 "IndexName",
340 1,
341 );
342static QUERYINPUT_MEMBER_SELECT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
343 ::aws_smithy_schema::ShapeId::from_static(
344 "com.amazonaws.dynamodb.synthetic#QueryInput$Select",
345 "com.amazonaws.dynamodb.synthetic",
346 "QueryInput",
347 ),
348 ::aws_smithy_schema::ShapeType::String,
349 "Select",
350 2,
351 );
352static QUERYINPUT_MEMBER_ATTRIBUTES_TO_GET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
353 ::aws_smithy_schema::ShapeId::from_static(
354 "com.amazonaws.dynamodb.synthetic#QueryInput$AttributesToGet",
355 "com.amazonaws.dynamodb.synthetic",
356 "QueryInput",
357 ),
358 ::aws_smithy_schema::ShapeType::List,
359 "AttributesToGet",
360 3,
361 );
362static QUERYINPUT_MEMBER_LIMIT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
363 ::aws_smithy_schema::ShapeId::from_static(
364 "com.amazonaws.dynamodb.synthetic#QueryInput$Limit",
365 "com.amazonaws.dynamodb.synthetic",
366 "QueryInput",
367 ),
368 ::aws_smithy_schema::ShapeType::Integer,
369 "Limit",
370 4,
371 );
372static QUERYINPUT_MEMBER_CONSISTENT_READ: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
373 ::aws_smithy_schema::ShapeId::from_static(
374 "com.amazonaws.dynamodb.synthetic#QueryInput$ConsistentRead",
375 "com.amazonaws.dynamodb.synthetic",
376 "QueryInput",
377 ),
378 ::aws_smithy_schema::ShapeType::Boolean,
379 "ConsistentRead",
380 5,
381 );
382static QUERYINPUT_MEMBER_KEY_CONDITIONS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
383 ::aws_smithy_schema::ShapeId::from_static(
384 "com.amazonaws.dynamodb.synthetic#QueryInput$KeyConditions",
385 "com.amazonaws.dynamodb.synthetic",
386 "QueryInput",
387 ),
388 ::aws_smithy_schema::ShapeType::Map,
389 "KeyConditions",
390 6,
391 );
392static QUERYINPUT_MEMBER_QUERY_FILTER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
393 ::aws_smithy_schema::ShapeId::from_static(
394 "com.amazonaws.dynamodb.synthetic#QueryInput$QueryFilter",
395 "com.amazonaws.dynamodb.synthetic",
396 "QueryInput",
397 ),
398 ::aws_smithy_schema::ShapeType::Map,
399 "QueryFilter",
400 7,
401 );
402static QUERYINPUT_MEMBER_CONDITIONAL_OPERATOR: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
403 ::aws_smithy_schema::ShapeId::from_static(
404 "com.amazonaws.dynamodb.synthetic#QueryInput$ConditionalOperator",
405 "com.amazonaws.dynamodb.synthetic",
406 "QueryInput",
407 ),
408 ::aws_smithy_schema::ShapeType::String,
409 "ConditionalOperator",
410 8,
411 );
412static QUERYINPUT_MEMBER_SCAN_INDEX_FORWARD: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
413 ::aws_smithy_schema::ShapeId::from_static(
414 "com.amazonaws.dynamodb.synthetic#QueryInput$ScanIndexForward",
415 "com.amazonaws.dynamodb.synthetic",
416 "QueryInput",
417 ),
418 ::aws_smithy_schema::ShapeType::Boolean,
419 "ScanIndexForward",
420 9,
421 );
422static QUERYINPUT_MEMBER_EXCLUSIVE_START_KEY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
423 ::aws_smithy_schema::ShapeId::from_static(
424 "com.amazonaws.dynamodb.synthetic#QueryInput$ExclusiveStartKey",
425 "com.amazonaws.dynamodb.synthetic",
426 "QueryInput",
427 ),
428 ::aws_smithy_schema::ShapeType::Map,
429 "ExclusiveStartKey",
430 10,
431 );
432static QUERYINPUT_MEMBER_RETURN_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
433 ::aws_smithy_schema::ShapeId::from_static(
434 "com.amazonaws.dynamodb.synthetic#QueryInput$ReturnConsumedCapacity",
435 "com.amazonaws.dynamodb.synthetic",
436 "QueryInput",
437 ),
438 ::aws_smithy_schema::ShapeType::String,
439 "ReturnConsumedCapacity",
440 11,
441 );
442static QUERYINPUT_MEMBER_PROJECTION_EXPRESSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
443 ::aws_smithy_schema::ShapeId::from_static(
444 "com.amazonaws.dynamodb.synthetic#QueryInput$ProjectionExpression",
445 "com.amazonaws.dynamodb.synthetic",
446 "QueryInput",
447 ),
448 ::aws_smithy_schema::ShapeType::String,
449 "ProjectionExpression",
450 12,
451 );
452static QUERYINPUT_MEMBER_FILTER_EXPRESSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
453 ::aws_smithy_schema::ShapeId::from_static(
454 "com.amazonaws.dynamodb.synthetic#QueryInput$FilterExpression",
455 "com.amazonaws.dynamodb.synthetic",
456 "QueryInput",
457 ),
458 ::aws_smithy_schema::ShapeType::String,
459 "FilterExpression",
460 13,
461 );
462static QUERYINPUT_MEMBER_KEY_CONDITION_EXPRESSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
463 ::aws_smithy_schema::ShapeId::from_static(
464 "com.amazonaws.dynamodb.synthetic#QueryInput$KeyConditionExpression",
465 "com.amazonaws.dynamodb.synthetic",
466 "QueryInput",
467 ),
468 ::aws_smithy_schema::ShapeType::String,
469 "KeyConditionExpression",
470 14,
471 );
472static QUERYINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
473 ::aws_smithy_schema::ShapeId::from_static(
474 "com.amazonaws.dynamodb.synthetic#QueryInput$ExpressionAttributeNames",
475 "com.amazonaws.dynamodb.synthetic",
476 "QueryInput",
477 ),
478 ::aws_smithy_schema::ShapeType::Map,
479 "ExpressionAttributeNames",
480 15,
481 );
482static QUERYINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
483 ::aws_smithy_schema::ShapeId::from_static(
484 "com.amazonaws.dynamodb.synthetic#QueryInput$ExpressionAttributeValues",
485 "com.amazonaws.dynamodb.synthetic",
486 "QueryInput",
487 ),
488 ::aws_smithy_schema::ShapeType::Map,
489 "ExpressionAttributeValues",
490 16,
491 );
492static QUERYINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
493 QUERYINPUT_SCHEMA_ID,
494 ::aws_smithy_schema::ShapeType::Structure,
495 &[&QUERYINPUT_MEMBER_TABLE_NAME, &QUERYINPUT_MEMBER_INDEX_NAME, &QUERYINPUT_MEMBER_SELECT, &QUERYINPUT_MEMBER_ATTRIBUTES_TO_GET, &QUERYINPUT_MEMBER_LIMIT, &QUERYINPUT_MEMBER_CONSISTENT_READ, &QUERYINPUT_MEMBER_KEY_CONDITIONS, &QUERYINPUT_MEMBER_QUERY_FILTER, &QUERYINPUT_MEMBER_CONDITIONAL_OPERATOR, &QUERYINPUT_MEMBER_SCAN_INDEX_FORWARD, &QUERYINPUT_MEMBER_EXCLUSIVE_START_KEY, &QUERYINPUT_MEMBER_RETURN_CONSUMED_CAPACITY, &QUERYINPUT_MEMBER_PROJECTION_EXPRESSION, &QUERYINPUT_MEMBER_FILTER_EXPRESSION, &QUERYINPUT_MEMBER_KEY_CONDITION_EXPRESSION, &QUERYINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES, &QUERYINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES],
496 );
497impl QueryInput {
498 /// The schema for this shape.
499 pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &QUERYINPUT_SCHEMA;
500 }
501impl ::aws_smithy_schema::serde::SerializableStruct for QueryInput {
502 #[allow(unused_variables, clippy::diverging_sub_expression)]
503 fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
504 if let Some(ref val) = self.table_name {
505 ser.write_string(&QUERYINPUT_MEMBER_TABLE_NAME, val)?;
506 }
507if let Some(ref val) = self.index_name {
508 ser.write_string(&QUERYINPUT_MEMBER_INDEX_NAME, val)?;
509 }
510if let Some(ref val) = self.select {
511 ser.write_string(&QUERYINPUT_MEMBER_SELECT, val.as_str())?;
512 }
513if let Some(ref val) = self.attributes_to_get {
514
515 ser.write_list(&QUERYINPUT_MEMBER_ATTRIBUTES_TO_GET, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
516 for item in val {
517 ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
518 }
519 Ok(())
520 })?;
521
522 }
523if let Some(ref val) = self.limit {
524 ser.write_integer(&QUERYINPUT_MEMBER_LIMIT, *val)?;
525 }
526if let Some(ref val) = self.consistent_read {
527 ser.write_boolean(&QUERYINPUT_MEMBER_CONSISTENT_READ, *val)?;
528 }
529if let Some(ref val) = self.key_conditions {
530
531 ser.write_map(&QUERYINPUT_MEMBER_KEY_CONDITIONS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
532 for (key, value) in val {
533 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
534 ser.write_struct(crate::types::Condition::SCHEMA, value)?;
535 }
536 Ok(())
537 })?;
538
539 }
540if let Some(ref val) = self.query_filter {
541
542 ser.write_map(&QUERYINPUT_MEMBER_QUERY_FILTER, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
543 for (key, value) in val {
544 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
545 ser.write_struct(crate::types::Condition::SCHEMA, value)?;
546 }
547 Ok(())
548 })?;
549
550 }
551if let Some(ref val) = self.conditional_operator {
552 ser.write_string(&QUERYINPUT_MEMBER_CONDITIONAL_OPERATOR, val.as_str())?;
553 }
554if let Some(ref val) = self.scan_index_forward {
555 ser.write_boolean(&QUERYINPUT_MEMBER_SCAN_INDEX_FORWARD, *val)?;
556 }
557if let Some(ref val) = self.exclusive_start_key {
558
559 ser.write_map(&QUERYINPUT_MEMBER_EXCLUSIVE_START_KEY, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
560 for (key, value) in val {
561 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
562 ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
563 }
564 Ok(())
565 })?;
566
567 }
568if let Some(ref val) = self.return_consumed_capacity {
569 ser.write_string(&QUERYINPUT_MEMBER_RETURN_CONSUMED_CAPACITY, val.as_str())?;
570 }
571if let Some(ref val) = self.projection_expression {
572 ser.write_string(&QUERYINPUT_MEMBER_PROJECTION_EXPRESSION, val)?;
573 }
574if let Some(ref val) = self.filter_expression {
575 ser.write_string(&QUERYINPUT_MEMBER_FILTER_EXPRESSION, val)?;
576 }
577if let Some(ref val) = self.key_condition_expression {
578 ser.write_string(&QUERYINPUT_MEMBER_KEY_CONDITION_EXPRESSION, val)?;
579 }
580if let Some(ref val) = self.expression_attribute_names {
581
582 ser.write_map(&QUERYINPUT_MEMBER_EXPRESSION_ATTRIBUTE_NAMES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
583 for (key, value) in val {
584 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
585 ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
586 }
587 Ok(())
588 })?;
589
590 }
591if let Some(ref val) = self.expression_attribute_values {
592
593 ser.write_map(&QUERYINPUT_MEMBER_EXPRESSION_ATTRIBUTE_VALUES, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
594 for (key, value) in val {
595 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
596 ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
597 }
598 Ok(())
599 })?;
600
601 }
602 Ok(())
603 }
604 }
605impl QueryInput {
606 /// Deserializes this structure from a [`ShapeDeserializer`].
607 pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
608 #[allow(unused_variables, unused_mut)]
609 let mut builder = Self::builder();
610 #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
611 deserializer.read_struct(&QUERYINPUT_SCHEMA, &mut |member, deser| {
612 match member.member_index() {
613 Some(0) => {
614 builder.table_name = Some(deser.read_string(member)?);
615 }
616Some(1) => {
617 builder.index_name = Some(deser.read_string(member)?);
618 }
619Some(2) => {
620 builder.select = Some(crate::types::Select::from(deser.read_string(member)?.as_str()));
621 }
622Some(3) => {
623 builder.attributes_to_get = Some(deser.read_string_list(member)?);
624 }
625Some(4) => {
626 builder.limit = Some(deser.read_integer(member)?);
627 }
628Some(5) => {
629 builder.consistent_read = Some(deser.read_boolean(member)?);
630 }
631Some(6) => {
632 builder.key_conditions = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::Condition::deserialize(deser)?); Ok(()) })?; container });
633 }
634Some(7) => {
635 builder.query_filter = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::Condition::deserialize(deser)?); Ok(()) })?; container });
636 }
637Some(8) => {
638 builder.conditional_operator = Some(crate::types::ConditionalOperator::from(deser.read_string(member)?.as_str()));
639 }
640Some(9) => {
641 builder.scan_index_forward = Some(deser.read_boolean(member)?);
642 }
643Some(10) => {
644 builder.exclusive_start_key = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::AttributeValue::deserialize(deser)?); Ok(()) })?; container });
645 }
646Some(11) => {
647 builder.return_consumed_capacity = Some(crate::types::ReturnConsumedCapacity::from(deser.read_string(member)?.as_str()));
648 }
649Some(12) => {
650 builder.projection_expression = Some(deser.read_string(member)?);
651 }
652Some(13) => {
653 builder.filter_expression = Some(deser.read_string(member)?);
654 }
655Some(14) => {
656 builder.key_condition_expression = Some(deser.read_string(member)?);
657 }
658Some(15) => {
659 builder.expression_attribute_names = Some(deser.read_string_string_map(member)?);
660 }
661Some(16) => {
662 builder.expression_attribute_values = Some({ let mut container = std::collections::HashMap::new(); deser.read_map(member, &mut |key, deser| { container.insert(key, crate::types::AttributeValue::deserialize(deser)?); Ok(()) })?; container });
663 }
664 _ => {}
665 }
666 Ok(())
667 })?;
668 builder.table_name = builder.table_name.or(Some(String::new()));
669builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
670 }
671 }
672impl QueryInput {
673 /// Deserializes this structure from a body deserializer and HTTP response.
674 pub fn deserialize_with_response(
675 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
676 _headers: &::aws_smithy_runtime_api::http::Headers,
677 _status: u16,
678 _body: &[u8],
679 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
680 Self::deserialize(deserializer)
681 }
682 }
683impl QueryInput {
684 /// Creates a new builder-style object to manufacture [`QueryInput`](crate::operation::query::QueryInput).
685 pub fn builder() -> crate::operation::query::builders::QueryInputBuilder {
686 crate::operation::query::builders::QueryInputBuilder::default()
687 }
688}
689
690/// A builder for [`QueryInput`](crate::operation::query::QueryInput).
691#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
692#[non_exhaustive]
693pub struct QueryInputBuilder {
694 pub(crate) table_name: ::std::option::Option<::std::string::String>,
695 pub(crate) index_name: ::std::option::Option<::std::string::String>,
696 pub(crate) select: ::std::option::Option<crate::types::Select>,
697 pub(crate) attributes_to_get: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
698 pub(crate) limit: ::std::option::Option<i32>,
699 pub(crate) consistent_read: ::std::option::Option<bool>,
700 pub(crate) key_conditions: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>>,
701 pub(crate) query_filter: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>>,
702 pub(crate) conditional_operator: ::std::option::Option<crate::types::ConditionalOperator>,
703 pub(crate) scan_index_forward: ::std::option::Option<bool>,
704 pub(crate) exclusive_start_key: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
705 pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
706 pub(crate) projection_expression: ::std::option::Option<::std::string::String>,
707 pub(crate) filter_expression: ::std::option::Option<::std::string::String>,
708 pub(crate) key_condition_expression: ::std::option::Option<::std::string::String>,
709 pub(crate) expression_attribute_names: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>,
710 pub(crate) expression_attribute_values: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
711}
712impl QueryInputBuilder {
713 /// <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>
714 /// This field is required.
715 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
716 self.table_name = ::std::option::Option::Some(input.into());
717 self
718 }
719 /// <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>
720 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
721 self.table_name = input; self
722 }
723 /// <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>
724 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
725 &self.table_name
726 }
727 /// <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>
728 pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
729 self.index_name = ::std::option::Option::Some(input.into());
730 self
731 }
732 /// <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>
733 pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
734 self.index_name = input; self
735 }
736 /// <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>
737 pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
738 &self.index_name
739 }
740 /// <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>
741 /// <ul>
742 /// <li>
743 /// <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>
744 /// <li>
745 /// <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>
746 /// <li>
747 /// <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>
748 /// <li>
749 /// <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>
750 /// <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>
751 /// <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>
752 /// </ul>
753 /// <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>
754 /// <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>
755 /// </note>
756 pub fn select(mut self, input: crate::types::Select) -> Self {
757 self.select = ::std::option::Option::Some(input);
758 self
759 }
760 /// <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>
761 /// <ul>
762 /// <li>
763 /// <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>
764 /// <li>
765 /// <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>
766 /// <li>
767 /// <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>
768 /// <li>
769 /// <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>
770 /// <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>
771 /// <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>
772 /// </ul>
773 /// <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>
774 /// <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>
775 /// </note>
776 pub fn set_select(mut self, input: ::std::option::Option<crate::types::Select>) -> Self {
777 self.select = input; self
778 }
779 /// <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>
780 /// <ul>
781 /// <li>
782 /// <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>
783 /// <li>
784 /// <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>
785 /// <li>
786 /// <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>
787 /// <li>
788 /// <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>
789 /// <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>
790 /// <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>
791 /// </ul>
792 /// <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>
793 /// <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>
794 /// </note>
795 pub fn get_select(&self) -> &::std::option::Option<crate::types::Select> {
796 &self.select
797 }
798 /// Appends an item to `attributes_to_get`.
799 ///
800 /// To override the contents of this collection use [`set_attributes_to_get`](Self::set_attributes_to_get).
801 ///
802 /// <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>
803 pub fn attributes_to_get(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
804 let mut v = self.attributes_to_get.unwrap_or_default();
805 v.push(input.into());
806 self.attributes_to_get = ::std::option::Option::Some(v);
807 self
808 }
809 /// <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>
810 pub fn set_attributes_to_get(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
811 self.attributes_to_get = input; self
812 }
813 /// <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>
814 pub fn get_attributes_to_get(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
815 &self.attributes_to_get
816 }
817 /// <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>
818 pub fn limit(mut self, input: i32) -> Self {
819 self.limit = ::std::option::Option::Some(input);
820 self
821 }
822 /// <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>
823 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
824 self.limit = input; self
825 }
826 /// <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>
827 pub fn get_limit(&self) -> &::std::option::Option<i32> {
828 &self.limit
829 }
830 /// <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>
831 /// <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>
832 pub fn consistent_read(mut self, input: bool) -> Self {
833 self.consistent_read = ::std::option::Option::Some(input);
834 self
835 }
836 /// <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>
837 /// <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>
838 pub fn set_consistent_read(mut self, input: ::std::option::Option<bool>) -> Self {
839 self.consistent_read = input; self
840 }
841 /// <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>
842 /// <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>
843 pub fn get_consistent_read(&self) -> &::std::option::Option<bool> {
844 &self.consistent_read
845 }
846 /// Adds a key-value pair to `key_conditions`.
847 ///
848 /// To override the contents of this collection use [`set_key_conditions`](Self::set_key_conditions).
849 ///
850 /// <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>
851 pub fn key_conditions(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Condition) -> Self {
852 let mut hash_map = self.key_conditions.unwrap_or_default();
853 hash_map.insert(k.into(), v);
854 self.key_conditions = ::std::option::Option::Some(hash_map);
855 self
856 }
857 /// <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>
858 pub fn set_key_conditions(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>>) -> Self {
859 self.key_conditions = input; self
860 }
861 /// <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>
862 pub fn get_key_conditions(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>> {
863 &self.key_conditions
864 }
865 /// Adds a key-value pair to `query_filter`.
866 ///
867 /// To override the contents of this collection use [`set_query_filter`](Self::set_query_filter).
868 ///
869 /// <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>
870 pub fn query_filter(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::Condition) -> Self {
871 let mut hash_map = self.query_filter.unwrap_or_default();
872 hash_map.insert(k.into(), v);
873 self.query_filter = ::std::option::Option::Some(hash_map);
874 self
875 }
876 /// <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>
877 pub fn set_query_filter(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>>) -> Self {
878 self.query_filter = input; self
879 }
880 /// <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>
881 pub fn get_query_filter(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::Condition>> {
882 &self.query_filter
883 }
884 /// <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>
885 pub fn conditional_operator(mut self, input: crate::types::ConditionalOperator) -> Self {
886 self.conditional_operator = ::std::option::Option::Some(input);
887 self
888 }
889 /// <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>
890 pub fn set_conditional_operator(mut self, input: ::std::option::Option<crate::types::ConditionalOperator>) -> Self {
891 self.conditional_operator = input; self
892 }
893 /// <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>
894 pub fn get_conditional_operator(&self) -> &::std::option::Option<crate::types::ConditionalOperator> {
895 &self.conditional_operator
896 }
897 /// <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>
898 /// <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>
899 /// <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>
900 pub fn scan_index_forward(mut self, input: bool) -> Self {
901 self.scan_index_forward = ::std::option::Option::Some(input);
902 self
903 }
904 /// <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>
905 /// <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>
906 /// <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>
907 pub fn set_scan_index_forward(mut self, input: ::std::option::Option<bool>) -> Self {
908 self.scan_index_forward = input; self
909 }
910 /// <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>
911 /// <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>
912 /// <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>
913 pub fn get_scan_index_forward(&self) -> &::std::option::Option<bool> {
914 &self.scan_index_forward
915 }
916 /// Adds a key-value pair to `exclusive_start_key`.
917 ///
918 /// To override the contents of this collection use [`set_exclusive_start_key`](Self::set_exclusive_start_key).
919 ///
920 /// <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>
921 /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
922 pub fn exclusive_start_key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
923 let mut hash_map = self.exclusive_start_key.unwrap_or_default();
924 hash_map.insert(k.into(), v);
925 self.exclusive_start_key = ::std::option::Option::Some(hash_map);
926 self
927 }
928 /// <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>
929 /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
930 pub fn set_exclusive_start_key(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
931 self.exclusive_start_key = input; self
932 }
933 /// <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>
934 /// <p>The data type for <code>ExclusiveStartKey</code> must be String, Number, or Binary. No set data types are allowed.</p>
935 pub fn get_exclusive_start_key(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
936 &self.exclusive_start_key
937 }
938 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
939 /// <ul>
940 /// <li>
941 /// <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>
942 /// <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>
943 /// <li>
944 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
945 /// <li>
946 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
947 /// </ul>
948 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
949 self.return_consumed_capacity = ::std::option::Option::Some(input);
950 self
951 }
952 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
953 /// <ul>
954 /// <li>
955 /// <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>
956 /// <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>
957 /// <li>
958 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
959 /// <li>
960 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
961 /// </ul>
962 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
963 self.return_consumed_capacity = input; self
964 }
965 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
966 /// <ul>
967 /// <li>
968 /// <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>
969 /// <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>
970 /// <li>
971 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
972 /// <li>
973 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
974 /// </ul>
975 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
976 &self.return_consumed_capacity
977 }
978 /// <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>
979 /// <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>
980 /// <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>
981 pub fn projection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
982 self.projection_expression = ::std::option::Option::Some(input.into());
983 self
984 }
985 /// <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>
986 /// <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>
987 /// <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>
988 pub fn set_projection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
989 self.projection_expression = input; self
990 }
991 /// <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>
992 /// <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>
993 /// <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>
994 pub fn get_projection_expression(&self) -> &::std::option::Option<::std::string::String> {
995 &self.projection_expression
996 }
997 /// <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>
998 /// <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>
999 /// <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>
1000 /// </note>
1001 /// <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>
1002 pub fn filter_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
1003 self.filter_expression = ::std::option::Option::Some(input.into());
1004 self
1005 }
1006 /// <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>
1007 /// <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>
1008 /// <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>
1009 /// </note>
1010 /// <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>
1011 pub fn set_filter_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
1012 self.filter_expression = input; self
1013 }
1014 /// <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>
1015 /// <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>
1016 /// <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>
1017 /// </note>
1018 /// <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>
1019 pub fn get_filter_expression(&self) -> &::std::option::Option<::std::string::String> {
1020 &self.filter_expression
1021 }
1022 /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
1023 /// <p>The condition must perform an equality test on a single partition key value.</p>
1024 /// <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>
1025 /// <p>The partition key equality test is required, and must be specified in the following format:</p>
1026 /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
1027 /// <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>
1028 /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
1029 /// <p>Valid comparisons for the sort key condition are as follows:</p>
1030 /// <ul>
1031 /// <li>
1032 /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
1033 /// <li>
1034 /// <p><code>sortKeyName</code> <code><</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
1035 /// <li>
1036 /// <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>
1037 /// <li>
1038 /// <p><code>sortKeyName</code> <code>></code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
1039 /// <li>
1040 /// <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>
1041 /// <li>
1042 /// <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>
1043 /// <li>
1044 /// <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>
1045 /// </ul>
1046 /// <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>
1047 /// <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>
1048 /// <ul>
1049 /// <li>
1050 /// <p><code>Size = :myval</code></p></li>
1051 /// </ul>
1052 /// <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>
1053 /// <ul>
1054 /// <li>
1055 /// <p><code>#S = :myval</code></p></li>
1056 /// </ul>
1057 /// <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>
1058 /// <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>
1059 pub fn key_condition_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
1060 self.key_condition_expression = ::std::option::Option::Some(input.into());
1061 self
1062 }
1063 /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
1064 /// <p>The condition must perform an equality test on a single partition key value.</p>
1065 /// <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>
1066 /// <p>The partition key equality test is required, and must be specified in the following format:</p>
1067 /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
1068 /// <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>
1069 /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
1070 /// <p>Valid comparisons for the sort key condition are as follows:</p>
1071 /// <ul>
1072 /// <li>
1073 /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
1074 /// <li>
1075 /// <p><code>sortKeyName</code> <code><</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
1076 /// <li>
1077 /// <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>
1078 /// <li>
1079 /// <p><code>sortKeyName</code> <code>></code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
1080 /// <li>
1081 /// <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>
1082 /// <li>
1083 /// <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>
1084 /// <li>
1085 /// <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>
1086 /// </ul>
1087 /// <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>
1088 /// <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>
1089 /// <ul>
1090 /// <li>
1091 /// <p><code>Size = :myval</code></p></li>
1092 /// </ul>
1093 /// <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>
1094 /// <ul>
1095 /// <li>
1096 /// <p><code>#S = :myval</code></p></li>
1097 /// </ul>
1098 /// <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>
1099 /// <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>
1100 pub fn set_key_condition_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
1101 self.key_condition_expression = input; self
1102 }
1103 /// <p>The condition that specifies the key values for items to be retrieved by the <code>Query</code> action.</p>
1104 /// <p>The condition must perform an equality test on a single partition key value.</p>
1105 /// <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>
1106 /// <p>The partition key equality test is required, and must be specified in the following format:</p>
1107 /// <p><code>partitionKeyName</code> <i>=</i> <code>:partitionkeyval</code></p>
1108 /// <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>
1109 /// <p><code>partitionKeyName</code> <code>=</code> <code>:partitionkeyval</code> <code>AND</code> <code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code></p>
1110 /// <p>Valid comparisons for the sort key condition are as follows:</p>
1111 /// <ul>
1112 /// <li>
1113 /// <p><code>sortKeyName</code> <code>=</code> <code>:sortkeyval</code> - true if the sort key value is equal to <code>:sortkeyval</code>.</p></li>
1114 /// <li>
1115 /// <p><code>sortKeyName</code> <code><</code> <code>:sortkeyval</code> - true if the sort key value is less than <code>:sortkeyval</code>.</p></li>
1116 /// <li>
1117 /// <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>
1118 /// <li>
1119 /// <p><code>sortKeyName</code> <code>></code> <code>:sortkeyval</code> - true if the sort key value is greater than <code>:sortkeyval</code>.</p></li>
1120 /// <li>
1121 /// <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>
1122 /// <li>
1123 /// <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>
1124 /// <li>
1125 /// <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>
1126 /// </ul>
1127 /// <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>
1128 /// <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>
1129 /// <ul>
1130 /// <li>
1131 /// <p><code>Size = :myval</code></p></li>
1132 /// </ul>
1133 /// <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>
1134 /// <ul>
1135 /// <li>
1136 /// <p><code>#S = :myval</code></p></li>
1137 /// </ul>
1138 /// <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>
1139 /// <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>
1140 pub fn get_key_condition_expression(&self) -> &::std::option::Option<::std::string::String> {
1141 &self.key_condition_expression
1142 }
1143 /// Adds a key-value pair to `expression_attribute_names`.
1144 ///
1145 /// To override the contents of this collection use [`set_expression_attribute_names`](Self::set_expression_attribute_names).
1146 ///
1147 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
1148 /// <ul>
1149 /// <li>
1150 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
1151 /// <li>
1152 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
1153 /// <li>
1154 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
1155 /// </ul>
1156 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
1157 /// <ul>
1158 /// <li>
1159 /// <p><code>Percentile</code></p></li>
1160 /// </ul>
1161 /// <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>
1162 /// <ul>
1163 /// <li>
1164 /// <p><code>{"#P":"Percentile"}</code></p></li>
1165 /// </ul>
1166 /// <p>You could then use this substitution in an expression, as in this example:</p>
1167 /// <ul>
1168 /// <li>
1169 /// <p><code>#P = :val</code></p></li>
1170 /// </ul><note>
1171 /// <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>
1172 /// </note>
1173 /// <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>
1174 pub fn expression_attribute_names(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
1175 let mut hash_map = self.expression_attribute_names.unwrap_or_default();
1176 hash_map.insert(k.into(), v.into());
1177 self.expression_attribute_names = ::std::option::Option::Some(hash_map);
1178 self
1179 }
1180 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
1181 /// <ul>
1182 /// <li>
1183 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
1184 /// <li>
1185 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
1186 /// <li>
1187 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
1188 /// </ul>
1189 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
1190 /// <ul>
1191 /// <li>
1192 /// <p><code>Percentile</code></p></li>
1193 /// </ul>
1194 /// <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>
1195 /// <ul>
1196 /// <li>
1197 /// <p><code>{"#P":"Percentile"}</code></p></li>
1198 /// </ul>
1199 /// <p>You could then use this substitution in an expression, as in this example:</p>
1200 /// <ul>
1201 /// <li>
1202 /// <p><code>#P = :val</code></p></li>
1203 /// </ul><note>
1204 /// <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>
1205 /// </note>
1206 /// <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>
1207 pub fn set_expression_attribute_names(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>>) -> Self {
1208 self.expression_attribute_names = input; self
1209 }
1210 /// <p>One or more substitution tokens for attribute names in an expression. The following are some use cases for using <code>ExpressionAttributeNames</code>:</p>
1211 /// <ul>
1212 /// <li>
1213 /// <p>To access an attribute whose name conflicts with a DynamoDB reserved word.</p></li>
1214 /// <li>
1215 /// <p>To create a placeholder for repeating occurrences of an attribute name in an expression.</p></li>
1216 /// <li>
1217 /// <p>To prevent special characters in an attribute name from being misinterpreted in an expression.</p></li>
1218 /// </ul>
1219 /// <p>Use the <b>#</b> character in an expression to dereference an attribute name. For example, consider the following attribute name:</p>
1220 /// <ul>
1221 /// <li>
1222 /// <p><code>Percentile</code></p></li>
1223 /// </ul>
1224 /// <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>
1225 /// <ul>
1226 /// <li>
1227 /// <p><code>{"#P":"Percentile"}</code></p></li>
1228 /// </ul>
1229 /// <p>You could then use this substitution in an expression, as in this example:</p>
1230 /// <ul>
1231 /// <li>
1232 /// <p><code>#P = :val</code></p></li>
1233 /// </ul><note>
1234 /// <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>
1235 /// </note>
1236 /// <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>
1237 pub fn get_expression_attribute_names(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>> {
1238 &self.expression_attribute_names
1239 }
1240 /// Adds a key-value pair to `expression_attribute_values`.
1241 ///
1242 /// To override the contents of this collection use [`set_expression_attribute_values`](Self::set_expression_attribute_values).
1243 ///
1244 /// <p>One or more values that can be substituted in an expression.</p>
1245 /// <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>
1246 /// <p><code>Available | Backordered | Discontinued</code></p>
1247 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
1248 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
1249 /// <p>You could then use these values in an expression, such as this:</p>
1250 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
1251 /// <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>
1252 pub fn expression_attribute_values(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
1253 let mut hash_map = self.expression_attribute_values.unwrap_or_default();
1254 hash_map.insert(k.into(), v);
1255 self.expression_attribute_values = ::std::option::Option::Some(hash_map);
1256 self
1257 }
1258 /// <p>One or more values that can be substituted in an expression.</p>
1259 /// <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>
1260 /// <p><code>Available | Backordered | Discontinued</code></p>
1261 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
1262 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
1263 /// <p>You could then use these values in an expression, such as this:</p>
1264 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
1265 /// <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>
1266 pub fn set_expression_attribute_values(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
1267 self.expression_attribute_values = input; self
1268 }
1269 /// <p>One or more values that can be substituted in an expression.</p>
1270 /// <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>
1271 /// <p><code>Available | Backordered | Discontinued</code></p>
1272 /// <p>You would first need to specify <code>ExpressionAttributeValues</code> as follows:</p>
1273 /// <p><code>{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }</code></p>
1274 /// <p>You could then use these values in an expression, such as this:</p>
1275 /// <p><code>ProductStatus IN (:avail, :back, :disc)</code></p>
1276 /// <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>
1277 pub fn get_expression_attribute_values(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
1278 &self.expression_attribute_values
1279 }
1280 /// Consumes the builder and constructs a [`QueryInput`](crate::operation::query::QueryInput).
1281 pub fn build(self) -> ::std::result::Result<crate::operation::query::QueryInput, ::aws_smithy_types::error::operation::BuildError> {
1282 ::std::result::Result::Ok(
1283 crate::operation::query::QueryInput {
1284 table_name: self.table_name
1285 ,
1286 index_name: self.index_name
1287 ,
1288 select: self.select
1289 ,
1290 attributes_to_get: self.attributes_to_get
1291 ,
1292 limit: self.limit
1293 ,
1294 consistent_read: self.consistent_read
1295 ,
1296 key_conditions: self.key_conditions
1297 ,
1298 query_filter: self.query_filter
1299 ,
1300 conditional_operator: self.conditional_operator
1301 ,
1302 scan_index_forward: self.scan_index_forward
1303 ,
1304 exclusive_start_key: self.exclusive_start_key
1305 ,
1306 return_consumed_capacity: self.return_consumed_capacity
1307 ,
1308 projection_expression: self.projection_expression
1309 ,
1310 filter_expression: self.filter_expression
1311 ,
1312 key_condition_expression: self.key_condition_expression
1313 ,
1314 expression_attribute_names: self.expression_attribute_names
1315 ,
1316 expression_attribute_values: self.expression_attribute_values
1317 ,
1318 }
1319 )
1320 }
1321}
1322