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()
41 .unwrap_or_default()
42 }
43 /// <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>
44 pub fn consistent_read(&self) -> ::std::option::Option<bool> {
45 self.consistent_read
46 }
47 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
48 pub fn next_token(&self) -> ::std::option::Option<&str> {
49 self.next_token.as_deref()
50 }
51 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
52 /// <ul>
53 /// <li>
54 /// <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>
55 /// <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>
56 /// <li>
57 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
58 /// <li>
59 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
60 /// </ul>
61 pub fn return_consumed_capacity(&self) -> ::std::option::Option<&crate::types::ReturnConsumedCapacity> {
62 self.return_consumed_capacity.as_ref()
63 }
64 /// <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>
65 pub fn limit(&self) -> ::std::option::Option<i32> {
66 self.limit
67 }
68 /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
69 /// <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>
70 pub fn return_values_on_condition_check_failure(&self) -> ::std::option::Option<&crate::types::ReturnValuesOnConditionCheckFailure> {
71 self.return_values_on_condition_check_failure.as_ref()
72 }
73}
74impl ExecuteStatementInput {
75 /// Creates a new builder-style object to manufacture [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
76 pub fn builder() -> crate::operation::execute_statement::builders::ExecuteStatementInputBuilder {
77 crate::operation::execute_statement::builders::ExecuteStatementInputBuilder::default()
78 }
79}
80
81/// A builder for [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
82#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
83#[non_exhaustive]
84pub struct ExecuteStatementInputBuilder {
85 pub(crate) statement: ::std::option::Option<::std::string::String>,
86 pub(crate) parameters: ::std::option::Option<::std::vec::Vec::<crate::types::AttributeValue>>,
87 pub(crate) consistent_read: ::std::option::Option<bool>,
88 pub(crate) next_token: ::std::option::Option<::std::string::String>,
89 pub(crate) return_consumed_capacity: ::std::option::Option<crate::types::ReturnConsumedCapacity>,
90 pub(crate) limit: ::std::option::Option<i32>,
91 pub(crate) return_values_on_condition_check_failure: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>,
92}
93impl ExecuteStatementInputBuilder {
94 /// <p>The PartiQL statement representing the operation to run.</p>
95 /// This field is required.
96 pub fn statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.statement = ::std::option::Option::Some(input.into());
98 self
99 }
100 /// <p>The PartiQL statement representing the operation to run.</p>
101 pub fn set_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102 self.statement = input; 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; self
122 }
123 /// <p>The parameters for the PartiQL statement, if any.</p>
124 pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::AttributeValue>> {
125 &self.parameters
126 }
127 /// <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>
128 pub fn consistent_read(mut self, input: bool) -> Self {
129 self.consistent_read = ::std::option::Option::Some(input);
130 self
131 }
132 /// <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>
133 pub fn set_consistent_read(mut self, input: ::std::option::Option<bool>) -> Self {
134 self.consistent_read = input; self
135 }
136 /// <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>
137 pub fn get_consistent_read(&self) -> &::std::option::Option<bool> {
138 &self.consistent_read
139 }
140 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
141 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.next_token = ::std::option::Option::Some(input.into());
143 self
144 }
145 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
146 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.next_token = input; self
148 }
149 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
150 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
151 &self.next_token
152 }
153 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
154 /// <ul>
155 /// <li>
156 /// <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>
157 /// <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>
158 /// <li>
159 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
160 /// <li>
161 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
162 /// </ul>
163 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
164 self.return_consumed_capacity = ::std::option::Option::Some(input);
165 self
166 }
167 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
168 /// <ul>
169 /// <li>
170 /// <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>
171 /// <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>
172 /// <li>
173 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
174 /// <li>
175 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
176 /// </ul>
177 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
178 self.return_consumed_capacity = input; self
179 }
180 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
181 /// <ul>
182 /// <li>
183 /// <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>
184 /// <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>
185 /// <li>
186 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
187 /// <li>
188 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
189 /// </ul>
190 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
191 &self.return_consumed_capacity
192 }
193 /// <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>
194 pub fn limit(mut self, input: i32) -> Self {
195 self.limit = ::std::option::Option::Some(input);
196 self
197 }
198 /// <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>
199 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
200 self.limit = input; 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 get_limit(&self) -> &::std::option::Option<i32> {
204 &self.limit
205 }
206 /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
207 /// <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>
208 pub fn return_values_on_condition_check_failure(mut self, input: crate::types::ReturnValuesOnConditionCheckFailure) -> Self {
209 self.return_values_on_condition_check_failure = ::std::option::Option::Some(input);
210 self
211 }
212 /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
213 /// <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>
214 pub fn set_return_values_on_condition_check_failure(mut self, input: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>) -> Self {
215 self.return_values_on_condition_check_failure = input; 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 get_return_values_on_condition_check_failure(&self) -> &::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure> {
220 &self.return_values_on_condition_check_failure
221 }
222 /// Consumes the builder and constructs a [`ExecuteStatementInput`](crate::operation::execute_statement::ExecuteStatementInput).
223 pub fn build(self) -> ::std::result::Result<crate::operation::execute_statement::ExecuteStatementInput, ::aws_smithy_types::error::operation::BuildError> {
224 ::std::result::Result::Ok(
225 crate::operation::execute_statement::ExecuteStatementInput {
226 statement: self.statement
227 ,
228 parameters: self.parameters
229 ,
230 consistent_read: self.consistent_read
231 ,
232 next_token: self.next_token
233 ,
234 return_consumed_capacity: self.return_consumed_capacity
235 ,
236 limit: self.limit
237 ,
238 return_values_on_condition_check_failure: self.return_values_on_condition_check_failure
239 ,
240 }
241 )
242 }
243}
244