aws_sdk_dynamodb/operation/import_table/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::import_table::_import_table_output::ImportTableOutputBuilder;
3
4pub use crate::operation::import_table::_import_table_input::ImportTableInputBuilder;
5
6impl crate::operation::import_table::builders::ImportTableInputBuilder {
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::import_table::ImportTableOutput,
10                        ::aws_smithy_runtime_api::client::result::SdkError<
11                            crate::operation::import_table::ImportTableError,
12                            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13                        >
14                    > {
15                        let mut fluent_builder = client.import_table();
16                        fluent_builder.inner = self;
17                        fluent_builder.send().await
18                    }
19                }
20/// Fluent builder constructing a request to `ImportTable`.
21/// 
22/// <p>Imports table data from an S3 bucket.</p>
23#[derive(::std::clone::Clone, ::std::fmt::Debug)]
24pub struct ImportTableFluentBuilder {
25                handle: ::std::sync::Arc<crate::client::Handle>,
26                inner: crate::operation::import_table::builders::ImportTableInputBuilder,
27config_override: ::std::option::Option<crate::config::Builder>,
28            }
29impl
30                crate::client::customize::internal::CustomizableSend<
31                    crate::operation::import_table::ImportTableOutput,
32                    crate::operation::import_table::ImportTableError,
33                > for ImportTableFluentBuilder
34            {
35                fn send(
36                    self,
37                    config_override: crate::config::Builder,
38                ) -> crate::client::customize::internal::BoxFuture<
39                    crate::client::customize::internal::SendResult<
40                        crate::operation::import_table::ImportTableOutput,
41                        crate::operation::import_table::ImportTableError,
42                    >,
43                > {
44                    ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
45                }
46            }
47impl ImportTableFluentBuilder {
48    /// Creates a new `ImportTableFluentBuilder`.
49                    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
50                        Self {
51                            handle,
52                            inner: ::std::default::Default::default(),
53    config_override: ::std::option::Option::None,
54                        }
55                    }
56    /// Access the ImportTable as a reference.
57                    pub fn as_input(&self) -> &crate::operation::import_table::builders::ImportTableInputBuilder {
58                        &self.inner
59                    }
60    /// Sends the request and returns the response.
61                    ///
62                    /// If an error occurs, an `SdkError` will be returned with additional details that
63                    /// can be matched against.
64                    ///
65                    /// By default, any retryable failures will be retried twice. Retry behavior
66                    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
67                    /// set when configuring the client. Note: retries are enabled by default when using
68                    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
69                    pub async fn send(self) -> ::std::result::Result<crate::operation::import_table::ImportTableOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::import_table::ImportTableError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
70                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
71                        let runtime_plugins = crate::operation::import_table::ImportTable::operation_runtime_plugins(
72                            self.handle.runtime_plugins.clone(),
73                            &self.handle.conf,
74                            self.config_override,
75                        );
76                        crate::operation::import_table::ImportTable::orchestrate(&runtime_plugins, input).await
77                    }
78    
79                    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
80                    pub fn customize(
81                        self,
82                    ) -> crate::client::customize::CustomizableOperation<crate::operation::import_table::ImportTableOutput, crate::operation::import_table::ImportTableError, Self> {
83                        crate::client::customize::CustomizableOperation::new(self)
84                    }
85    pub(crate) fn config_override(
86                            mut self,
87                            config_override: impl ::std::convert::Into<crate::config::Builder>,
88                        ) -> Self {
89                            self.set_config_override(::std::option::Option::Some(config_override.into()));
90                            self
91                        }
92    
93                        pub(crate) fn set_config_override(
94                            &mut self,
95                            config_override: ::std::option::Option<crate::config::Builder>,
96                        ) -> &mut Self {
97                            self.config_override = config_override;
98                            self
99                        }
100    /// <p>Providing a <code>ClientToken</code> makes the call to <code>ImportTableInput</code> idempotent, meaning that multiple identical calls have the same effect as one single call.</p>
101    /// <p>A client token is valid for 8 hours after the first request that uses it is completed. After 8 hours, any request with the same client token is treated as a new request. Do not resubmit the same request with the same client token for more than 8 hours, or the result might not be idempotent.</p>
102    /// <p>If you submit a request with the same client token but a change in other parameters within the 8-hour idempotency window, DynamoDB returns an <code>IdempotentParameterMismatch</code> exception.</p>
103    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104                    self.inner = self.inner.client_token(input.into());
105                    self
106                }
107    /// <p>Providing a <code>ClientToken</code> makes the call to <code>ImportTableInput</code> idempotent, meaning that multiple identical calls have the same effect as one single call.</p>
108    /// <p>A client token is valid for 8 hours after the first request that uses it is completed. After 8 hours, any request with the same client token is treated as a new request. Do not resubmit the same request with the same client token for more than 8 hours, or the result might not be idempotent.</p>
109    /// <p>If you submit a request with the same client token but a change in other parameters within the 8-hour idempotency window, DynamoDB returns an <code>IdempotentParameterMismatch</code> exception.</p>
110    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111                    self.inner = self.inner.set_client_token(input);
112                    self
113                }
114    /// <p>Providing a <code>ClientToken</code> makes the call to <code>ImportTableInput</code> idempotent, meaning that multiple identical calls have the same effect as one single call.</p>
115    /// <p>A client token is valid for 8 hours after the first request that uses it is completed. After 8 hours, any request with the same client token is treated as a new request. Do not resubmit the same request with the same client token for more than 8 hours, or the result might not be idempotent.</p>
116    /// <p>If you submit a request with the same client token but a change in other parameters within the 8-hour idempotency window, DynamoDB returns an <code>IdempotentParameterMismatch</code> exception.</p>
117    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
118                    self.inner.get_client_token()
119                }
120    /// <p>The S3 bucket that provides the source for the import.</p>
121    pub fn s3_bucket_source(mut self, input: crate::types::S3BucketSource) -> Self {
122                    self.inner = self.inner.s3_bucket_source(input);
123                    self
124                }
125    /// <p>The S3 bucket that provides the source for the import.</p>
126    pub fn set_s3_bucket_source(mut self, input: ::std::option::Option<crate::types::S3BucketSource>) -> Self {
127                    self.inner = self.inner.set_s3_bucket_source(input);
128                    self
129                }
130    /// <p>The S3 bucket that provides the source for the import.</p>
131    pub fn get_s3_bucket_source(&self) -> &::std::option::Option<crate::types::S3BucketSource> {
132                    self.inner.get_s3_bucket_source()
133                }
134    /// <p>The format of the source data. Valid values for <code>ImportFormat</code> are <code>CSV</code>, <code>DYNAMODB_JSON</code> or <code>ION</code>.</p>
135    pub fn input_format(mut self, input: crate::types::InputFormat) -> Self {
136                    self.inner = self.inner.input_format(input);
137                    self
138                }
139    /// <p>The format of the source data. Valid values for <code>ImportFormat</code> are <code>CSV</code>, <code>DYNAMODB_JSON</code> or <code>ION</code>.</p>
140    pub fn set_input_format(mut self, input: ::std::option::Option<crate::types::InputFormat>) -> Self {
141                    self.inner = self.inner.set_input_format(input);
142                    self
143                }
144    /// <p>The format of the source data. Valid values for <code>ImportFormat</code> are <code>CSV</code>, <code>DYNAMODB_JSON</code> or <code>ION</code>.</p>
145    pub fn get_input_format(&self) -> &::std::option::Option<crate::types::InputFormat> {
146                    self.inner.get_input_format()
147                }
148    /// <p>Additional properties that specify how the input is formatted,</p>
149    pub fn input_format_options(mut self, input: crate::types::InputFormatOptions) -> Self {
150                    self.inner = self.inner.input_format_options(input);
151                    self
152                }
153    /// <p>Additional properties that specify how the input is formatted,</p>
154    pub fn set_input_format_options(mut self, input: ::std::option::Option<crate::types::InputFormatOptions>) -> Self {
155                    self.inner = self.inner.set_input_format_options(input);
156                    self
157                }
158    /// <p>Additional properties that specify how the input is formatted,</p>
159    pub fn get_input_format_options(&self) -> &::std::option::Option<crate::types::InputFormatOptions> {
160                    self.inner.get_input_format_options()
161                }
162    /// <p>Type of compression to be used on the input coming from the imported table.</p>
163    pub fn input_compression_type(mut self, input: crate::types::InputCompressionType) -> Self {
164                    self.inner = self.inner.input_compression_type(input);
165                    self
166                }
167    /// <p>Type of compression to be used on the input coming from the imported table.</p>
168    pub fn set_input_compression_type(mut self, input: ::std::option::Option<crate::types::InputCompressionType>) -> Self {
169                    self.inner = self.inner.set_input_compression_type(input);
170                    self
171                }
172    /// <p>Type of compression to be used on the input coming from the imported table.</p>
173    pub fn get_input_compression_type(&self) -> &::std::option::Option<crate::types::InputCompressionType> {
174                    self.inner.get_input_compression_type()
175                }
176    /// <p>Parameters for the table to import the data into.</p>
177    pub fn table_creation_parameters(mut self, input: crate::types::TableCreationParameters) -> Self {
178                    self.inner = self.inner.table_creation_parameters(input);
179                    self
180                }
181    /// <p>Parameters for the table to import the data into.</p>
182    pub fn set_table_creation_parameters(mut self, input: ::std::option::Option<crate::types::TableCreationParameters>) -> Self {
183                    self.inner = self.inner.set_table_creation_parameters(input);
184                    self
185                }
186    /// <p>Parameters for the table to import the data into.</p>
187    pub fn get_table_creation_parameters(&self) -> &::std::option::Option<crate::types::TableCreationParameters> {
188                    self.inner.get_table_creation_parameters()
189                }
190}
191