aws_sdk_dynamodb/operation/import_table/
_import_table_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ImportTableInput {
6    /// <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>
7    /// <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>
8    /// <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>
9    pub client_token: ::std::option::Option<::std::string::String>,
10    /// <p>The S3 bucket that provides the source for the import.</p>
11    pub s3_bucket_source: ::std::option::Option<crate::types::S3BucketSource>,
12    /// <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>
13    pub input_format: ::std::option::Option<crate::types::InputFormat>,
14    /// <p>Additional properties that specify how the input is formatted,</p>
15    pub input_format_options: ::std::option::Option<crate::types::InputFormatOptions>,
16    /// <p>Type of compression to be used on the input coming from the imported table.</p>
17    pub input_compression_type: ::std::option::Option<crate::types::InputCompressionType>,
18    /// <p>Parameters for the table to import the data into.</p>
19    pub table_creation_parameters: ::std::option::Option<crate::types::TableCreationParameters>,
20}
21impl ImportTableInput {
22    /// <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>
23    /// <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>
24    /// <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>
25    pub fn client_token(&self) -> ::std::option::Option<&str> {
26        self.client_token.as_deref()
27    }
28    /// <p>The S3 bucket that provides the source for the import.</p>
29    pub fn s3_bucket_source(&self) -> ::std::option::Option<&crate::types::S3BucketSource> {
30        self.s3_bucket_source.as_ref()
31    }
32    /// <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>
33    pub fn input_format(&self) -> ::std::option::Option<&crate::types::InputFormat> {
34        self.input_format.as_ref()
35    }
36    /// <p>Additional properties that specify how the input is formatted,</p>
37    pub fn input_format_options(&self) -> ::std::option::Option<&crate::types::InputFormatOptions> {
38        self.input_format_options.as_ref()
39    }
40    /// <p>Type of compression to be used on the input coming from the imported table.</p>
41    pub fn input_compression_type(&self) -> ::std::option::Option<&crate::types::InputCompressionType> {
42        self.input_compression_type.as_ref()
43    }
44    /// <p>Parameters for the table to import the data into.</p>
45    pub fn table_creation_parameters(&self) -> ::std::option::Option<&crate::types::TableCreationParameters> {
46        self.table_creation_parameters.as_ref()
47    }
48}
49impl ImportTableInput {
50    /// Creates a new builder-style object to manufacture [`ImportTableInput`](crate::operation::import_table::ImportTableInput).
51    pub fn builder() -> crate::operation::import_table::builders::ImportTableInputBuilder {
52        crate::operation::import_table::builders::ImportTableInputBuilder::default()
53    }
54}
55
56/// A builder for [`ImportTableInput`](crate::operation::import_table::ImportTableInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct ImportTableInputBuilder {
60    pub(crate) client_token: ::std::option::Option<::std::string::String>,
61    pub(crate) s3_bucket_source: ::std::option::Option<crate::types::S3BucketSource>,
62    pub(crate) input_format: ::std::option::Option<crate::types::InputFormat>,
63    pub(crate) input_format_options: ::std::option::Option<crate::types::InputFormatOptions>,
64    pub(crate) input_compression_type: ::std::option::Option<crate::types::InputCompressionType>,
65    pub(crate) table_creation_parameters: ::std::option::Option<crate::types::TableCreationParameters>,
66}
67impl ImportTableInputBuilder {
68    /// <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>
69    /// <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>
70    /// <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>
71    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.client_token = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <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>
76    /// <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>
77    /// <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>
78    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.client_token = input;
80        self
81    }
82    /// <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>
83    /// <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>
84    /// <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>
85    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
86        &self.client_token
87    }
88    /// <p>The S3 bucket that provides the source for the import.</p>
89    /// This field is required.
90    pub fn s3_bucket_source(mut self, input: crate::types::S3BucketSource) -> Self {
91        self.s3_bucket_source = ::std::option::Option::Some(input);
92        self
93    }
94    /// <p>The S3 bucket that provides the source for the import.</p>
95    pub fn set_s3_bucket_source(mut self, input: ::std::option::Option<crate::types::S3BucketSource>) -> Self {
96        self.s3_bucket_source = input;
97        self
98    }
99    /// <p>The S3 bucket that provides the source for the import.</p>
100    pub fn get_s3_bucket_source(&self) -> &::std::option::Option<crate::types::S3BucketSource> {
101        &self.s3_bucket_source
102    }
103    /// <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>
104    /// This field is required.
105    pub fn input_format(mut self, input: crate::types::InputFormat) -> Self {
106        self.input_format = ::std::option::Option::Some(input);
107        self
108    }
109    /// <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>
110    pub fn set_input_format(mut self, input: ::std::option::Option<crate::types::InputFormat>) -> Self {
111        self.input_format = input;
112        self
113    }
114    /// <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>
115    pub fn get_input_format(&self) -> &::std::option::Option<crate::types::InputFormat> {
116        &self.input_format
117    }
118    /// <p>Additional properties that specify how the input is formatted,</p>
119    pub fn input_format_options(mut self, input: crate::types::InputFormatOptions) -> Self {
120        self.input_format_options = ::std::option::Option::Some(input);
121        self
122    }
123    /// <p>Additional properties that specify how the input is formatted,</p>
124    pub fn set_input_format_options(mut self, input: ::std::option::Option<crate::types::InputFormatOptions>) -> Self {
125        self.input_format_options = input;
126        self
127    }
128    /// <p>Additional properties that specify how the input is formatted,</p>
129    pub fn get_input_format_options(&self) -> &::std::option::Option<crate::types::InputFormatOptions> {
130        &self.input_format_options
131    }
132    /// <p>Type of compression to be used on the input coming from the imported table.</p>
133    pub fn input_compression_type(mut self, input: crate::types::InputCompressionType) -> Self {
134        self.input_compression_type = ::std::option::Option::Some(input);
135        self
136    }
137    /// <p>Type of compression to be used on the input coming from the imported table.</p>
138    pub fn set_input_compression_type(mut self, input: ::std::option::Option<crate::types::InputCompressionType>) -> Self {
139        self.input_compression_type = input;
140        self
141    }
142    /// <p>Type of compression to be used on the input coming from the imported table.</p>
143    pub fn get_input_compression_type(&self) -> &::std::option::Option<crate::types::InputCompressionType> {
144        &self.input_compression_type
145    }
146    /// <p>Parameters for the table to import the data into.</p>
147    /// This field is required.
148    pub fn table_creation_parameters(mut self, input: crate::types::TableCreationParameters) -> Self {
149        self.table_creation_parameters = ::std::option::Option::Some(input);
150        self
151    }
152    /// <p>Parameters for the table to import the data into.</p>
153    pub fn set_table_creation_parameters(mut self, input: ::std::option::Option<crate::types::TableCreationParameters>) -> Self {
154        self.table_creation_parameters = input;
155        self
156    }
157    /// <p>Parameters for the table to import the data into.</p>
158    pub fn get_table_creation_parameters(&self) -> &::std::option::Option<crate::types::TableCreationParameters> {
159        &self.table_creation_parameters
160    }
161    /// Consumes the builder and constructs a [`ImportTableInput`](crate::operation::import_table::ImportTableInput).
162    pub fn build(self) -> ::std::result::Result<crate::operation::import_table::ImportTableInput, ::aws_smithy_types::error::operation::BuildError> {
163        ::std::result::Result::Ok(crate::operation::import_table::ImportTableInput {
164            client_token: self.client_token,
165            s3_bucket_source: self.s3_bucket_source,
166            input_format: self.input_format,
167            input_format_options: self.input_format_options,
168            input_compression_type: self.input_compression_type,
169            table_creation_parameters: self.table_creation_parameters,
170        })
171    }
172}