aws_sdk_dynamodb/operation/execute_statement/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::execute_statement::_execute_statement_output::ExecuteStatementOutputBuilder;
3
4pub use crate::operation::execute_statement::_execute_statement_input::ExecuteStatementInputBuilder;
5
6impl crate::operation::execute_statement::builders::ExecuteStatementInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result<
9 crate::operation::execute_statement::ExecuteStatementOutput,
10 ::aws_smithy_runtime_api::client::result::SdkError<
11 crate::operation::execute_statement::ExecuteStatementError,
12 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13 >
14 > {
15 let mut fluent_builder = client.execute_statement();
16 fluent_builder.inner = self;
17 fluent_builder.send().await
18 }
19 }
20/// Fluent builder constructing a request to `ExecuteStatement`.
21///
22/// <p>This operation allows you to perform reads and singleton writes on data stored in DynamoDB, using PartiQL.</p>
23/// <p>For PartiQL reads (<code>SELECT</code> statement), if the total number of processed items exceeds the maximum dataset size limit of 1 MB, the read stops and results are returned to the user as a <code>LastEvaluatedKey</code> value to continue the read in a subsequent operation. If the filter criteria in <code>WHERE</code> clause does not match any data, the read will return an empty result set.</p>
24/// <p>A single <code>SELECT</code> statement response can return up to the maximum number of items (if using the Limit parameter) or a maximum of 1 MB of data (and then apply any filtering to the results using <code>WHERE</code> clause). If <code>LastEvaluatedKey</code> is present in the response, you need to paginate the result set. If <code>NextToken</code> is present, you need to paginate the result set and include <code>NextToken</code>.</p>
25#[derive(::std::clone::Clone, ::std::fmt::Debug)]
26pub struct ExecuteStatementFluentBuilder {
27 handle: ::std::sync::Arc<crate::client::Handle>,
28 inner: crate::operation::execute_statement::builders::ExecuteStatementInputBuilder,
29config_override: ::std::option::Option<crate::config::Builder>,
30 }
31impl
32 crate::client::customize::internal::CustomizableSend<
33 crate::operation::execute_statement::ExecuteStatementOutput,
34 crate::operation::execute_statement::ExecuteStatementError,
35 > for ExecuteStatementFluentBuilder
36 {
37 fn send(
38 self,
39 config_override: crate::config::Builder,
40 ) -> crate::client::customize::internal::BoxFuture<
41 crate::client::customize::internal::SendResult<
42 crate::operation::execute_statement::ExecuteStatementOutput,
43 crate::operation::execute_statement::ExecuteStatementError,
44 >,
45 > {
46 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
47 }
48 }
49impl ExecuteStatementFluentBuilder {
50 /// Creates a new `ExecuteStatementFluentBuilder`.
51 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
52 Self {
53 handle,
54 inner: ::std::default::Default::default(),
55 config_override: ::std::option::Option::None,
56 }
57 }
58 /// Access the ExecuteStatement as a reference.
59 pub fn as_input(&self) -> &crate::operation::execute_statement::builders::ExecuteStatementInputBuilder {
60 &self.inner
61 }
62 /// Sends the request and returns the response.
63 ///
64 /// If an error occurs, an `SdkError` will be returned with additional details that
65 /// can be matched against.
66 ///
67 /// By default, any retryable failures will be retried twice. Retry behavior
68 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
69 /// set when configuring the client.
70 pub async fn send(self) -> ::std::result::Result<crate::operation::execute_statement::ExecuteStatementOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::execute_statement::ExecuteStatementError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
71 let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
72 let runtime_plugins = crate::operation::execute_statement::ExecuteStatement::operation_runtime_plugins(
73 self.handle.runtime_plugins.clone(),
74 &self.handle.conf,
75 self.config_override,
76 );
77 crate::operation::execute_statement::ExecuteStatement::orchestrate(&runtime_plugins, input).await
78 }
79
80 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
81 pub fn customize(
82 self,
83 ) -> crate::client::customize::CustomizableOperation<crate::operation::execute_statement::ExecuteStatementOutput, crate::operation::execute_statement::ExecuteStatementError, Self> {
84 crate::client::customize::CustomizableOperation::new(self)
85 }
86 pub(crate) fn config_override(
87 mut self,
88 config_override: impl ::std::convert::Into<crate::config::Builder>,
89 ) -> Self {
90 self.set_config_override(::std::option::Option::Some(config_override.into()));
91 self
92 }
93
94 pub(crate) fn set_config_override(
95 &mut self,
96 config_override: ::std::option::Option<crate::config::Builder>,
97 ) -> &mut Self {
98 self.config_override = config_override;
99 self
100 }
101 /// <p>The PartiQL statement representing the operation to run.</p>
102 pub fn statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.inner = self.inner.statement(input.into());
104 self
105 }
106 /// <p>The PartiQL statement representing the operation to run.</p>
107 pub fn set_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.inner = self.inner.set_statement(input);
109 self
110 }
111 /// <p>The PartiQL statement representing the operation to run.</p>
112 pub fn get_statement(&self) -> &::std::option::Option<::std::string::String> {
113 self.inner.get_statement()
114 }
115 ///
116 /// Appends an item to `Parameters`.
117 ///
118 /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
119 ///
120 /// <p>The parameters for the PartiQL statement, if any.</p>
121 pub fn parameters(mut self, input: crate::types::AttributeValue) -> Self {
122 self.inner = self.inner.parameters(input);
123 self
124 }
125 /// <p>The parameters for the PartiQL statement, if any.</p>
126 pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::AttributeValue>>) -> Self {
127 self.inner = self.inner.set_parameters(input);
128 self
129 }
130 /// <p>The parameters for the PartiQL statement, if any.</p>
131 pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::AttributeValue>> {
132 self.inner.get_parameters()
133 }
134 /// <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>
135 pub fn consistent_read(mut self, input: bool) -> Self {
136 self.inner = self.inner.consistent_read(input);
137 self
138 }
139 /// <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>
140 pub fn set_consistent_read(mut self, input: ::std::option::Option<bool>) -> Self {
141 self.inner = self.inner.set_consistent_read(input);
142 self
143 }
144 /// <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>
145 pub fn get_consistent_read(&self) -> &::std::option::Option<bool> {
146 self.inner.get_consistent_read()
147 }
148 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
149 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150 self.inner = self.inner.next_token(input.into());
151 self
152 }
153 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
154 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155 self.inner = self.inner.set_next_token(input);
156 self
157 }
158 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
159 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
160 self.inner.get_next_token()
161 }
162 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
163 /// <ul>
164 /// <li>
165 /// <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>
166 /// <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>
167 /// <li>
168 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
169 /// <li>
170 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
171 /// </ul>
172 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
173 self.inner = self.inner.return_consumed_capacity(input);
174 self
175 }
176 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
177 /// <ul>
178 /// <li>
179 /// <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>
180 /// <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>
181 /// <li>
182 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
183 /// <li>
184 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
185 /// </ul>
186 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
187 self.inner = self.inner.set_return_consumed_capacity(input);
188 self
189 }
190 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
191 /// <ul>
192 /// <li>
193 /// <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>
194 /// <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>
195 /// <li>
196 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
197 /// <li>
198 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
199 /// </ul>
200 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
201 self.inner.get_return_consumed_capacity()
202 }
203 /// <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>
204 pub fn limit(mut self, input: i32) -> Self {
205 self.inner = self.inner.limit(input);
206 self
207 }
208 /// <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>
209 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
210 self.inner = self.inner.set_limit(input);
211 self
212 }
213 /// <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>
214 pub fn get_limit(&self) -> &::std::option::Option<i32> {
215 self.inner.get_limit()
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 return_values_on_condition_check_failure(mut self, input: crate::types::ReturnValuesOnConditionCheckFailure) -> Self {
220 self.inner = self.inner.return_values_on_condition_check_failure(input);
221 self
222 }
223 /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
224 /// <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>
225 pub fn set_return_values_on_condition_check_failure(mut self, input: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>) -> Self {
226 self.inner = self.inner.set_return_values_on_condition_check_failure(input);
227 self
228 }
229 /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
230 /// <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>
231 pub fn get_return_values_on_condition_check_failure(&self) -> &::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure> {
232 self.inner.get_return_values_on_condition_check_failure()
233 }
234}
235