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.
79                    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>> {
80                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
81                        let runtime_plugins = crate::operation::transact_get_items::TransactGetItems::operation_runtime_plugins(
82                            self.handle.runtime_plugins.clone(),
83                            &self.handle.conf,
84                            self.config_override,
85                        );
86                        crate::operation::transact_get_items::TransactGetItems::orchestrate(&runtime_plugins, input).await
87                    }
88    
89                    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
90                    pub fn customize(
91                        self,
92                    ) -> crate::client::customize::CustomizableOperation<crate::operation::transact_get_items::TransactGetItemsOutput, crate::operation::transact_get_items::TransactGetItemsError, Self> {
93                        crate::client::customize::CustomizableOperation::new(self)
94                    }
95    pub(crate) fn config_override(
96                            mut self,
97                            config_override: impl ::std::convert::Into<crate::config::Builder>,
98                        ) -> Self {
99                            self.set_config_override(::std::option::Option::Some(config_override.into()));
100                            self
101                        }
102    
103                        pub(crate) fn set_config_override(
104                            &mut self,
105                            config_override: ::std::option::Option<crate::config::Builder>,
106                        ) -> &mut Self {
107                            self.config_override = config_override;
108                            self
109                        }
110    /// 
111    /// Appends an item to `TransactItems`.
112    /// 
113    /// To override the contents of this collection use [`set_transact_items`](Self::set_transact_items).
114    /// 
115    /// <p>An ordered array of up to 100 <code>TransactGetItem</code> objects, each of which contains a <code>Get</code> structure.</p>
116    pub fn transact_items(mut self, input: crate::types::TransactGetItem) -> Self {
117                        self.inner = self.inner.transact_items(input);
118                        self
119                    }
120    /// <p>An ordered array of up to 100 <code>TransactGetItem</code> objects, each of which contains a <code>Get</code> structure.</p>
121    pub fn set_transact_items(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::TransactGetItem>>) -> Self {
122                    self.inner = self.inner.set_transact_items(input);
123                    self
124                }
125    /// <p>An ordered array of up to 100 <code>TransactGetItem</code> objects, each of which contains a <code>Get</code> structure.</p>
126    pub fn get_transact_items(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::TransactGetItem>> {
127                    self.inner.get_transact_items()
128                }
129    /// <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>
130    pub fn return_consumed_capacity(mut self, input: crate::types::ReturnConsumedCapacity) -> Self {
131                    self.inner = self.inner.return_consumed_capacity(input);
132                    self
133                }
134    /// <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>
135    pub fn set_return_consumed_capacity(mut self, input: ::std::option::Option<crate::types::ReturnConsumedCapacity>) -> Self {
136                    self.inner = self.inner.set_return_consumed_capacity(input);
137                    self
138                }
139    /// <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>
140    pub fn get_return_consumed_capacity(&self) -> &::std::option::Option<crate::types::ReturnConsumedCapacity> {
141                    self.inner.get_return_consumed_capacity()
142                }
143}
144