aws_sdk_dynamodb/operation/execute_transaction/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::execute_transaction::_execute_transaction_output::ExecuteTransactionOutputBuilder;
3
4pub use crate::operation::execute_transaction::_execute_transaction_input::ExecuteTransactionInputBuilder;
5
6impl crate::operation::execute_transaction::builders::ExecuteTransactionInputBuilder {
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_transaction::ExecuteTransactionOutput,
10 ::aws_smithy_runtime_api::client::result::SdkError<
11 crate::operation::execute_transaction::ExecuteTransactionError,
12 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13 >
14 > {
15 let mut fluent_builder = client.execute_transaction();
16 fluent_builder.inner = self;
17 fluent_builder.send().await
18 }
19 }
20/// Fluent builder constructing a request to `ExecuteTransaction`.
21///
22/// <p>This operation allows you to perform transactional reads or writes on data stored in DynamoDB, using PartiQL.</p><note>
23/// <p>The entire transaction must consist of either read statements or write statements, you cannot mix both in one transaction. The EXISTS function is an exception and can be used to check the condition of specific attributes of the item in a similar manner to <code>ConditionCheck</code> in the <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/transaction-apis.html#transaction-apis-txwriteitems">TransactWriteItems</a> API.</p>
24/// </note>
25#[derive(::std::clone::Clone, ::std::fmt::Debug)]
26pub struct ExecuteTransactionFluentBuilder {
27 handle: ::std::sync::Arc<crate::client::Handle>,
28 inner: crate::operation::execute_transaction::builders::ExecuteTransactionInputBuilder,
29config_override: ::std::option::Option<crate::config::Builder>,
30 }
31impl
32 crate::client::customize::internal::CustomizableSend<
33 crate::operation::execute_transaction::ExecuteTransactionOutput,
34 crate::operation::execute_transaction::ExecuteTransactionError,
35 > for ExecuteTransactionFluentBuilder
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_transaction::ExecuteTransactionOutput,
43 crate::operation::execute_transaction::ExecuteTransactionError,
44 >,
45 > {
46 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
47 }
48 }
49impl ExecuteTransactionFluentBuilder {
50 /// Creates a new `ExecuteTransactionFluentBuilder`.
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 ExecuteTransaction as a reference.
59 pub fn as_input(&self) -> &crate::operation::execute_transaction::builders::ExecuteTransactionInputBuilder {
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_transaction::ExecuteTransactionOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::execute_transaction::ExecuteTransactionError, ::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_transaction::ExecuteTransaction::operation_runtime_plugins(
74 self.handle.runtime_plugins.clone(),
75 &self.handle.conf,
76 self.config_override,
77 );
78 crate::operation::execute_transaction::ExecuteTransaction::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_transaction::ExecuteTransactionOutput, crate::operation::execute_transaction::ExecuteTransactionError, 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 ///
103 /// Appends an item to `TransactStatements`.
104 ///
105 /// To override the contents of this collection use [`set_transact_statements`](Self::set_transact_statements).
106 ///
107 /// <p>The list of PartiQL statements representing the transaction to run.</p>
108 pub fn transact_statements(mut self, input: crate::types::ParameterizedStatement) -> Self {
109 self.inner = self.inner.transact_statements(input);
110 self
111 }
112 /// <p>The list of PartiQL statements representing the transaction to run.</p>
113 pub fn set_transact_statements(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::ParameterizedStatement>>) -> Self {
114 self.inner = self.inner.set_transact_statements(input);
115 self
116 }
117 /// <p>The list of PartiQL statements representing the transaction to run.</p>
118 pub fn get_transact_statements(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::ParameterizedStatement>> {
119 self.inner.get_transact_statements()
120 }
121 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
122 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.inner = self.inner.client_request_token(input.into());
124 self
125 }
126 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
127 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.inner = self.inner.set_client_request_token(input);
129 self
130 }
131 /// <p>Set this value to get remaining results, if <code>NextToken</code> was returned in the statement response.</p>
132 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
133 self.inner.get_client_request_token()
134 }
135 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html">TransactGetItems</a> and <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html">TransactWriteItems</a>.</p>
136 pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
137 self.inner = self.inner.return_consumed_capacity(input);
138 self
139 }
140 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html">TransactGetItems</a> and <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html">TransactWriteItems</a>.</p>
141 pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
142 self.inner = self.inner.set_return_consumed_capacity(input);
143 self
144 }
145 /// <p>Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html">TransactGetItems</a> and <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html">TransactWriteItems</a>.</p>
146 pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
147 self.inner.get_return_consumed_capacity()
148 }
149}
150