aws_sdk_dynamodb/operation/execute_statement/_execute_statement_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ExecuteStatementOutput {
6 /// <p>If a read operation was used, this property will contain the result of the read operation; a map of attribute names and their values. For the write operations this value will be empty.</p>
7 pub items: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>>,
8 /// <p>If the response of a read request exceeds the response payload limit DynamoDB will set this value in the response. If set, you can use that this value in the subsequent request to get the remaining results.</p>
9 pub next_token: ::std::option::Option<::std::string::String>,
10 /// <p>The capacity units consumed by an 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 request asked for it. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
11 pub consumed_capacity: ::std::option::Option<crate::types::ConsumedCapacity>,
12 /// <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. If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no more data to be retrieved. 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>
13 pub last_evaluated_key: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
14 _request_id: Option<String>,
15}
16impl ExecuteStatementOutput {
17 /// <p>If a read operation was used, this property will contain the result of the read operation; a map of attribute names and their values. For the write operations this value will be empty.</p>
18 ///
19 /// 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()`.
20 pub fn items(&self) -> &[::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>] {
21 self.items.as_deref().unwrap_or_default()
22 }
23 /// <p>If the response of a read request exceeds the response payload limit DynamoDB will set this value in the response. If set, you can use that this value in the subsequent request to get the remaining results.</p>
24 pub fn next_token(&self) -> ::std::option::Option<&str> {
25 self.next_token.as_deref()
26 }
27 /// <p>The capacity units consumed by an 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 request asked for it. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
28 pub fn consumed_capacity(&self) -> ::std::option::Option<&crate::types::ConsumedCapacity> {
29 self.consumed_capacity.as_ref()
30 }
31 /// <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. If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no more data to be retrieved. 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>
32 pub fn last_evaluated_key(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
33 self.last_evaluated_key.as_ref()
34 }
35}
36impl ::aws_types::request_id::RequestId for ExecuteStatementOutput {
37 fn request_id(&self) -> Option<&str> {
38 self._request_id.as_deref()
39 }
40}
41impl ExecuteStatementOutput {
42 /// Creates a new builder-style object to manufacture [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
43 pub fn builder() -> crate::operation::execute_statement::builders::ExecuteStatementOutputBuilder {
44 crate::operation::execute_statement::builders::ExecuteStatementOutputBuilder::default()
45 }
46}
47
48/// A builder for [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct ExecuteStatementOutputBuilder {
52 pub(crate) items: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>>,
53 pub(crate) next_token: ::std::option::Option<::std::string::String>,
54 pub(crate) consumed_capacity: ::std::option::Option<crate::types::ConsumedCapacity>,
55 pub(crate) last_evaluated_key: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
56 _request_id: Option<String>,
57}
58impl ExecuteStatementOutputBuilder {
59 /// Appends an item to `items`.
60 ///
61 /// To override the contents of this collection use [`set_items`](Self::set_items).
62 ///
63 /// <p>If a read operation was used, this property will contain the result of the read operation; a map of attribute names and their values. For the write operations this value will be empty.</p>
64 pub fn items(mut self, input: ::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>) -> Self {
65 let mut v = self.items.unwrap_or_default();
66 v.push(input);
67 self.items = ::std::option::Option::Some(v);
68 self
69 }
70 /// <p>If a read operation was used, this property will contain the result of the read operation; a map of attribute names and their values. For the write operations this value will be empty.</p>
71 pub fn set_items(
72 mut self,
73 input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>>,
74 ) -> Self {
75 self.items = input;
76 self
77 }
78 /// <p>If a read operation was used, this property will contain the result of the read operation; a map of attribute names and their values. For the write operations this value will be empty.</p>
79 pub fn get_items(
80 &self,
81 ) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>> {
82 &self.items
83 }
84 /// <p>If the response of a read request exceeds the response payload limit DynamoDB will set this value in the response. If set, you can use that this value in the subsequent request to get the remaining results.</p>
85 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86 self.next_token = ::std::option::Option::Some(input.into());
87 self
88 }
89 /// <p>If the response of a read request exceeds the response payload limit DynamoDB will set this value in the response. If set, you can use that this value in the subsequent request to get the remaining results.</p>
90 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91 self.next_token = input;
92 self
93 }
94 /// <p>If the response of a read request exceeds the response payload limit DynamoDB will set this value in the response. If set, you can use that this value in the subsequent request to get the remaining results.</p>
95 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
96 &self.next_token
97 }
98 /// <p>The capacity units consumed by an 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 request asked for it. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
99 pub fn consumed_capacity(mut self, input: crate::types::ConsumedCapacity) -> Self {
100 self.consumed_capacity = ::std::option::Option::Some(input);
101 self
102 }
103 /// <p>The capacity units consumed by an 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 request asked for it. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
104 pub fn set_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ConsumedCapacity>) -> Self {
105 self.consumed_capacity = input;
106 self
107 }
108 /// <p>The capacity units consumed by an 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 request asked for it. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a> in the <i>Amazon DynamoDB Developer Guide</i>.</p>
109 pub fn get_consumed_capacity(&self) -> &::std::option::Option<crate::types::ConsumedCapacity> {
110 &self.consumed_capacity
111 }
112 /// Adds a key-value pair to `last_evaluated_key`.
113 ///
114 /// To override the contents of this collection use [`set_last_evaluated_key`](Self::set_last_evaluated_key).
115 ///
116 /// <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. If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no more data to be retrieved. 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>
117 pub fn last_evaluated_key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
118 let mut hash_map = self.last_evaluated_key.unwrap_or_default();
119 hash_map.insert(k.into(), v);
120 self.last_evaluated_key = ::std::option::Option::Some(hash_map);
121 self
122 }
123 /// <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. If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no more data to be retrieved. 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>
124 pub fn set_last_evaluated_key(
125 mut self,
126 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
127 ) -> Self {
128 self.last_evaluated_key = input;
129 self
130 }
131 /// <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. If <code>LastEvaluatedKey</code> is empty, then the "last page" of results has been processed and there is no more data to be retrieved. 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>
132 pub fn get_last_evaluated_key(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
133 &self.last_evaluated_key
134 }
135 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
136 self._request_id = Some(request_id.into());
137 self
138 }
139
140 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
141 self._request_id = request_id;
142 self
143 }
144 /// Consumes the builder and constructs a [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
145 pub fn build(self) -> crate::operation::execute_statement::ExecuteStatementOutput {
146 crate::operation::execute_statement::ExecuteStatementOutput {
147 items: self.items,
148 next_token: self.next_token,
149 consumed_capacity: self.consumed_capacity,
150 last_evaluated_key: self.last_evaluated_key,
151 _request_id: self._request_id,
152 }
153 }
154}