aws_sdk_dynamodb/operation/transact_get_items/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::transact_get_items::_transact_get_items_output::TransactGetItemsOutputBuilder;
3
4pub use crate::operation::transact_get_items::_transact_get_items_input::TransactGetItemsInputBuilder;
5
6impl crate::operation::transact_get_items::builders::TransactGetItemsInputBuilder {
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::transact_get_items::TransactGetItemsOutput,
10                        ::aws_smithy_runtime_api::client::result::SdkError<
11                            crate::operation::transact_get_items::TransactGetItemsError,
12                            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13                        >
14                    > {
15                        let mut fluent_builder = client.transact_get_items();
16                        fluent_builder.inner = self;
17                        fluent_builder.send().await
18                    }
19                }
20/// Fluent builder constructing a request to `TransactGetItems`.
21/// 
22/// <p><code>TransactGetItems</code> is a synchronous operation that atomically retrieves multiple items from one or more tables (but not from indexes) in a single account and Region. A <code>TransactGetItems</code> call can contain up to 100 <code>TransactGetItem</code> objects, each of which contains a <code>Get</code> structure that specifies an item to retrieve from a table in the account and Region. A call to <code>TransactGetItems</code> cannot retrieve items from tables in more than one Amazon Web Services account or Region. The aggregate size of the items in the transaction cannot exceed 4 MB.</p>
23/// <p>DynamoDB rejects the entire <code>TransactGetItems</code> request if any of the following is true:</p>
24/// <ul>
25/// <li>
26/// <p>A conflicting operation is in the process of updating an item to be read.</p></li>
27/// <li>
28/// <p>There is insufficient provisioned capacity for the transaction to be completed.</p></li>
29/// <li>
30/// <p>There is a user error, such as an invalid data format.</p></li>
31/// <li>
32/// <p>The aggregate size of the items in the transaction exceeded 4 MB.</p></li>
33/// </ul>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct TransactGetItemsFluentBuilder {
36                handle: ::std::sync::Arc<crate::client::Handle>,
37                inner: crate::operation::transact_get_items::builders::TransactGetItemsInputBuilder,
38config_override: ::std::option::Option<crate::config::Builder>,
39            }
40impl
41                crate::client::customize::internal::CustomizableSend<
42                    crate::operation::transact_get_items::TransactGetItemsOutput,
43                    crate::operation::transact_get_items::TransactGetItemsError,
44                > for TransactGetItemsFluentBuilder
45            {
46                fn send(
47                    self,
48                    config_override: crate::config::Builder,
49                ) -> crate::client::customize::internal::BoxFuture<
50                    crate::client::customize::internal::SendResult<
51                        crate::operation::transact_get_items::TransactGetItemsOutput,
52                        crate::operation::transact_get_items::TransactGetItemsError,
53                    >,
54                > {
55                    ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56                }
57            }
58impl TransactGetItemsFluentBuilder {
59    /// Creates a new `TransactGetItemsFluentBuilder`.
60                    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61                        Self {
62                            handle,
63                            inner: ::std::default::Default::default(),
64    config_override: ::std::option::Option::None,
65                        }
66                    }
67    /// Access the TransactGetItems as a reference.
68                    pub fn as_input(&self) -> &crate::operation::transact_get_items::builders::TransactGetItemsInputBuilder {
69                        &self.inner
70                    }
71    /// Sends the request and returns the response.
72                    ///
73                    /// If an error occurs, an `SdkError` will be returned with additional details that
74                    /// can be matched against.
75                    ///
76                    /// By default, any retryable failures will be retried twice. Retry behavior
77                    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78                    /// set when configuring the client. Note: retries are enabled by default when using
79                    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
80                    pub async fn send(self) -> ::std::result::Result<crate::operation::transact_get_items::TransactGetItemsOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::transact_get_items::TransactGetItemsError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
81                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
82                        let runtime_plugins = crate::operation::transact_get_items::TransactGetItems::operation_runtime_plugins(
83                            self.handle.runtime_plugins.clone(),
84                            &self.handle.conf,
85                            self.config_override,
86                        );
87                        crate::operation::transact_get_items::TransactGetItems::orchestrate(&runtime_plugins, input).await
88                    }
89    
90                    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
91                    pub fn customize(
92                        self,
93                    ) -> crate::client::customize::CustomizableOperation<crate::operation::transact_get_items::TransactGetItemsOutput, crate::operation::transact_get_items::TransactGetItemsError, Self> {
94                        crate::client::customize::CustomizableOperation::new(self)
95                    }
96    pub(crate) fn config_override(
97                            mut self,
98                            config_override: impl ::std::convert::Into<crate::config::Builder>,
99                        ) -> Self {
100                            self.set_config_override(::std::option::Option::Some(config_override.into()));
101                            self
102                        }
103    
104                        pub(crate) fn set_config_override(
105                            &mut self,
106                            config_override: ::std::option::Option<crate::config::Builder>,
107                        ) -> &mut Self {
108                            self.config_override = config_override;
109                            self
110                        }
111    /// 
112    /// Appends an item to `TransactItems`.
113    /// 
114    /// To override the contents of this collection use [`set_transact_items`](Self::set_transact_items).
115    /// 
116    /// <p>An ordered array of up to 100 <code>TransactGetItem</code> objects, each of which contains a <code>Get</code> structure.</p>
117    pub fn transact_items(mut self, input: crate::types::TransactGetItem) -> Self {
118                        self.inner = self.inner.transact_items(input);
119                        self
120                    }
121    /// <p>An ordered array of up to 100 <code>TransactGetItem</code> objects, each of which contains a <code>Get</code> structure.</p>
122    pub fn set_transact_items(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::TransactGetItem>>) -> Self {
123                    self.inner = self.inner.set_transact_items(input);
124                    self
125                }
126    /// <p>An ordered array of up to 100 <code>TransactGetItem</code> objects, each of which contains a <code>Get</code> structure.</p>
127    pub fn get_transact_items(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::TransactGetItem>> {
128                    self.inner.get_transact_items()
129                }
130    /// <p>A value of <code>TOTAL</code> causes consumed capacity information to be returned, and a value of <code>NONE</code> prevents that information from being returned. No other value is valid.</p>
131    pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
132                    self.inner = self.inner.return_consumed_capacity(input);
133                    self
134                }
135    /// <p>A value of <code>TOTAL</code> causes consumed capacity information to be returned, and a value of <code>NONE</code> prevents that information from being returned. No other value is valid.</p>
136    pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
137                    self.inner = self.inner.set_return_consumed_capacity(input);
138                    self
139                }
140    /// <p>A value of <code>TOTAL</code> causes consumed capacity information to be returned, and a value of <code>NONE</code> prevents that information from being returned. No other value is valid.</p>
141    pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
142                    self.inner.get_return_consumed_capacity()
143                }
144}
145