aws_sdk_s3/operation/create_bucket_metadata_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_bucket_metadata_configuration::_create_bucket_metadata_configuration_output::CreateBucketMetadataConfigurationOutputBuilder;
3
4pub use crate::operation::create_bucket_metadata_configuration::_create_bucket_metadata_configuration_input::CreateBucketMetadataConfigurationInputBuilder;
5
6impl crate::operation::create_bucket_metadata_configuration::builders::CreateBucketMetadataConfigurationInputBuilder {
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_configuration::CreateBucketMetadataConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_bucket_metadata_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateBucketMetadataConfiguration`.
24///
25/// <p>Creates an S3 Metadata V2 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>
26/// <dl>
27/// <dt>
28/// Permissions
29/// </dt>
30/// <dd>
31/// <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>
32/// <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 in your KMS key policy. 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>
33/// <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>
34/// <p>To query your metadata tables, you need additional permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-bucket-query-permissions.html"> Permissions for querying metadata tables</a> in the <i>Amazon S3 User Guide</i>.</p>
35/// <ul>
36/// <li>
37/// <p><code>s3:CreateBucketMetadataTableConfiguration</code></p><note>
38/// <p>The IAM policy action name is the same for the V1 and V2 API operations.</p>
39/// </note></li>
40/// <li>
41/// <p><code>s3tables:CreateTableBucket</code></p></li>
42/// <li>
43/// <p><code>s3tables:CreateNamespace</code></p></li>
44/// <li>
45/// <p><code>s3tables:GetTable</code></p></li>
46/// <li>
47/// <p><code>s3tables:CreateTable</code></p></li>
48/// <li>
49/// <p><code>s3tables:PutTablePolicy</code></p></li>
50/// <li>
51/// <p><code>s3tables:PutTableEncryption</code></p></li>
52/// <li>
53/// <p><code>kms:DescribeKey</code></p></li>
54/// </ul>
55/// </dd>
56/// </dl>
57/// <p>The following operations are related to <code>CreateBucketMetadataConfiguration</code>:</p>
58/// <ul>
59/// <li>
60/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataConfiguration.html">DeleteBucketMetadataConfiguration</a></p></li>
61/// <li>
62/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataConfiguration.html">GetBucketMetadataConfiguration</a></p></li>
63/// <li>
64/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataInventoryTableConfiguration.html">UpdateBucketMetadataInventoryTableConfiguration</a></p></li>
65/// <li>
66/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataJournalTableConfiguration.html">UpdateBucketMetadataJournalTableConfiguration</a></p></li>
67/// </ul><important>
68/// <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>
69/// </important>
70#[derive(::std::clone::Clone, ::std::fmt::Debug)]
71pub struct CreateBucketMetadataConfigurationFluentBuilder {
72    handle: ::std::sync::Arc<crate::client::Handle>,
73    inner: crate::operation::create_bucket_metadata_configuration::builders::CreateBucketMetadataConfigurationInputBuilder,
74    config_override: ::std::option::Option<crate::config::Builder>,
75}
76impl
77    crate::client::customize::internal::CustomizableSend<
78        crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfigurationOutput,
79        crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfigurationError,
80    > for CreateBucketMetadataConfigurationFluentBuilder
81{
82    fn send(
83        self,
84        config_override: crate::config::Builder,
85    ) -> crate::client::customize::internal::BoxFuture<
86        crate::client::customize::internal::SendResult<
87            crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfigurationOutput,
88            crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfigurationError,
89        >,
90    > {
91        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
92    }
93}
94impl CreateBucketMetadataConfigurationFluentBuilder {
95    /// Creates a new `CreateBucketMetadataConfigurationFluentBuilder`.
96    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
97        Self {
98            handle,
99            inner: ::std::default::Default::default(),
100            config_override: ::std::option::Option::None,
101        }
102    }
103    /// Access the CreateBucketMetadataConfiguration as a reference.
104    pub fn as_input(&self) -> &crate::operation::create_bucket_metadata_configuration::builders::CreateBucketMetadataConfigurationInputBuilder {
105        &self.inner
106    }
107    /// Sends the request and returns the response.
108    ///
109    /// If an error occurs, an `SdkError` will be returned with additional details that
110    /// can be matched against.
111    ///
112    /// By default, any retryable failures will be retried twice. Retry behavior
113    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
114    /// set when configuring the client.
115    pub async fn send(
116        self,
117    ) -> ::std::result::Result<
118        crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfigurationOutput,
119        ::aws_smithy_runtime_api::client::result::SdkError<
120            crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfigurationError,
121            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
122        >,
123    > {
124        let input = self
125            .inner
126            .build()
127            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
128        let runtime_plugins = crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfiguration::operation_runtime_plugins(
129            self.handle.runtime_plugins.clone(),
130            &self.handle.conf,
131            self.config_override,
132        );
133        crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfiguration::orchestrate(&runtime_plugins, input).await
134    }
135
136    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
137    pub fn customize(
138        self,
139    ) -> crate::client::customize::CustomizableOperation<
140        crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfigurationOutput,
141        crate::operation::create_bucket_metadata_configuration::CreateBucketMetadataConfigurationError,
142        Self,
143    > {
144        crate::client::customize::CustomizableOperation::new(self)
145    }
146    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
147        self.set_config_override(::std::option::Option::Some(config_override.into()));
148        self
149    }
150
151    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
152        self.config_override = config_override;
153        self
154    }
155    /// <p>The general purpose bucket that you want to create the metadata configuration for.</p>
156    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.bucket(input.into());
158        self
159    }
160    /// <p>The general purpose bucket that you want to create the metadata configuration for.</p>
161    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.inner = self.inner.set_bucket(input);
163        self
164    }
165    /// <p>The general purpose bucket that you want to create the metadata configuration for.</p>
166    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
167        self.inner.get_bucket()
168    }
169    /// <p>The <code>Content-MD5</code> header for the metadata configuration.</p>
170    pub fn content_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.content_md5(input.into());
172        self
173    }
174    /// <p>The <code>Content-MD5</code> header for the metadata configuration.</p>
175    pub fn set_content_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_content_md5(input);
177        self
178    }
179    /// <p>The <code>Content-MD5</code> header for the metadata configuration.</p>
180    pub fn get_content_md5(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_content_md5()
182    }
183    /// <p>The checksum algorithm to use with your metadata configuration.</p>
184    pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
185        self.inner = self.inner.checksum_algorithm(input);
186        self
187    }
188    /// <p>The checksum algorithm to use with your metadata configuration.</p>
189    pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
190        self.inner = self.inner.set_checksum_algorithm(input);
191        self
192    }
193    /// <p>The checksum algorithm to use with your metadata configuration.</p>
194    pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
195        self.inner.get_checksum_algorithm()
196    }
197    /// <p>The contents of your metadata configuration.</p>
198    pub fn metadata_configuration(mut self, input: crate::types::MetadataConfiguration) -> Self {
199        self.inner = self.inner.metadata_configuration(input);
200        self
201    }
202    /// <p>The contents of your metadata configuration.</p>
203    pub fn set_metadata_configuration(mut self, input: ::std::option::Option<crate::types::MetadataConfiguration>) -> Self {
204        self.inner = self.inner.set_metadata_configuration(input);
205        self
206    }
207    /// <p>The contents of your metadata configuration.</p>
208    pub fn get_metadata_configuration(&self) -> &::std::option::Option<crate::types::MetadataConfiguration> {
209        self.inner.get_metadata_configuration()
210    }
211    /// <p>The expected owner of the general purpose bucket that corresponds to your metadata configuration.</p>
212    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.expected_bucket_owner(input.into());
214        self
215    }
216    /// <p>The expected owner of the general purpose bucket that corresponds to your metadata configuration.</p>
217    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_expected_bucket_owner(input);
219        self
220    }
221    /// <p>The expected owner of the general purpose bucket that corresponds to your metadata configuration.</p>
222    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_expected_bucket_owner()
224    }
225}