aws_sdk_dynamodb/operation/query/_query_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the output of a <code>Query</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct QueryOutput {
7 /// <p>An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.</p>
8 pub items: ::std::option::Option<::std::vec::Vec::<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>>,
9 /// <p>The number of items in the response.</p>
10 /// <p>If you used a <code>QueryFilter</code> in the request, then <code>Count</code> is the number of items returned after the filter was applied, and <code>ScannedCount</code> is the number of matching items before the filter was applied.</p>
11 /// <p>If you did not use a filter in the request, then <code>Count</code> and <code>ScannedCount</code> are the same.</p>
12 pub count: i32,
13 /// <p>The number of items evaluated, before any <code>QueryFilter</code> is applied. A high <code>ScannedCount</code> value with few, or no, <code>Count</code> results indicates an inefficient <code>Query</code> operation. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Count">Count and ScannedCount</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
14 /// <p>If you did not use a filter in the request, then <code>ScannedCount</code> is the same as <code>Count</code>.</p>
15 pub scanned_count: i32,
16 /// <p>The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.</p>
17 /// <p>If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no more data to be retrieved.</p>
18 /// <p>If <code>LastEvaluatedKey</code> is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when <code>LastEvaluatedKey</code> is empty.</p>
19 pub last_evaluated_key: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
20 /// <p>The capacity units consumed by the <code>Query</code> operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. <code>ConsumedCapacity</code> is only returned if the <code>ReturnConsumedCapacity</code> parameter was specified. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption">Capacity unit consumption for read operations</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
21 pub consumed_capacity: ::std::option::Option<crate::types::ConsumedCapacity>,
22 _request_id: Option<String>,
23}
24impl QueryOutput {
25 /// <p>An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.</p>
26 ///
27 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.items.is_none()`.
28 pub fn items(&self) -> &[::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>] {
29 self.items.as_deref()
30 .unwrap_or_default()
31 }
32 /// <p>The number of items in the response.</p>
33 /// <p>If you used a <code>QueryFilter</code> in the request, then <code>Count</code> is the number of items returned after the filter was applied, and <code>ScannedCount</code> is the number of matching items before the filter was applied.</p>
34 /// <p>If you did not use a filter in the request, then <code>Count</code> and <code>ScannedCount</code> are the same.</p>
35 pub fn count(&self) -> i32 {
36 self.count
37 }
38 /// <p>The number of items evaluated, before any <code>QueryFilter</code> is applied. A high <code>ScannedCount</code> value with few, or no, <code>Count</code> results indicates an inefficient <code>Query</code> operation. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Count">Count and ScannedCount</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
39 /// <p>If you did not use a filter in the request, then <code>ScannedCount</code> is the same as <code>Count</code>.</p>
40 pub fn scanned_count(&self) -> i32 {
41 self.scanned_count
42 }
43 /// <p>The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.</p>
44 /// <p>If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no more data to be retrieved.</p>
45 /// <p>If <code>LastEvaluatedKey</code> is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when <code>LastEvaluatedKey</code> is empty.</p>
46 pub fn last_evaluated_key(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
47 self.last_evaluated_key.as_ref()
48 }
49 /// <p>The capacity units consumed by the <code>Query</code> operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. <code>ConsumedCapacity</code> is only returned if the <code>ReturnConsumedCapacity</code> parameter was specified. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption">Capacity unit consumption for read operations</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
50 pub fn consumed_capacity(&self) -> ::std::option::Option<&crate::types::ConsumedCapacity> {
51 self.consumed_capacity.as_ref()
52 }
53}
54static QUERYOUTPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.dynamodb.synthetic#QueryOutput", "com.amazonaws.dynamodb.synthetic", "QueryOutput");
55static QUERYOUTPUT_MEMBER_ITEMS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
56 ::aws_smithy_schema::ShapeId::from_static(
57 "com.amazonaws.dynamodb.synthetic#QueryOutput$Items",
58 "com.amazonaws.dynamodb.synthetic",
59 "QueryOutput",
60 ),
61 ::aws_smithy_schema::ShapeType::List,
62 "Items",
63 0,
64 );
65static QUERYOUTPUT_MEMBER_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
66 ::aws_smithy_schema::ShapeId::from_static(
67 "com.amazonaws.dynamodb.synthetic#QueryOutput$Count",
68 "com.amazonaws.dynamodb.synthetic",
69 "QueryOutput",
70 ),
71 ::aws_smithy_schema::ShapeType::Integer,
72 "Count",
73 1,
74 );
75static QUERYOUTPUT_MEMBER_SCANNED_COUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
76 ::aws_smithy_schema::ShapeId::from_static(
77 "com.amazonaws.dynamodb.synthetic#QueryOutput$ScannedCount",
78 "com.amazonaws.dynamodb.synthetic",
79 "QueryOutput",
80 ),
81 ::aws_smithy_schema::ShapeType::Integer,
82 "ScannedCount",
83 2,
84 );
85static QUERYOUTPUT_MEMBER_LAST_EVALUATED_KEY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
86 ::aws_smithy_schema::ShapeId::from_static(
87 "com.amazonaws.dynamodb.synthetic#QueryOutput$LastEvaluatedKey",
88 "com.amazonaws.dynamodb.synthetic",
89 "QueryOutput",
90 ),
91 ::aws_smithy_schema::ShapeType::Map,
92 "LastEvaluatedKey",
93 3,
94 );
95static QUERYOUTPUT_MEMBER_CONSUMED_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
96 ::aws_smithy_schema::ShapeId::from_static(
97 "com.amazonaws.dynamodb.synthetic#QueryOutput$ConsumedCapacity",
98 "com.amazonaws.dynamodb.synthetic",
99 "QueryOutput",
100 ),
101 ::aws_smithy_schema::ShapeType::Structure,
102 "ConsumedCapacity",
103 4,
104 );
105static QUERYOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
106 ::aws_smithy_schema::ShapeId::from_static(
107 "synthetic#request_id",
108 "synthetic",
109 "request_id",
110 ),
111 ::aws_smithy_schema::ShapeType::String,
112 "request_id",
113 5,
114 ).with_http_header("x-amzn-requestid");
115static QUERYOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
116 QUERYOUTPUT_SCHEMA_ID,
117 ::aws_smithy_schema::ShapeType::Structure,
118 &[&QUERYOUTPUT_MEMBER_ITEMS, &QUERYOUTPUT_MEMBER_COUNT, &QUERYOUTPUT_MEMBER_SCANNED_COUNT, &QUERYOUTPUT_MEMBER_LAST_EVALUATED_KEY, &QUERYOUTPUT_MEMBER_CONSUMED_CAPACITY, &QUERYOUTPUT_MEMBER__REQUEST_ID],
119 );
120impl QueryOutput {
121 /// The schema for this shape.
122 pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &QUERYOUTPUT_SCHEMA;
123 }
124impl ::aws_smithy_schema::serde::SerializableStruct for QueryOutput {
125 #[allow(unused_variables, clippy::diverging_sub_expression)]
126 fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
127 if let Some(ref val) = self.items {
128
129 ser.write_list(&QUERYOUTPUT_MEMBER_ITEMS, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
130 for item in val {
131
132 ser.write_map(&::aws_smithy_schema::prelude::DOCUMENT, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
133 for (key, value) in item {
134 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
135 ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
136 }
137 Ok(())
138 })?;
139
140 }
141 Ok(())
142 })?;
143
144 }
145{
146 let val = &self.count;
147 ser.write_integer(&QUERYOUTPUT_MEMBER_COUNT, *val)?;
148 }
149{
150 let val = &self.scanned_count;
151 ser.write_integer(&QUERYOUTPUT_MEMBER_SCANNED_COUNT, *val)?;
152 }
153if let Some(ref val) = self.last_evaluated_key {
154
155 ser.write_map(&QUERYOUTPUT_MEMBER_LAST_EVALUATED_KEY, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
156 for (key, value) in val {
157 ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
158 ser.write_struct(crate::types::AttributeValue::SCHEMA, value)?;
159 }
160 Ok(())
161 })?;
162
163 }
164if let Some(ref val) = self.consumed_capacity {
165 ser.write_struct(&QUERYOUTPUT_MEMBER_CONSUMED_CAPACITY, val)?;
166 }
167 Ok(())
168 }
169 }
170impl QueryOutput {
171 /// Deserializes this structure from a [`ShapeDeserializer`].
172 pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
173 #[allow(unused_variables, unused_mut)]
174 let mut builder = Self::builder();
175 #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
176 deserializer.read_struct(&QUERYOUTPUT_SCHEMA, &mut |member, deser| {
177 match member.member_index() {
178 Some(0) => {
179 builder.items = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push({
180 let mut map = ::std::collections::HashMap::new();
181 deser.read_map(member, &mut |key, deser| {
182 let value = crate::types::AttributeValue::deserialize(deser)?;
183 map.insert(key, value);
184 Ok(())
185 })?;
186 map
187}); Ok(()) })?; container });
188 }
189Some(1) => { builder.count = Some(deser.read_integer(member)?); }
190Some(2) => { builder.scanned_count = Some(deser.read_integer(member)?); }
191Some(3) => {
192 builder.last_evaluated_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 });
193 }
194Some(4) => {
195 builder.consumed_capacity = Some(crate::types::ConsumedCapacity::deserialize(deser)?);
196 }
197Some(5) => {
198 builder._request_id = Some(deser.read_string(member)?);
199 }
200 _ => {}
201 }
202 Ok(())
203 })?;
204 Ok(builder.build())
205 }
206 }
207impl QueryOutput {
208 /// Deserializes this structure from a body deserializer and HTTP response headers.
209 /// Header-bound members are read directly from headers, avoiding runtime
210 /// member iteration overhead. Body members are read via the deserializer.
211 pub fn deserialize_with_response(
212 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
213 headers: &::aws_smithy_runtime_api::http::Headers,
214 _status: u16,
215 _body: &[u8],
216 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
217 #[allow(unused_variables, unused_mut)]
218 let mut builder = Self::builder();
219if let Some(val) = headers.get("x-amzn-requestid") {
220 builder._request_id = Some(val.to_string());
221 }
222#[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
223 deserializer.read_struct(&QUERYOUTPUT_SCHEMA, &mut |member, deser| {
224 match member.member_index() {
225 Some(0) => { builder.items = Some({ let mut container = Vec::new(); deser.read_list(member, &mut |deser| { container.push({
226 let mut map = ::std::collections::HashMap::new();
227 deser.read_map(member, &mut |key, deser| {
228 let value = crate::types::AttributeValue::deserialize(deser)?;
229 map.insert(key, value);
230 Ok(())
231 })?;
232 map
233}); Ok(()) })?; container }); }
234Some(1) => { builder.count = Some(deser.read_integer(member)?); }
235Some(2) => { builder.scanned_count = Some(deser.read_integer(member)?); }
236Some(3) => { builder.last_evaluated_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 }); }
237Some(4) => { builder.consumed_capacity = Some(crate::types::ConsumedCapacity::deserialize(deser)?); }
238 _ => {}
239 }
240 Ok(())
241 })?;
242 Ok(builder.build())
243 }
244 }
245impl ::aws_types::request_id::RequestId for QueryOutput {
246 fn request_id(&self) -> Option<&str> {
247 self._request_id.as_deref()
248 }
249 }
250impl QueryOutput {
251 /// Creates a new builder-style object to manufacture [`QueryOutput`](crate::operation::query::QueryOutput).
252 pub fn builder() -> crate::operation::query::builders::QueryOutputBuilder {
253 crate::operation::query::builders::QueryOutputBuilder::default()
254 }
255}
256
257/// A builder for [`QueryOutput`](crate::operation::query::QueryOutput).
258#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
259#[non_exhaustive]
260pub struct QueryOutputBuilder {
261 pub(crate) items: ::std::option::Option<::std::vec::Vec::<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>>,
262 pub(crate) count: ::std::option::Option<i32>,
263 pub(crate) scanned_count: ::std::option::Option<i32>,
264 pub(crate) last_evaluated_key: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
265 pub(crate) consumed_capacity: ::std::option::Option<crate::types::ConsumedCapacity>,
266 _request_id: Option<String>,
267}
268impl QueryOutputBuilder {
269 /// Appends an item to `items`.
270 ///
271 /// To override the contents of this collection use [`set_items`](Self::set_items).
272 ///
273 /// <p>An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.</p>
274 pub fn items(mut self, input: ::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>) -> Self {
275 let mut v = self.items.unwrap_or_default();
276 v.push(input);
277 self.items = ::std::option::Option::Some(v);
278 self
279 }
280 /// <p>An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.</p>
281 pub fn set_items(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>>) -> Self {
282 self.items = input; self
283 }
284 /// <p>An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.</p>
285 pub fn get_items(&self) -> &::std::option::Option<::std::vec::Vec::<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>> {
286 &self.items
287 }
288 /// <p>The number of items in the response.</p>
289 /// <p>If you used a <code>QueryFilter</code> in the request, then <code>Count</code> is the number of items returned after the filter was applied, and <code>ScannedCount</code> is the number of matching items before the filter was applied.</p>
290 /// <p>If you did not use a filter in the request, then <code>Count</code> and <code>ScannedCount</code> are the same.</p>
291 pub fn count(mut self, input: i32) -> Self {
292 self.count = ::std::option::Option::Some(input);
293 self
294 }
295 /// <p>The number of items in the response.</p>
296 /// <p>If you used a <code>QueryFilter</code> in the request, then <code>Count</code> is the number of items returned after the filter was applied, and <code>ScannedCount</code> is the number of matching items before the filter was applied.</p>
297 /// <p>If you did not use a filter in the request, then <code>Count</code> and <code>ScannedCount</code> are the same.</p>
298 pub fn set_count(mut self, input: ::std::option::Option<i32>) -> Self {
299 self.count = input; self
300 }
301 /// <p>The number of items in the response.</p>
302 /// <p>If you used a <code>QueryFilter</code> in the request, then <code>Count</code> is the number of items returned after the filter was applied, and <code>ScannedCount</code> is the number of matching items before the filter was applied.</p>
303 /// <p>If you did not use a filter in the request, then <code>Count</code> and <code>ScannedCount</code> are the same.</p>
304 pub fn get_count(&self) -> &::std::option::Option<i32> {
305 &self.count
306 }
307 /// <p>The number of items evaluated, before any <code>QueryFilter</code> is applied. A high <code>ScannedCount</code> value with few, or no, <code>Count</code> results indicates an inefficient <code>Query</code> operation. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Count">Count and ScannedCount</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
308 /// <p>If you did not use a filter in the request, then <code>ScannedCount</code> is the same as <code>Count</code>.</p>
309 pub fn scanned_count(mut self, input: i32) -> Self {
310 self.scanned_count = ::std::option::Option::Some(input);
311 self
312 }
313 /// <p>The number of items evaluated, before any <code>QueryFilter</code> is applied. A high <code>ScannedCount</code> value with few, or no, <code>Count</code> results indicates an inefficient <code>Query</code> operation. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Count">Count and ScannedCount</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
314 /// <p>If you did not use a filter in the request, then <code>ScannedCount</code> is the same as <code>Count</code>.</p>
315 pub fn set_scanned_count(mut self, input: ::std::option::Option<i32>) -> Self {
316 self.scanned_count = input; self
317 }
318 /// <p>The number of items evaluated, before any <code>QueryFilter</code> is applied. A high <code>ScannedCount</code> value with few, or no, <code>Count</code> results indicates an inefficient <code>Query</code> operation. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Count">Count and ScannedCount</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
319 /// <p>If you did not use a filter in the request, then <code>ScannedCount</code> is the same as <code>Count</code>.</p>
320 pub fn get_scanned_count(&self) -> &::std::option::Option<i32> {
321 &self.scanned_count
322 }
323 /// Adds a key-value pair to `last_evaluated_key`.
324 ///
325 /// To override the contents of this collection use [`set_last_evaluated_key`](Self::set_last_evaluated_key).
326 ///
327 /// <p>The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.</p>
328 /// <p>If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no more data to be retrieved.</p>
329 /// <p>If <code>LastEvaluatedKey</code> is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when <code>LastEvaluatedKey</code> is empty.</p>
330 pub fn last_evaluated_key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
331 let mut hash_map = self.last_evaluated_key.unwrap_or_default();
332 hash_map.insert(k.into(), v);
333 self.last_evaluated_key = ::std::option::Option::Some(hash_map);
334 self
335 }
336 /// <p>The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.</p>
337 /// <p>If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no more data to be retrieved.</p>
338 /// <p>If <code>LastEvaluatedKey</code> is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when <code>LastEvaluatedKey</code> is empty.</p>
339 pub fn set_last_evaluated_key(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
340 self.last_evaluated_key = input; self
341 }
342 /// <p>The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.</p>
343 /// <p>If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no more data to be retrieved.</p>
344 /// <p>If <code>LastEvaluatedKey</code> is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when <code>LastEvaluatedKey</code> is empty.</p>
345 pub fn get_last_evaluated_key(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
346 &self.last_evaluated_key
347 }
348 /// <p>The capacity units consumed by the <code>Query</code> operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. <code>ConsumedCapacity</code> is only returned if the <code>ReturnConsumedCapacity</code> parameter was specified. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption">Capacity unit consumption for read operations</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
349 pub fn consumed_capacity(mut self, input: crate::types::ConsumedCapacity) -> Self {
350 self.consumed_capacity = ::std::option::Option::Some(input);
351 self
352 }
353 /// <p>The capacity units consumed by the <code>Query</code> operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. <code>ConsumedCapacity</code> is only returned if the <code>ReturnConsumedCapacity</code> parameter was specified. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption">Capacity unit consumption for read operations</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
354 pub fn set_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ConsumedCapacity>) -> Self {
355 self.consumed_capacity = input; self
356 }
357 /// <p>The capacity units consumed by the <code>Query</code> operation. The data returned includes the total provisioned throughput consumed, along with statistics for the table and any indexes involved in the operation. <code>ConsumedCapacity</code> is only returned if the <code>ReturnConsumedCapacity</code> parameter was specified. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption">Capacity unit consumption for read operations</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
358 pub fn get_consumed_capacity(&self) -> &::std::option::Option<crate::types::ConsumedCapacity> {
359 &self.consumed_capacity
360 }
361 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
362 self._request_id = Some(request_id.into());
363 self
364 }
365
366 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
367 self._request_id = request_id;
368 self
369 }
370 /// Consumes the builder and constructs a [`QueryOutput`](crate::operation::query::QueryOutput).
371 pub fn build(self) -> crate::operation::query::QueryOutput {
372 crate::operation::query::QueryOutput {
373 items: self.items
374 ,
375 count: self.count
376 .unwrap_or_default()
377 ,
378 scanned_count: self.scanned_count
379 .unwrap_or_default()
380 ,
381 last_evaluated_key: self.last_evaluated_key
382 ,
383 consumed_capacity: self.consumed_capacity
384 ,
385 _request_id: self._request_id,
386 }
387 }
388}
389