aws_sdk_s3/operation/get_bucket_metadata_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_bucket_metadata_configuration::_get_bucket_metadata_configuration_output::GetBucketMetadataConfigurationOutputBuilder;
3
4pub use crate::operation::get_bucket_metadata_configuration::_get_bucket_metadata_configuration_input::GetBucketMetadataConfigurationInputBuilder;
5
6impl crate::operation::get_bucket_metadata_configuration::builders::GetBucketMetadataConfigurationInputBuilder {
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::get_bucket_metadata_configuration::GetBucketMetadataConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_bucket_metadata_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetBucketMetadataConfiguration`.
24///
25/// <p>Retrieves the 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><note>
26/// <p>You can use the V2 <code>GetBucketMetadataConfiguration</code> API operation with V1 or V2 metadata configurations. However, if you try to use the V1 <code>GetBucketMetadataTableConfiguration</code> API operation with V2 configurations, you will receive an HTTP <code>405 Method Not Allowed</code> error.</p>
27/// </note>
28/// <dl>
29/// <dt>
30/// Permissions
31/// </dt>
32/// <dd>
33/// <p>To use this operation, you must have the <code>s3:GetBucketMetadataTableConfiguration</code> permission. 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><note>
34/// <p>The IAM policy action name is the same for the V1 and V2 API operations.</p>
35/// </note>
36/// </dd>
37/// </dl>
38/// <p>The following operations are related to <code>GetBucketMetadataConfiguration</code>:</p>
39/// <ul>
40/// <li>
41/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a></p></li>
42/// <li>
43/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataConfiguration.html">DeleteBucketMetadataConfiguration</a></p></li>
44/// <li>
45/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataInventoryTableConfiguration.html">UpdateBucketMetadataInventoryTableConfiguration</a></p></li>
46/// <li>
47/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateBucketMetadataJournalTableConfiguration.html">UpdateBucketMetadataJournalTableConfiguration</a></p></li>
48/// </ul><important>
49/// <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>
50/// </important>
51#[derive(::std::clone::Clone, ::std::fmt::Debug)]
52pub struct GetBucketMetadataConfigurationFluentBuilder {
53    handle: ::std::sync::Arc<crate::client::Handle>,
54    inner: crate::operation::get_bucket_metadata_configuration::builders::GetBucketMetadataConfigurationInputBuilder,
55    config_override: ::std::option::Option<crate::config::Builder>,
56}
57impl
58    crate::client::customize::internal::CustomizableSend<
59        crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationOutput,
60        crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationError,
61    > for GetBucketMetadataConfigurationFluentBuilder
62{
63    fn send(
64        self,
65        config_override: crate::config::Builder,
66    ) -> crate::client::customize::internal::BoxFuture<
67        crate::client::customize::internal::SendResult<
68            crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationOutput,
69            crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationError,
70        >,
71    > {
72        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
73    }
74}
75impl GetBucketMetadataConfigurationFluentBuilder {
76    /// Creates a new `GetBucketMetadataConfigurationFluentBuilder`.
77    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
78        Self {
79            handle,
80            inner: ::std::default::Default::default(),
81            config_override: ::std::option::Option::None,
82        }
83    }
84    /// Access the GetBucketMetadataConfiguration as a reference.
85    pub fn as_input(&self) -> &crate::operation::get_bucket_metadata_configuration::builders::GetBucketMetadataConfigurationInputBuilder {
86        &self.inner
87    }
88    /// Sends the request and returns the response.
89    ///
90    /// If an error occurs, an `SdkError` will be returned with additional details that
91    /// can be matched against.
92    ///
93    /// By default, any retryable failures will be retried twice. Retry behavior
94    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
95    /// set when configuring the client.
96    pub async fn send(
97        self,
98    ) -> ::std::result::Result<
99        crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationOutput,
100        ::aws_smithy_runtime_api::client::result::SdkError<
101            crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationError,
102            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
103        >,
104    > {
105        let input = self
106            .inner
107            .build()
108            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
109        let runtime_plugins = crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfiguration::operation_runtime_plugins(
110            self.handle.runtime_plugins.clone(),
111            &self.handle.conf,
112            self.config_override,
113        );
114        crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfiguration::orchestrate(&runtime_plugins, input).await
115    }
116
117    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
118    pub fn customize(
119        self,
120    ) -> crate::client::customize::CustomizableOperation<
121        crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationOutput,
122        crate::operation::get_bucket_metadata_configuration::GetBucketMetadataConfigurationError,
123        Self,
124    > {
125        crate::client::customize::CustomizableOperation::new(self)
126    }
127    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
128        self.set_config_override(::std::option::Option::Some(config_override.into()));
129        self
130    }
131
132    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
133        self.config_override = config_override;
134        self
135    }
136    /// <p>The general purpose bucket that corresponds to the metadata configuration that you want to retrieve.</p>
137    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.bucket(input.into());
139        self
140    }
141    /// <p>The general purpose bucket that corresponds to the metadata configuration that you want to retrieve.</p>
142    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_bucket(input);
144        self
145    }
146    /// <p>The general purpose bucket that corresponds to the metadata configuration that you want to retrieve.</p>
147    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_bucket()
149    }
150    /// <p>The expected owner of the general purpose bucket that you want to retrieve the metadata table configuration for.</p>
151    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        self.inner = self.inner.expected_bucket_owner(input.into());
153        self
154    }
155    /// <p>The expected owner of the general purpose bucket that you want to retrieve the metadata table configuration for.</p>
156    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157        self.inner = self.inner.set_expected_bucket_owner(input);
158        self
159    }
160    /// <p>The expected owner of the general purpose bucket that you want to retrieve the metadata table configuration for.</p>
161    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
162        self.inner.get_expected_bucket_owner()
163    }
164}