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>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>
21 /// <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>
22 /// </note>
23 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
24}
25impl CreateTableInput {
26 /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
27 pub fn table_bucket_arn(&self) -> ::std::option::Option<&str> {
28 self.table_bucket_arn.as_deref()
29 }
30 /// <p>The namespace to associated with the table.</p>
31 pub fn namespace(&self) -> ::std::option::Option<&str> {
32 self.namespace.as_deref()
33 }
34 /// <p>The name for the table.</p>
35 pub fn name(&self) -> ::std::option::Option<&str> {
36 self.name.as_deref()
37 }
38 /// <p>The format for the table.</p>
39 pub fn format(&self) -> ::std::option::Option<&crate::types::OpenTableFormat> {
40 self.format.as_ref()
41 }
42 /// <p>The metadata for the table.</p>
43 pub fn metadata(&self) -> ::std::option::Option<&crate::types::TableMetadata> {
44 self.metadata.as_ref()
45 }
46 /// <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>
47 /// <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>
48 /// </note>
49 pub fn encryption_configuration(&self) -> ::std::option::Option<&crate::types::EncryptionConfiguration> {
50 self.encryption_configuration.as_ref()
51 }
52 /// <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>
53 /// <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>
54 /// </note>
55 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
56 self.tags.as_ref()
57 }
58}
59impl CreateTableInput {
60 /// Creates a new builder-style object to manufacture [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
61 pub fn builder() -> crate::operation::create_table::builders::CreateTableInputBuilder {
62 crate::operation::create_table::builders::CreateTableInputBuilder::default()
63 }
64}
65
66/// A builder for [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct CreateTableInputBuilder {
70 pub(crate) table_bucket_arn: ::std::option::Option<::std::string::String>,
71 pub(crate) namespace: ::std::option::Option<::std::string::String>,
72 pub(crate) name: ::std::option::Option<::std::string::String>,
73 pub(crate) format: ::std::option::Option<crate::types::OpenTableFormat>,
74 pub(crate) metadata: ::std::option::Option<crate::types::TableMetadata>,
75 pub(crate) encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
76 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
77}
78impl CreateTableInputBuilder {
79 /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
80 /// This field is required.
81 pub fn table_bucket_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.table_bucket_arn = ::std::option::Option::Some(input.into());
83 self
84 }
85 /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
86 pub fn set_table_bucket_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.table_bucket_arn = input;
88 self
89 }
90 /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
91 pub fn get_table_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
92 &self.table_bucket_arn
93 }
94 /// <p>The namespace to associated with the table.</p>
95 /// This field is required.
96 pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.namespace = ::std::option::Option::Some(input.into());
98 self
99 }
100 /// <p>The namespace to associated with the table.</p>
101 pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102 self.namespace = input;
103 self
104 }
105 /// <p>The namespace to associated with the table.</p>
106 pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
107 &self.namespace
108 }
109 /// <p>The name for the table.</p>
110 /// This field is required.
111 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112 self.name = ::std::option::Option::Some(input.into());
113 self
114 }
115 /// <p>The name for the table.</p>
116 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117 self.name = input;
118 self
119 }
120 /// <p>The name for the table.</p>
121 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
122 &self.name
123 }
124 /// <p>The format for the table.</p>
125 /// This field is required.
126 pub fn format(mut self, input: crate::types::OpenTableFormat) -> Self {
127 self.format = ::std::option::Option::Some(input);
128 self
129 }
130 /// <p>The format for the table.</p>
131 pub fn set_format(mut self, input: ::std::option::Option<crate::types::OpenTableFormat>) -> Self {
132 self.format = input;
133 self
134 }
135 /// <p>The format for the table.</p>
136 pub fn get_format(&self) -> &::std::option::Option<crate::types::OpenTableFormat> {
137 &self.format
138 }
139 /// <p>The metadata for the table.</p>
140 pub fn metadata(mut self, input: crate::types::TableMetadata) -> Self {
141 self.metadata = ::std::option::Option::Some(input);
142 self
143 }
144 /// <p>The metadata for the table.</p>
145 pub fn set_metadata(mut self, input: ::std::option::Option<crate::types::TableMetadata>) -> Self {
146 self.metadata = input;
147 self
148 }
149 /// <p>The metadata for the table.</p>
150 pub fn get_metadata(&self) -> &::std::option::Option<crate::types::TableMetadata> {
151 &self.metadata
152 }
153 /// <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>
154 /// <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>
155 /// </note>
156 pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
157 self.encryption_configuration = ::std::option::Option::Some(input);
158 self
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 set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
164 self.encryption_configuration = 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 get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
171 &self.encryption_configuration
172 }
173 /// Adds a key-value pair to `tags`.
174 ///
175 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
176 ///
177 /// <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>
178 /// <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>
179 /// </note>
180 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
181 let mut hash_map = self.tags.unwrap_or_default();
182 hash_map.insert(k.into(), v.into());
183 self.tags = ::std::option::Option::Some(hash_map);
184 self
185 }
186 /// <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>
187 /// <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>
188 /// </note>
189 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
190 self.tags = input;
191 self
192 }
193 /// <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>
194 /// <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>
195 /// </note>
196 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
197 &self.tags
198 }
199 /// Consumes the builder and constructs a [`CreateTableInput`](crate::operation::create_table::CreateTableInput).
200 pub fn build(self) -> ::std::result::Result<crate::operation::create_table::CreateTableInput, ::aws_smithy_types::error::operation::BuildError> {
201 ::std::result::Result::Ok(crate::operation::create_table::CreateTableInput {
202 table_bucket_arn: self.table_bucket_arn,
203 namespace: self.namespace,
204 name: self.name,
205 format: self.format,
206 metadata: self.metadata,
207 encryption_configuration: self.encryption_configuration,
208 tags: self.tags,
209 })
210 }
211}