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()
22        .unwrap_or_default()
23    }
24    /// <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>
25    pub fn next_token(&self) -> ::std::option::Option<&str> {
26        self.next_token.as_deref()
27    }
28    /// <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>
29    pub fn consumed_capacity(&self) -> ::std::option::Option<&crate::types::ConsumedCapacity> {
30        self.consumed_capacity.as_ref()
31    }
32    /// <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>
33    pub fn last_evaluated_key(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
34        self.last_evaluated_key.as_ref()
35    }
36}
37impl ::aws_types::request_id::RequestId for ExecuteStatementOutput {
38                                    fn request_id(&self) -> Option<&str> {
39                                        self._request_id.as_deref()
40                                    }
41                                }
42impl ExecuteStatementOutput {
43    /// Creates a new builder-style object to manufacture [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
44    pub fn builder() -> crate::operation::execute_statement::builders::ExecuteStatementOutputBuilder {
45        crate::operation::execute_statement::builders::ExecuteStatementOutputBuilder::default()
46    }
47}
48
49/// A builder for [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct ExecuteStatementOutputBuilder {
53    pub(crate) items: ::std::option::Option<::std::vec::Vec::<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>>,
54    pub(crate) next_token: ::std::option::Option<::std::string::String>,
55    pub(crate) consumed_capacity: ::std::option::Option<crate::types::ConsumedCapacity>,
56    pub(crate) last_evaluated_key: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>,
57    _request_id: Option<String>,
58}
59impl ExecuteStatementOutputBuilder {
60    /// Appends an item to `items`.
61    ///
62    /// To override the contents of this collection use [`set_items`](Self::set_items).
63    ///
64    /// <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>
65    pub fn items(mut self, input: ::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>) -> Self {
66        let mut v = self.items.unwrap_or_default();
67                        v.push(input);
68                        self.items = ::std::option::Option::Some(v);
69                        self
70    }
71    /// <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>
72    pub fn set_items(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>>) -> Self {
73        self.items = input; self
74    }
75    /// <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>
76    pub fn get_items(&self) -> &::std::option::Option<::std::vec::Vec::<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>> {
77        &self.items
78    }
79    /// <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>
80    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.next_token = ::std::option::Option::Some(input.into());
82        self
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 set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.next_token = input; self
87    }
88    /// <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>
89    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
90        &self.next_token
91    }
92    /// <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>
93    pub fn consumed_capacity(mut self, input: crate::types::ConsumedCapacity) -> Self {
94        self.consumed_capacity = ::std::option::Option::Some(input);
95        self
96    }
97    /// <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>
98    pub fn set_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ConsumedCapacity>) -> Self {
99        self.consumed_capacity = input; self
100    }
101    /// <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>
102    pub fn get_consumed_capacity(&self) -> &::std::option::Option<crate::types::ConsumedCapacity> {
103        &self.consumed_capacity
104    }
105    /// Adds a key-value pair to `last_evaluated_key`.
106    ///
107    /// To override the contents of this collection use [`set_last_evaluated_key`](Self::set_last_evaluated_key).
108    ///
109    /// <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>
110    pub fn last_evaluated_key(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
111        let mut hash_map = self.last_evaluated_key.unwrap_or_default();
112                        hash_map.insert(k.into(), v);
113                        self.last_evaluated_key = ::std::option::Option::Some(hash_map);
114                        self
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 set_last_evaluated_key(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>>) -> Self {
118        self.last_evaluated_key = input; self
119    }
120    /// <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>
121    pub fn get_last_evaluated_key(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, crate::types::AttributeValue>> {
122        &self.last_evaluated_key
123    }
124    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
125                                        self._request_id = Some(request_id.into());
126                                        self
127                                    }
128    
129                                    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
130                                        self._request_id = request_id;
131                                        self
132                                    }
133    /// Consumes the builder and constructs a [`ExecuteStatementOutput`](crate::operation::execute_statement::ExecuteStatementOutput).
134    pub fn build(self) -> crate::operation::execute_statement::ExecuteStatementOutput {
135        crate::operation::execute_statement::ExecuteStatementOutput {
136            items: self.items
137            ,
138            next_token: self.next_token
139            ,
140            consumed_capacity: self.consumed_capacity
141            ,
142            last_evaluated_key: self.last_evaluated_key
143            ,
144            _request_id: self._request_id,
145        }
146    }
147}
148