aws_sdk_s3/operation/create_bucket_metadata_table_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_bucket_metadata_table_configuration::_create_bucket_metadata_table_configuration_output::CreateBucketMetadataTableConfigurationOutputBuilder;
3
4pub use crate::operation::create_bucket_metadata_table_configuration::_create_bucket_metadata_table_configuration_input::CreateBucketMetadataTableConfigurationInputBuilder;
5
6impl crate::operation::create_bucket_metadata_table_configuration::builders::CreateBucketMetadataTableConfigurationInputBuilder {
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_bucket_metadata_table_configuration::CreateBucketMetadataTableConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_bucket_metadata_table_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateBucketMetadataTableConfiguration`.
24///
25/// <important>
26/// <p>We recommend that you create your S3 Metadata configurations by using the V2 <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a> API operation. We no longer recommend using the V1 <code>CreateBucketMetadataTableConfiguration</code> API operation.</p>
27/// <p>If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re-create your configuration by using <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a> so that you can expire journal table records and create a live inventory table.</p>
28/// </important>
29/// <p>Creates a V1 S3 Metadata configuration for a general purpose bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html">Accelerating data discovery with S3 Metadata</a> in the <i>Amazon S3 User Guide</i>.</p>
30/// <dl>
31/// <dt>
32/// Permissions
33/// </dt>
34/// <dd>
35/// <p>To use this operation, you must have the following permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html">Setting up permissions for configuring metadata tables</a> in the <i>Amazon S3 User Guide</i>.</p>
36/// <p>If you want to encrypt your metadata tables with server-side encryption with Key Management Service (KMS) keys (SSE-KMS), you need additional permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html"> Setting up permissions for configuring metadata tables</a> in the <i>Amazon S3 User Guide</i>.</p>
37/// <p>If you also want to integrate your table bucket with Amazon Web Services analytics services so that you can query your metadata table, you need additional permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-integrating-aws.html"> Integrating Amazon S3 Tables with Amazon Web Services analytics services</a> in the <i>Amazon S3 User Guide</i>.</p>
38/// <ul>
39/// <li>
40/// <p><code>s3:CreateBucketMetadataTableConfiguration</code></p></li>
41/// <li>
42/// <p><code>s3tables:CreateNamespace</code></p></li>
43/// <li>
44/// <p><code>s3tables:GetTable</code></p></li>
45/// <li>
46/// <p><code>s3tables:CreateTable</code></p></li>
47/// <li>
48/// <p><code>s3tables:PutTablePolicy</code></p></li>
49/// </ul>
50/// </dd>
51/// </dl>
52/// <p>The following operations are related to <code>CreateBucketMetadataTableConfiguration</code>:</p>
53/// <ul>
54/// <li>
55/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataTableConfiguration.html">DeleteBucketMetadataTableConfiguration</a></p></li>
56/// <li>
57/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataTableConfiguration.html">GetBucketMetadataTableConfiguration</a></p></li>
58/// </ul><important>
59/// <p>You must URL encode any signed header values that contain spaces. For example, if your header value is <code>my file.txt</code>, containing two spaces after <code>my</code>, you must URL encode this value to <code>my%20%20file.txt</code>.</p>
60/// </important>
61#[derive(::std::clone::Clone, ::std::fmt::Debug)]
62pub struct CreateBucketMetadataTableConfigurationFluentBuilder {
63    handle: ::std::sync::Arc<crate::client::Handle>,
64    inner: crate::operation::create_bucket_metadata_table_configuration::builders::CreateBucketMetadataTableConfigurationInputBuilder,
65    config_override: ::std::option::Option<crate::config::Builder>,
66}
67impl
68    crate::client::customize::internal::CustomizableSend<
69        crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfigurationOutput,
70        crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfigurationError,
71    > for CreateBucketMetadataTableConfigurationFluentBuilder
72{
73    fn send(
74        self,
75        config_override: crate::config::Builder,
76    ) -> crate::client::customize::internal::BoxFuture<
77        crate::client::customize::internal::SendResult<
78            crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfigurationOutput,
79            crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfigurationError,
80        >,
81    > {
82        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
83    }
84}
85impl CreateBucketMetadataTableConfigurationFluentBuilder {
86    /// Creates a new `CreateBucketMetadataTableConfigurationFluentBuilder`.
87    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
88        Self {
89            handle,
90            inner: ::std::default::Default::default(),
91            config_override: ::std::option::Option::None,
92        }
93    }
94    /// Access the CreateBucketMetadataTableConfiguration as a reference.
95    pub fn as_input(
96        &self,
97    ) -> &crate::operation::create_bucket_metadata_table_configuration::builders::CreateBucketMetadataTableConfigurationInputBuilder {
98        &self.inner
99    }
100    /// Sends the request and returns the response.
101    ///
102    /// If an error occurs, an `SdkError` will be returned with additional details that
103    /// can be matched against.
104    ///
105    /// By default, any retryable failures will be retried twice. Retry behavior
106    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
107    /// set when configuring the client.
108    pub async fn send(
109        self,
110    ) -> ::std::result::Result<
111        crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfigurationOutput,
112        ::aws_smithy_runtime_api::client::result::SdkError<
113            crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfigurationError,
114            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
115        >,
116    > {
117        let input = self
118            .inner
119            .build()
120            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
121        let runtime_plugins =
122            crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfiguration::operation_runtime_plugins(
123                self.handle.runtime_plugins.clone(),
124                &self.handle.conf,
125                self.config_override,
126            );
127        crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfiguration::orchestrate(&runtime_plugins, input)
128            .await
129    }
130
131    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
132    pub fn customize(
133        self,
134    ) -> crate::client::customize::CustomizableOperation<
135        crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfigurationOutput,
136        crate::operation::create_bucket_metadata_table_configuration::CreateBucketMetadataTableConfigurationError,
137        Self,
138    > {
139        crate::client::customize::CustomizableOperation::new(self)
140    }
141    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
142        self.set_config_override(::std::option::Option::Some(config_override.into()));
143        self
144    }
145
146    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
147        self.config_override = config_override;
148        self
149    }
150    /// <p>The general purpose bucket that you want to create the metadata table configuration for.</p>
151    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        self.inner = self.inner.bucket(input.into());
153        self
154    }
155    /// <p>The general purpose bucket that you want to create the metadata table configuration for.</p>
156    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157        self.inner = self.inner.set_bucket(input);
158        self
159    }
160    /// <p>The general purpose bucket that you want to create the metadata table configuration for.</p>
161    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
162        self.inner.get_bucket()
163    }
164    /// <p>The <code>Content-MD5</code> header for the metadata table configuration.</p>
165    pub fn content_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.inner = self.inner.content_md5(input.into());
167        self
168    }
169    /// <p>The <code>Content-MD5</code> header for the metadata table configuration.</p>
170    pub fn set_content_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.inner = self.inner.set_content_md5(input);
172        self
173    }
174    /// <p>The <code>Content-MD5</code> header for the metadata table configuration.</p>
175    pub fn get_content_md5(&self) -> &::std::option::Option<::std::string::String> {
176        self.inner.get_content_md5()
177    }
178    /// <p>The checksum algorithm to use with your metadata table configuration.</p>
179    pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
180        self.inner = self.inner.checksum_algorithm(input);
181        self
182    }
183    /// <p>The checksum algorithm to use with your metadata table configuration.</p>
184    pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
185        self.inner = self.inner.set_checksum_algorithm(input);
186        self
187    }
188    /// <p>The checksum algorithm to use with your metadata table configuration.</p>
189    pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
190        self.inner.get_checksum_algorithm()
191    }
192    /// <p>The contents of your metadata table configuration.</p>
193    pub fn metadata_table_configuration(mut self, input: crate::types::MetadataTableConfiguration) -> Self {
194        self.inner = self.inner.metadata_table_configuration(input);
195        self
196    }
197    /// <p>The contents of your metadata table configuration.</p>
198    pub fn set_metadata_table_configuration(mut self, input: ::std::option::Option<crate::types::MetadataTableConfiguration>) -> Self {
199        self.inner = self.inner.set_metadata_table_configuration(input);
200        self
201    }
202    /// <p>The contents of your metadata table configuration.</p>
203    pub fn get_metadata_table_configuration(&self) -> &::std::option::Option<crate::types::MetadataTableConfiguration> {
204        self.inner.get_metadata_table_configuration()
205    }
206    /// <p>The expected owner of the general purpose bucket that corresponds to your metadata table configuration.</p>
207    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.expected_bucket_owner(input.into());
209        self
210    }
211    /// <p>The expected owner of the general purpose bucket that corresponds to your metadata table configuration.</p>
212    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.inner = self.inner.set_expected_bucket_owner(input);
214        self
215    }
216    /// <p>The expected owner of the general purpose bucket that corresponds to your metadata table configuration.</p>
217    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
218        self.inner.get_expected_bucket_owner()
219    }
220}