aws_sdk_s3tables/operation/create_table/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_table::_create_table_output::CreateTableOutputBuilder;
3
4pub use crate::operation::create_table::_create_table_input::CreateTableInputBuilder;
5
6impl crate::operation::create_table::builders::CreateTableInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_table::CreateTableOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_table::CreateTableError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_table();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateTable`.
24///
25/// <p>Creates a new table associated with the given namespace in a table bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-create.html">Creating an Amazon S3 table</a> in the <i>Amazon Simple Storage Service User Guide</i>.</p>
26/// <dl>
27/// <dt>
28/// Permissions
29/// </dt>
30/// <dd>
31/// <ul>
32/// <li>
33/// <p>You must have the <code>s3tables:CreateTable</code> permission to use this operation.</p></li>
34/// <li>
35/// <p>If you use this operation with the optional <code>metadata</code> request parameter you must have the <code>s3tables:PutTableData</code> permission.</p></li>
36/// <li>
37/// <p>If you use this operation with the optional <code>encryptionConfiguration</code> request parameter you must have the <code>s3tables:PutTableEncryption</code> permission.</p></li>
38/// <li>
39/// <p>If you use this operation with the <code>storageClassConfiguration</code> request parameter, you must have the <code>s3tables:PutTableStorageClass</code> permission.</p></li>
40/// <li>
41/// <p>To create a table with tags, you must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTable</code> permission.</p></li>
42/// </ul><note>
43/// <p>Additionally, 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>
44/// </note>
45/// </dd>
46/// </dl>
47#[derive(::std::clone::Clone, ::std::fmt::Debug)]
48pub struct CreateTableFluentBuilder {
49    handle: ::std::sync::Arc<crate::client::Handle>,
50    inner: crate::operation::create_table::builders::CreateTableInputBuilder,
51    config_override: ::std::option::Option<crate::config::Builder>,
52}
53impl
54    crate::client::customize::internal::CustomizableSend<
55        crate::operation::create_table::CreateTableOutput,
56        crate::operation::create_table::CreateTableError,
57    > for CreateTableFluentBuilder
58{
59    fn send(
60        self,
61        config_override: crate::config::Builder,
62    ) -> crate::client::customize::internal::BoxFuture<
63        crate::client::customize::internal::SendResult<
64            crate::operation::create_table::CreateTableOutput,
65            crate::operation::create_table::CreateTableError,
66        >,
67    > {
68        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
69    }
70}
71impl CreateTableFluentBuilder {
72    /// Creates a new `CreateTableFluentBuilder`.
73    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
74        Self {
75            handle,
76            inner: ::std::default::Default::default(),
77            config_override: ::std::option::Option::None,
78        }
79    }
80    /// Access the CreateTable as a reference.
81    pub fn as_input(&self) -> &crate::operation::create_table::builders::CreateTableInputBuilder {
82        &self.inner
83    }
84    /// Sends the request and returns the response.
85    ///
86    /// If an error occurs, an `SdkError` will be returned with additional details that
87    /// can be matched against.
88    ///
89    /// By default, any retryable failures will be retried twice. Retry behavior
90    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
91    /// set when configuring the client.
92    pub async fn send(
93        self,
94    ) -> ::std::result::Result<
95        crate::operation::create_table::CreateTableOutput,
96        ::aws_smithy_runtime_api::client::result::SdkError<
97            crate::operation::create_table::CreateTableError,
98            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
99        >,
100    > {
101        let input = self
102            .inner
103            .build()
104            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
105        let runtime_plugins = crate::operation::create_table::CreateTable::operation_runtime_plugins(
106            self.handle.runtime_plugins.clone(),
107            &self.handle.conf,
108            self.config_override,
109        );
110        crate::operation::create_table::CreateTable::orchestrate(&runtime_plugins, input).await
111    }
112
113    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
114    pub fn customize(
115        self,
116    ) -> crate::client::customize::CustomizableOperation<
117        crate::operation::create_table::CreateTableOutput,
118        crate::operation::create_table::CreateTableError,
119        Self,
120    > {
121        crate::client::customize::CustomizableOperation::new(self)
122    }
123    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
124        self.set_config_override(::std::option::Option::Some(config_override.into()));
125        self
126    }
127
128    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
129        self.config_override = config_override;
130        self
131    }
132    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
133    pub fn table_bucket_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.table_bucket_arn(input.into());
135        self
136    }
137    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
138    pub fn set_table_bucket_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_table_bucket_arn(input);
140        self
141    }
142    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
143    pub fn get_table_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_table_bucket_arn()
145    }
146    /// <p>The namespace to associated with the table.</p>
147    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.namespace(input.into());
149        self
150    }
151    /// <p>The namespace to associated with the table.</p>
152    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_namespace(input);
154        self
155    }
156    /// <p>The namespace to associated with the table.</p>
157    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_namespace()
159    }
160    /// <p>The name for the table.</p>
161    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.name(input.into());
163        self
164    }
165    /// <p>The name for the table.</p>
166    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_name(input);
168        self
169    }
170    /// <p>The name for the table.</p>
171    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_name()
173    }
174    /// <p>The format for the table.</p>
175    pub fn format(mut self, input: crate::types::OpenTableFormat) -> Self {
176        self.inner = self.inner.format(input);
177        self
178    }
179    /// <p>The format for the table.</p>
180    pub fn set_format(mut self, input: ::std::option::Option<crate::types::OpenTableFormat>) -> Self {
181        self.inner = self.inner.set_format(input);
182        self
183    }
184    /// <p>The format for the table.</p>
185    pub fn get_format(&self) -> &::std::option::Option<crate::types::OpenTableFormat> {
186        self.inner.get_format()
187    }
188    /// <p>The metadata for the table.</p>
189    pub fn metadata(mut self, input: crate::types::TableMetadata) -> Self {
190        self.inner = self.inner.metadata(input);
191        self
192    }
193    /// <p>The metadata for the table.</p>
194    pub fn set_metadata(mut self, input: ::std::option::Option<crate::types::TableMetadata>) -> Self {
195        self.inner = self.inner.set_metadata(input);
196        self
197    }
198    /// <p>The metadata for the table.</p>
199    pub fn get_metadata(&self) -> &::std::option::Option<crate::types::TableMetadata> {
200        self.inner.get_metadata()
201    }
202    /// <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>
203    /// <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>
204    /// </note>
205    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
206        self.inner = self.inner.encryption_configuration(input);
207        self
208    }
209    /// <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>
210    /// <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>
211    /// </note>
212    pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
213        self.inner = self.inner.set_encryption_configuration(input);
214        self
215    }
216    /// <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>
217    /// <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>
218    /// </note>
219    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
220        self.inner.get_encryption_configuration()
221    }
222    /// <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>
223    pub fn storage_class_configuration(mut self, input: crate::types::StorageClassConfiguration) -> Self {
224        self.inner = self.inner.storage_class_configuration(input);
225        self
226    }
227    /// <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>
228    pub fn set_storage_class_configuration(mut self, input: ::std::option::Option<crate::types::StorageClassConfiguration>) -> Self {
229        self.inner = self.inner.set_storage_class_configuration(input);
230        self
231    }
232    /// <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>
233    pub fn get_storage_class_configuration(&self) -> &::std::option::Option<crate::types::StorageClassConfiguration> {
234        self.inner.get_storage_class_configuration()
235    }
236    ///
237    /// Adds a key-value pair to `tags`.
238    ///
239    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
240    ///
241    /// <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>
242    /// <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>
243    /// </note>
244    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.inner = self.inner.tags(k.into(), v.into());
246        self
247    }
248    /// <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>
249    /// <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>
250    /// </note>
251    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
252        self.inner = self.inner.set_tags(input);
253        self
254    }
255    /// <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>
256    /// <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>
257    /// </note>
258    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
259        self.inner.get_tags()
260    }
261}