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