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. Note: retries are enabled by default when using
70 /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
71 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>> {
72 let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
73 let runtime_plugins = crate::operation::execute_statement::ExecuteStatement::operation_runtime_plugins(
74 self.handle.runtime_plugins.clone(),
75 &self.handle.conf,
76 self.config_override,
77 );
78 crate::operation::execute_statement::ExecuteStatement::orchestrate(&runtime_plugins, input).await
79 }
80
81 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
82 pub fn customize(
83 self,
84 ) -> crate::client::customize::CustomizableOperation<crate::operation::execute_statement::ExecuteStatementOutput, crate::operation::execute_statement::ExecuteStatementError, Self> {
85 crate::client::customize::CustomizableOperation::new(self)
86 }
87 pub(crate) fn config_override(
88 mut self,
89 config_override: impl ::std::convert::Into<crate::config::Builder>,
90 ) -> Self {
91 self.set_config_override(::std::option::Option::Some(config_override.into()));
92 self
93 }
94
95 pub(crate) fn set_config_override(
96 &mut self,
97 config_override: ::std::option::Option<crate::config::Builder>,
98 ) -> &mut Self {
99 self.config_override = config_override;
100 self
101 }
102 /// <p>The PartiQL statement representing the operation to run.</p>
103 pub fn statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.inner = self.inner.statement(input.into());
105 self
106 }
107 /// <p>The PartiQL statement representing the operation to run.</p>
108 pub fn set_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.inner = self.inner.set_statement(input);
110 self
111 }
112 /// <p>The PartiQL statement representing the operation to run.</p>
113 pub fn get_statement(&self) -> &::std::option::Option<::std::string::String> {
114 self.inner.get_statement()
115 }
116 ///
117 /// Appends an item to `Parameters`.
118 ///
119 /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
120 ///
121 /// <p>The parameters for the PartiQL statement, if any.</p>
122 pub fn parameters(mut self, input: crate::types::AttributeValue) -> Self {
123 self.inner = self.inner.parameters(input);
124 self
125 }
126 /// <p>The parameters for the PartiQL statement, if any.</p>
127 pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::AttributeValue>>) -> Self {
128 self.inner = self.inner.set_parameters(input);
129 self
130 }
131 /// <p>The parameters for the PartiQL statement, if any.</p>
132 pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::AttributeValue>> {
133 self.inner.get_parameters()
134 }
135 /// <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>
136 pub fn consistent_read(mut self, input: bool) -> Self {
137 self.inner = self.inner.consistent_read(input);
138 self
139 }
140 /// <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>
141 pub fn set_consistent_read(mut self, input: ::std::option::Option<bool>) -> Self {
142 self.inner = self.inner.set_consistent_read(input);
143 self
144 }
145 /// <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>
146 pub fn get_consistent_read(&self) -> &::std::option::Option<bool> {
147 self.inner.get_consistent_read()
148 }
149 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
150 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.inner = self.inner.next_token(input.into());
152 self
153 }
154 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
155 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.inner = self.inner.set_next_token(input);
157 self
158 }
159 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
160 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
161 self.inner.get_next_token()
162 }
163 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
164 /// <ul>
165 /// <li>
166 /// <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>
167 /// <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>
168 /// <li>
169 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
170 /// <li>
171 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
172 /// </ul>
173 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
174 self.inner = self.inner.return_consumed_capacity(input);
175 self
176 }
177 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
178 /// <ul>
179 /// <li>
180 /// <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>
181 /// <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>
182 /// <li>
183 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
184 /// <li>
185 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
186 /// </ul>
187 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
188 self.inner = self.inner.set_return_consumed_capacity(input);
189 self
190 }
191 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response:</p>
192 /// <ul>
193 /// <li>
194 /// <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>
195 /// <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>
196 /// <li>
197 /// <p><code>TOTAL</code> - The response includes only the aggregate <code>ConsumedCapacity</code> for the operation.</p></li>
198 /// <li>
199 /// <p><code>NONE</code> - No <code>ConsumedCapacity</code> details are included in the response.</p></li>
200 /// </ul>
201 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
202 self.inner.get_return_consumed_capacity()
203 }
204 /// <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>
205 pub fn limit(mut self, input: i32) -> Self {
206 self.inner = self.inner.limit(input);
207 self
208 }
209 /// <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>
210 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
211 self.inner = self.inner.set_limit(input);
212 self
213 }
214 /// <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>
215 pub fn get_limit(&self) -> &::std::option::Option<i32> {
216 self.inner.get_limit()
217 }
218 /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
219 /// <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>
220 pub fn return_values_on_condition_check_failure(mut self, input: crate::types::ReturnValuesOnConditionCheckFailure) -> Self {
221 self.inner = self.inner.return_values_on_condition_check_failure(input);
222 self
223 }
224 /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
225 /// <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>
226 pub fn set_return_values_on_condition_check_failure(mut self, input: ::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure>) -> Self {
227 self.inner = self.inner.set_return_values_on_condition_check_failure(input);
228 self
229 }
230 /// <p>An optional parameter that returns the item attributes for an <code>ExecuteStatement</code> operation that failed a condition check.</p>
231 /// <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>
232 pub fn get_return_values_on_condition_check_failure(&self) -> &::std::option::Option<crate::types::ReturnValuesOnConditionCheckFailure> {
233 self.inner.get_return_values_on_condition_check_failure()
234 }
235}
236