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.
68 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>> {
69 let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
70 let runtime_plugins = crate::operation::import_table::ImportTable::operation_runtime_plugins(
71 self.handle.runtime_plugins.clone(),
72 &self.handle.conf,
73 self.config_override,
74 );
75 crate::operation::import_table::ImportTable::orchestrate(&runtime_plugins, input).await
76 }
77
78 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
79 pub fn customize(
80 self,
81 ) -> crate::client::customize::CustomizableOperation<crate::operation::import_table::ImportTableOutput, crate::operation::import_table::ImportTableError, Self> {
82 crate::client::customize::CustomizableOperation::new(self)
83 }
84 pub(crate) fn config_override(
85 mut self,
86 config_override: impl ::std::convert::Into<crate::config::Builder>,
87 ) -> Self {
88 self.set_config_override(::std::option::Option::Some(config_override.into()));
89 self
90 }
91
92 pub(crate) fn set_config_override(
93 &mut self,
94 config_override: ::std::option::Option<crate::config::Builder>,
95 ) -> &mut Self {
96 self.config_override = config_override;
97 self
98 }
99 /// <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>
100 /// <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>
101 /// <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>
102 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.inner = self.inner.client_token(input.into());
104 self
105 }
106 /// <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>
107 /// <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>
108 /// <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>
109 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.inner = self.inner.set_client_token(input);
111 self
112 }
113 /// <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>
114 /// <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>
115 /// <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>
116 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
117 self.inner.get_client_token()
118 }
119 /// <p>The S3 bucket that provides the source for the import.</p>
120 pub fn s3_bucket_source(mut self, input: crate::types::S3BucketSource) -> Self {
121 self.inner = self.inner.s3_bucket_source(input);
122 self
123 }
124 /// <p>The S3 bucket that provides the source for the import.</p>
125 pub fn set_s3_bucket_source(mut self, input: ::std::option::Option<crate::types::S3BucketSource>) -> Self {
126 self.inner = self.inner.set_s3_bucket_source(input);
127 self
128 }
129 /// <p>The S3 bucket that provides the source for the import.</p>
130 pub fn get_s3_bucket_source(&self) -> &::std::option::Option<crate::types::S3BucketSource> {
131 self.inner.get_s3_bucket_source()
132 }
133 /// <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>
134 pub fn input_format(mut self, input: crate::types::InputFormat) -> Self {
135 self.inner = self.inner.input_format(input);
136 self
137 }
138 /// <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>
139 pub fn set_input_format(mut self, input: ::std::option::Option<crate::types::InputFormat>) -> Self {
140 self.inner = self.inner.set_input_format(input);
141 self
142 }
143 /// <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>
144 pub fn get_input_format(&self) -> &::std::option::Option<crate::types::InputFormat> {
145 self.inner.get_input_format()
146 }
147 /// <p>Additional properties that specify how the input is formatted,</p>
148 pub fn input_format_options(mut self, input: crate::types::InputFormatOptions) -> Self {
149 self.inner = self.inner.input_format_options(input);
150 self
151 }
152 /// <p>Additional properties that specify how the input is formatted,</p>
153 pub fn set_input_format_options(mut self, input: ::std::option::Option<crate::types::InputFormatOptions>) -> Self {
154 self.inner = self.inner.set_input_format_options(input);
155 self
156 }
157 /// <p>Additional properties that specify how the input is formatted,</p>
158 pub fn get_input_format_options(&self) -> &::std::option::Option<crate::types::InputFormatOptions> {
159 self.inner.get_input_format_options()
160 }
161 /// <p>Type of compression to be used on the input coming from the imported table.</p>
162 pub fn input_compression_type(mut self, input: crate::types::InputCompressionType) -> Self {
163 self.inner = self.inner.input_compression_type(input);
164 self
165 }
166 /// <p>Type of compression to be used on the input coming from the imported table.</p>
167 pub fn set_input_compression_type(mut self, input: ::std::option::Option<crate::types::InputCompressionType>) -> Self {
168 self.inner = self.inner.set_input_compression_type(input);
169 self
170 }
171 /// <p>Type of compression to be used on the input coming from the imported table.</p>
172 pub fn get_input_compression_type(&self) -> &::std::option::Option<crate::types::InputCompressionType> {
173 self.inner.get_input_compression_type()
174 }
175 /// <p>Parameters for the table to import the data into.</p>
176 pub fn table_creation_parameters(mut self, input: crate::types::TableCreationParameters) -> Self {
177 self.inner = self.inner.table_creation_parameters(input);
178 self
179 }
180 /// <p>Parameters for the table to import the data into.</p>
181 pub fn set_table_creation_parameters(mut self, input: ::std::option::Option<crate::types::TableCreationParameters>) -> Self {
182 self.inner = self.inner.set_table_creation_parameters(input);
183 self
184 }
185 /// <p>Parameters for the table to import the data into.</p>
186 pub fn get_table_creation_parameters(&self) -> &::std::option::Option<crate::types::TableCreationParameters> {
187 self.inner.get_table_creation_parameters()
188 }
189}
190