aws_sdk_dynamodb/operation/execute_statement/
_execute_statement_input.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 ExecuteStatementInput {
6    /// <p>The PartiQL statement representing the operation to run.</p>
7    pub statement: ::std::option::Option<::std::string::String>,
8    /// <p>The parameters for the PartiQL statement, if any.</p>
9    pub parameters: ::std::option::Option<::std::vec::Vec<crate::types::AttributeValue>>,
10    /// <p>The consistency of a read operation. If set to <code>true</code>, then a strongly consistent read is used; otherwise, an eventually consistent read is used.</p>
11    pub consistent_read: ::std::option::Option<bool>,
12    /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
15    /// <ul>
16    /// <li>
17    /// <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>
18    /// <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>
19    /// <li>
20    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
21    /// <li>
22    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
23    /// </ul>
24    pub return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
25    /// <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, along with a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation so 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.</p>
26    pub limit: ::std::option::Option<i32>,
27    /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
28    /// <p>There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.</p>
29    pub return_values_on_condition_check_failure: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
30}
31impl ExecuteStatementInput {
32    /// <p>The PartiQL statement representing the operation to run.</p>
33    pub fn statement(&self) -> ::std::option::Option<&str> {
34        self.statement.as_deref()
35    }
36    /// <p>The parameters for the PartiQL statement, if any.</p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.parameters.is_none()`.
39    pub fn parameters(&self) -> &[crate::types::AttributeValue] {
40        self.parameters.as_deref().unwrap_or_default()
41    }
42    /// <p>The consistency of a read operation. If set to <code>true</code>, then a strongly consistent read is used; otherwise, an eventually consistent read is used.</p>
43    pub fn consistent_read(&self) -> ::std::option::Option<bool> {
44        self.consistent_read
45    }
46    /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
47    pub fn next_token(&self) -> ::std::option::Option<&str> {
48        self.next_token.as_deref()
49    }
50    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
51    /// <ul>
52    /// <li>
53    /// <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>
54    /// <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>
55    /// <li>
56    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
57    /// <li>
58    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
59    /// </ul>
60    pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
61        self.return_consumed_capacity.as_ref()
62    }
63    /// <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, along with a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation so 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.</p>
64    pub fn limit(&self) -> ::std::option::Option<i32> {
65        self.limit
66    }
67    /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
68    /// <p>There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.</p>
69    pub fn return_values_on_condition_check_failure(&self) -> ::std::option::Option<&crate::types::ReturnValuesOnConditionCheckFailure> {
70        self.return_values_on_condition_check_failure.as_ref()
71    }
72}
73impl ExecuteStatementInput {
74    /// Creates a new builder-style object to manufacture [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
75    pub fn builder() -> crate::operation::execute_statement::builders::ExecuteStatementInputBuilder {
76        crate::operation::execute_statement::builders::ExecuteStatementInputBuilder::default()
77    }
78}
79
80/// A builder for [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
81#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
82#[non_exhaustive]
83pub struct ExecuteStatementInputBuilder {
84    pub(crate) statement: ::std::option::Option<::std::string::String>,
85    pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::AttributeValue>>,
86    pub(crate) consistent_read: ::std::option::Option<bool>,
87    pub(crate) next_token: ::std::option::Option<::std::string::String>,
88    pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
89    pub(crate) limit: ::std::option::Option<i32>,
90    pub(crate) return_values_on_condition_check_failure: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
91}
92impl ExecuteStatementInputBuilder {
93    /// <p>The PartiQL statement representing the operation to run.</p>
94    /// This field is required.
95    pub fn statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.statement = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The PartiQL statement representing the operation to run.</p>
100    pub fn set_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.statement = input;
102        self
103    }
104    /// <p>The PartiQL statement representing the operation to run.</p>
105    pub fn get_statement(&self) -> &::std::option::Option<::std::string::String> {
106        &self.statement
107    }
108    /// Appends an item to `parameters`.
109    ///
110    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
111    ///
112    /// <p>The parameters for the PartiQL statement, if any.</p>
113    pub fn parameters(mut self, input: crate::types::AttributeValue) -> Self {
114        let mut v = self.parameters.unwrap_or_default();
115        v.push(input);
116        self.parameters = ::std::option::Option::Some(v);
117        self
118    }
119    /// <p>The parameters for the PartiQL statement, if any.</p>
120    pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttributeValue>>) -> Self {
121        self.parameters = input;
122        self
123    }
124    /// <p>The parameters for the PartiQL statement, if any.</p>
125    pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttributeValue>> {
126        &self.parameters
127    }
128    /// <p>The consistency of a read operation. If set to <code>true</code>, then a strongly consistent read is used; otherwise, an eventually consistent read is used.</p>
129    pub fn consistent_read(mut self, input: bool) -> Self {
130        self.consistent_read = ::std::option::Option::Some(input);
131        self
132    }
133    /// <p>The consistency of a read operation. If set to <code>true</code>, then a strongly consistent read is used; otherwise, an eventually consistent read is used.</p>
134    pub fn set_consistent_read(mut self, input: ::std::option::Option<bool>) -> Self {
135        self.consistent_read = input;
136        self
137    }
138    /// <p>The consistency of a read operation. If set to <code>true</code>, then a strongly consistent read is used; otherwise, an eventually consistent read is used.</p>
139    pub fn get_consistent_read(&self) -> &::std::option::Option<bool> {
140        &self.consistent_read
141    }
142    /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
143    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.next_token = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
148    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.next_token = input;
150        self
151    }
152    /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
153    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
154        &self.next_token
155    }
156    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
157    /// <ul>
158    /// <li>
159    /// <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>
160    /// <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>
161    /// <li>
162    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
163    /// <li>
164    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
165    /// </ul>
166    pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
167        self.return_consumed_capacity = ::std::option::Option::Some(input);
168        self
169    }
170    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
171    /// <ul>
172    /// <li>
173    /// <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>
174    /// <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>
175    /// <li>
176    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
177    /// <li>
178    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
179    /// </ul>
180    pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
181        self.return_consumed_capacity = input;
182        self
183    }
184    /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
185    /// <ul>
186    /// <li>
187    /// <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>
188    /// <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>
189    /// <li>
190    /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
191    /// <li>
192    /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
193    /// </ul>
194    pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
195        &self.return_consumed_capacity
196    }
197    /// <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, along with a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation so 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.</p>
198    pub fn limit(mut self, input: i32) -> Self {
199        self.limit = ::std::option::Option::Some(input);
200        self
201    }
202    /// <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, along with a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation so 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.</p>
203    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
204        self.limit = input;
205        self
206    }
207    /// <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, along with a key in <code>LastEvaluatedKey</code> to apply in a subsequent operation so 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.</p>
208    pub fn get_limit(&self) -> &::std::option::Option<i32> {
209        &self.limit
210    }
211    /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
212    /// <p>There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.</p>
213    pub fn return_values_on_condition_check_failure(mut self, input: crate::types::ReturnValuesOnConditionCheckFailure) -> Self {
214        self.return_values_on_condition_check_failure = ::std::option::Option::Some(input);
215        self
216    }
217    /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
218    /// <p>There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.</p>
219    pub fn set_return_values_on_condition_check_failure(
220        mut self,
221        input: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
222    ) -> Self {
223        self.return_values_on_condition_check_failure = input;
224        self
225    }
226    /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
227    /// <p>There is no additional cost associated with requesting a return value aside from the small network and processing overhead of receiving a larger response. No read capacity units are consumed.</p>
228    pub fn get_return_values_on_condition_check_failure(&self) -> &::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure> {
229        &self.return_values_on_condition_check_failure
230    }
231    /// Consumes the builder and constructs a [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
232    pub fn build(
233        self,
234    ) -> ::std::result::Result<crate::operation::execute_statement::ExecuteStatementInput, ::aws_smithy_types::error::operation::BuildError> {
235        ::std::result::Result::Ok(crate::operation::execute_statement::ExecuteStatementInput {
236            statement: self.statement,
237            parameters: self.parameters,
238            consistent_read: self.consistent_read,
239            next_token: self.next_token,
240            return_consumed_capacity: self.return_consumed_capacity,
241            limit: self.limit,
242            return_values_on_condition_check_failure: self.return_values_on_condition_check_failure,
243        })
244    }
245}