aws_sdk_s3tables/operation/create_table/
_create_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 CreateTableInput {
6    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
7    pub table_bucket_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The namespace to associated with the table.</p>
9    pub namespace: ::std::option::Option<::std::string::String>,
10    /// <p>The name for the table.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The format for the table.</p>
13    pub format: ::std::option::Option<crate::types::OpenTableFormat>,
14    /// <p>The metadata for the table.</p>
15    pub metadata: ::std::option::Option<crate::types::TableMetadata>,
16    /// <p>The encryption configuration to use for the table. This configuration specifies the encryption algorithm and, if using SSE-KMS, the KMS key to use for encrypting the table.</p><note>
17    /// <p>If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-kms-permissions.html">Permissions requirements for S3 Tables SSE-KMS encryption</a>.</p>
18    /// </note>
19    pub encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
20    /// <p>The storage class configuration for the table. If not specified, the table inherits the storage class configuration from its table bucket. Specify this parameter to override the bucket's default storage class for this table.</p>
21    pub storage_class_configuration: ::std::option::Option<crate::types::StorageClassConfiguration>,
22    /// <p>A map of user-defined tags that you would like to apply to the table that you are creating. A tag is a key-value pair that you apply to your resources. Tags can help you organize, track costs for, and control access to resources. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html">Tagging for cost allocation or attribute-based access control (ABAC)</a>.</p><note>
23    /// <p>You must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTable</code> permission to create a table with tags.</p>
24    /// </note>
25    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
26}
27impl CreateTableInput {
28    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
29    pub fn table_bucket_arn(&self) -> ::std::option::Option<&str> {
30        self.table_bucket_arn.as_deref()
31    }
32    /// <p>The namespace to associated with the table.</p>
33    pub fn namespace(&self) -> ::std::option::Option<&str> {
34        self.namespace.as_deref()
35    }
36    /// <p>The name for the table.</p>
37    pub fn name(&self) -> ::std::option::Option<&str> {
38        self.name.as_deref()
39    }
40    /// <p>The format for the table.</p>
41    pub fn format(&self) -> ::std::option::Option<&crate::types::OpenTableFormat> {
42        self.format.as_ref()
43    }
44    /// <p>The metadata for the table.</p>
45    pub fn metadata(&self) -> ::std::option::Option<&crate::types::TableMetadata> {
46        self.metadata.as_ref()
47    }
48    /// <p>The encryption configuration to use for the table. This configuration specifies the encryption algorithm and, if using SSE-KMS, the KMS key to use for encrypting the table.</p><note>
49    /// <p>If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-kms-permissions.html">Permissions requirements for S3 Tables SSE-KMS encryption</a>.</p>
50    /// </note>
51    pub fn encryption_configuration(&self) -> ::std::option::Option<&crate::types::EncryptionConfiguration> {
52        self.encryption_configuration.as_ref()
53    }
54    /// <p>The storage class configuration for the table. If not specified, the table inherits the storage class configuration from its table bucket. Specify this parameter to override the bucket's default storage class for this table.</p>
55    pub fn storage_class_configuration(&self) -> ::std::option::Option<&crate::types::StorageClassConfiguration> {
56        self.storage_class_configuration.as_ref()
57    }
58    /// <p>A map of user-defined tags that you would like to apply to the table that you are creating. A tag is a key-value pair that you apply to your resources. Tags can help you organize, track costs for, and control access to resources. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html">Tagging for cost allocation or attribute-based access control (ABAC)</a>.</p><note>
59    /// <p>You must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTable</code> permission to create a table with tags.</p>
60    /// </note>
61    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
62        self.tags.as_ref()
63    }
64}
65impl CreateTableInput {
66    /// Creates a new builder-style object to manufacture [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
67    pub fn builder() -> crate::operation::create_table::builders::CreateTableInputBuilder {
68        crate::operation::create_table::builders::CreateTableInputBuilder::default()
69    }
70}
71
72/// A builder for [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct CreateTableInputBuilder {
76    pub(crate) table_bucket_arn: ::std::option::Option<::std::string::String>,
77    pub(crate) namespace: ::std::option::Option<::std::string::String>,
78    pub(crate) name: ::std::option::Option<::std::string::String>,
79    pub(crate) format: ::std::option::Option<crate::types::OpenTableFormat>,
80    pub(crate) metadata: ::std::option::Option<crate::types::TableMetadata>,
81    pub(crate) encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
82    pub(crate) storage_class_configuration: ::std::option::Option<crate::types::StorageClassConfiguration>,
83    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
84}
85impl CreateTableInputBuilder {
86    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
87    /// This field is required.
88    pub fn table_bucket_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.table_bucket_arn = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
93    pub fn set_table_bucket_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.table_bucket_arn = input;
95        self
96    }
97    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
98    pub fn get_table_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
99        &self.table_bucket_arn
100    }
101    /// <p>The namespace to associated with the table.</p>
102    /// This field is required.
103    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.namespace = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The namespace to associated with the table.</p>
108    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.namespace = input;
110        self
111    }
112    /// <p>The namespace to associated with the table.</p>
113    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
114        &self.namespace
115    }
116    /// <p>The name for the table.</p>
117    /// This field is required.
118    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.name = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The name for the table.</p>
123    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.name = input;
125        self
126    }
127    /// <p>The name for the table.</p>
128    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
129        &self.name
130    }
131    /// <p>The format for the table.</p>
132    /// This field is required.
133    pub fn format(mut self, input: crate::types::OpenTableFormat) -> Self {
134        self.format = ::std::option::Option::Some(input);
135        self
136    }
137    /// <p>The format for the table.</p>
138    pub fn set_format(mut self, input: ::std::option::Option<crate::types::OpenTableFormat>) -> Self {
139        self.format = input;
140        self
141    }
142    /// <p>The format for the table.</p>
143    pub fn get_format(&self) -> &::std::option::Option<crate::types::OpenTableFormat> {
144        &self.format
145    }
146    /// <p>The metadata for the table.</p>
147    pub fn metadata(mut self, input: crate::types::TableMetadata) -> Self {
148        self.metadata = ::std::option::Option::Some(input);
149        self
150    }
151    /// <p>The metadata for the table.</p>
152    pub fn set_metadata(mut self, input: ::std::option::Option<crate::types::TableMetadata>) -> Self {
153        self.metadata = input;
154        self
155    }
156    /// <p>The metadata for the table.</p>
157    pub fn get_metadata(&self) -> &::std::option::Option<crate::types::TableMetadata> {
158        &self.metadata
159    }
160    /// <p>The encryption configuration to use for the table. This configuration specifies the encryption algorithm and, if using SSE-KMS, the KMS key to use for encrypting the table.</p><note>
161    /// <p>If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-kms-permissions.html">Permissions requirements for S3 Tables SSE-KMS encryption</a>.</p>
162    /// </note>
163    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
164        self.encryption_configuration = ::std::option::Option::Some(input);
165        self
166    }
167    /// <p>The encryption configuration to use for the table. This configuration specifies the encryption algorithm and, if using SSE-KMS, the KMS key to use for encrypting the table.</p><note>
168    /// <p>If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-kms-permissions.html">Permissions requirements for S3 Tables SSE-KMS encryption</a>.</p>
169    /// </note>
170    pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
171        self.encryption_configuration = input;
172        self
173    }
174    /// <p>The encryption configuration to use for the table. This configuration specifies the encryption algorithm and, if using SSE-KMS, the KMS key to use for encrypting the table.</p><note>
175    /// <p>If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-kms-permissions.html">Permissions requirements for S3 Tables SSE-KMS encryption</a>.</p>
176    /// </note>
177    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
178        &self.encryption_configuration
179    }
180    /// <p>The storage class configuration for the table. If not specified, the table inherits the storage class configuration from its table bucket. Specify this parameter to override the bucket's default storage class for this table.</p>
181    pub fn storage_class_configuration(mut self, input: crate::types::StorageClassConfiguration) -> Self {
182        self.storage_class_configuration = ::std::option::Option::Some(input);
183        self
184    }
185    /// <p>The storage class configuration for the table. If not specified, the table inherits the storage class configuration from its table bucket. Specify this parameter to override the bucket's default storage class for this table.</p>
186    pub fn set_storage_class_configuration(mut self, input: ::std::option::Option<crate::types::StorageClassConfiguration>) -> Self {
187        self.storage_class_configuration = input;
188        self
189    }
190    /// <p>The storage class configuration for the table. If not specified, the table inherits the storage class configuration from its table bucket. Specify this parameter to override the bucket's default storage class for this table.</p>
191    pub fn get_storage_class_configuration(&self) -> &::std::option::Option<crate::types::StorageClassConfiguration> {
192        &self.storage_class_configuration
193    }
194    /// Adds a key-value pair to `tags`.
195    ///
196    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
197    ///
198    /// <p>A map of user-defined tags that you would like to apply to the table that you are creating. A tag is a key-value pair that you apply to your resources. Tags can help you organize, track costs for, and control access to resources. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html">Tagging for cost allocation or attribute-based access control (ABAC)</a>.</p><note>
199    /// <p>You must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTable</code> permission to create a table with tags.</p>
200    /// </note>
201    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
202        let mut hash_map = self.tags.unwrap_or_default();
203        hash_map.insert(k.into(), v.into());
204        self.tags = ::std::option::Option::Some(hash_map);
205        self
206    }
207    /// <p>A map of user-defined tags that you would like to apply to the table that you are creating. A tag is a key-value pair that you apply to your resources. Tags can help you organize, track costs for, and control access to resources. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html">Tagging for cost allocation or attribute-based access control (ABAC)</a>.</p><note>
208    /// <p>You must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTable</code> permission to create a table with tags.</p>
209    /// </note>
210    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
211        self.tags = input;
212        self
213    }
214    /// <p>A map of user-defined tags that you would like to apply to the table that you are creating. A tag is a key-value pair that you apply to your resources. Tags can help you organize, track costs for, and control access to resources. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/tagging.html">Tagging for cost allocation or attribute-based access control (ABAC)</a>.</p><note>
215    /// <p>You must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTable</code> permission to create a table with tags.</p>
216    /// </note>
217    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
218        &self.tags
219    }
220    /// Consumes the builder and constructs a [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
221    pub fn build(self) -> ::std::result::Result<crate::operation::create_table::CreateTableInput, ::aws_smithy_types::error::operation::BuildError> {
222        ::std::result::Result::Ok(crate::operation::create_table::CreateTableInput {
223            table_bucket_arn: self.table_bucket_arn,
224            namespace: self.namespace,
225            name: self.name,
226            format: self.format,
227            metadata: self.metadata,
228            encryption_configuration: self.encryption_configuration,
229            storage_class_configuration: self.storage_class_configuration,
230            tags: self.tags,
231        })
232    }
233}