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>You must have the <code>s3tables:TagResource</code> permission in addition to <code>s3tables:CreateTable</code> permission to create a table with tags.</p></li>
40/// </ul><note>
41/// <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>
42/// </note>
43/// </dd>
44/// </dl>
45#[derive(::std::clone::Clone, ::std::fmt::Debug)]
46pub struct CreateTableFluentBuilder {
47 handle: ::std::sync::Arc<crate::client::Handle>,
48 inner: crate::operation::create_table::builders::CreateTableInputBuilder,
49 config_override: ::std::option::Option<crate::config::Builder>,
50}
51impl
52 crate::client::customize::internal::CustomizableSend<
53 crate::operation::create_table::CreateTableOutput,
54 crate::operation::create_table::CreateTableError,
55 > for CreateTableFluentBuilder
56{
57 fn send(
58 self,
59 config_override: crate::config::Builder,
60 ) -> crate::client::customize::internal::BoxFuture<
61 crate::client::customize::internal::SendResult<
62 crate::operation::create_table::CreateTableOutput,
63 crate::operation::create_table::CreateTableError,
64 >,
65 > {
66 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
67 }
68}
69impl CreateTableFluentBuilder {
70 /// Creates a new `CreateTableFluentBuilder`.
71 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
72 Self {
73 handle,
74 inner: ::std::default::Default::default(),
75 config_override: ::std::option::Option::None,
76 }
77 }
78 /// Access the CreateTable as a reference.
79 pub fn as_input(&self) -> &crate::operation::create_table::builders::CreateTableInputBuilder {
80 &self.inner
81 }
82 /// Sends the request and returns the response.
83 ///
84 /// If an error occurs, an `SdkError` will be returned with additional details that
85 /// can be matched against.
86 ///
87 /// By default, any retryable failures will be retried twice. Retry behavior
88 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
89 /// set when configuring the client.
90 pub async fn send(
91 self,
92 ) -> ::std::result::Result<
93 crate::operation::create_table::CreateTableOutput,
94 ::aws_smithy_runtime_api::client::result::SdkError<
95 crate::operation::create_table::CreateTableError,
96 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
97 >,
98 > {
99 let input = self
100 .inner
101 .build()
102 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
103 let runtime_plugins = crate::operation::create_table::CreateTable::operation_runtime_plugins(
104 self.handle.runtime_plugins.clone(),
105 &self.handle.conf,
106 self.config_override,
107 );
108 crate::operation::create_table::CreateTable::orchestrate(&runtime_plugins, input).await
109 }
110
111 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
112 pub fn customize(
113 self,
114 ) -> crate::client::customize::CustomizableOperation<
115 crate::operation::create_table::CreateTableOutput,
116 crate::operation::create_table::CreateTableError,
117 Self,
118 > {
119 crate::client::customize::CustomizableOperation::new(self)
120 }
121 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
122 self.set_config_override(::std::option::Option::Some(config_override.into()));
123 self
124 }
125
126 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
127 self.config_override = config_override;
128 self
129 }
130 /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
131 pub fn table_bucket_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132 self.inner = self.inner.table_bucket_arn(input.into());
133 self
134 }
135 /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
136 pub fn set_table_bucket_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.inner = self.inner.set_table_bucket_arn(input);
138 self
139 }
140 /// <p>The Amazon Resource Name (ARN) of the table bucket to create the table in.</p>
141 pub fn get_table_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
142 self.inner.get_table_bucket_arn()
143 }
144 /// <p>The namespace to associated with the table.</p>
145 pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.inner = self.inner.namespace(input.into());
147 self
148 }
149 /// <p>The namespace to associated with the table.</p>
150 pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151 self.inner = self.inner.set_namespace(input);
152 self
153 }
154 /// <p>The namespace to associated with the table.</p>
155 pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
156 self.inner.get_namespace()
157 }
158 /// <p>The name for the table.</p>
159 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.inner = self.inner.name(input.into());
161 self
162 }
163 /// <p>The name for the table.</p>
164 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.inner = self.inner.set_name(input);
166 self
167 }
168 /// <p>The name for the table.</p>
169 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
170 self.inner.get_name()
171 }
172 /// <p>The format for the table.</p>
173 pub fn format(mut self, input: crate::types::OpenTableFormat) -> Self {
174 self.inner = self.inner.format(input);
175 self
176 }
177 /// <p>The format for the table.</p>
178 pub fn set_format(mut self, input: ::std::option::Option<crate::types::OpenTableFormat>) -> Self {
179 self.inner = self.inner.set_format(input);
180 self
181 }
182 /// <p>The format for the table.</p>
183 pub fn get_format(&self) -> &::std::option::Option<crate::types::OpenTableFormat> {
184 self.inner.get_format()
185 }
186 /// <p>The metadata for the table.</p>
187 pub fn metadata(mut self, input: crate::types::TableMetadata) -> Self {
188 self.inner = self.inner.metadata(input);
189 self
190 }
191 /// <p>The metadata for the table.</p>
192 pub fn set_metadata(mut self, input: ::std::option::Option<crate::types::TableMetadata>) -> Self {
193 self.inner = self.inner.set_metadata(input);
194 self
195 }
196 /// <p>The metadata for the table.</p>
197 pub fn get_metadata(&self) -> &::std::option::Option<crate::types::TableMetadata> {
198 self.inner.get_metadata()
199 }
200 /// <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>
201 /// <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>
202 /// </note>
203 pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
204 self.inner = self.inner.encryption_configuration(input);
205 self
206 }
207 /// <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>
208 /// <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>
209 /// </note>
210 pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
211 self.inner = self.inner.set_encryption_configuration(input);
212 self
213 }
214 /// <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>
215 /// <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>
216 /// </note>
217 pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
218 self.inner.get_encryption_configuration()
219 }
220 ///
221 /// Adds a key-value pair to `tags`.
222 ///
223 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
224 ///
225 /// <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>
226 /// <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>
227 /// </note>
228 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
229 self.inner = self.inner.tags(k.into(), v.into());
230 self
231 }
232 /// <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>
233 /// <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>
234 /// </note>
235 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
236 self.inner = self.inner.set_tags(input);
237 self
238 }
239 /// <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>
240 /// <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>
241 /// </note>
242 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
243 self.inner.get_tags()
244 }
245}