Skip to main content

aws_sdk_s3/operation/update_bucket_metadata_annotation_table_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_bucket_metadata_annotation_table_configuration::_update_bucket_metadata_annotation_table_configuration_input::UpdateBucketMetadataAnnotationTableConfigurationInputBuilder;
3
4pub use crate::operation::update_bucket_metadata_annotation_table_configuration::_update_bucket_metadata_annotation_table_configuration_output::UpdateBucketMetadataAnnotationTableConfigurationOutputBuilder;
5
6impl crate::operation::update_bucket_metadata_annotation_table_configuration::builders::UpdateBucketMetadataAnnotationTableConfigurationInputBuilder {
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::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_bucket_metadata_annotation_table_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateBucketMetadataAnnotationTableConfiguration`.
24///
25/// <p>Updates the annotation table configuration for an Amazon S3 bucket's metadata configuration. Use this operation to enable or disable the annotation table, or to update its associated IAM role.</p>
26/// <p>An annotation table is a queryable Iceberg table that contains records of all annotations attached to objects in the bucket. To use this operation, the bucket must have an existing Amazon S3 Metadata configuration.</p>
27/// <p>To use this operation, you must have the <code>s3:UpdateBucketMetadataAnnotationTableConfiguration</code> permission. If you are specifying or changing the IAM role, you must also have <code>iam:PassRole</code> permission for the role.</p>
28/// <p>The IAM role must have a trust policy that allows the Amazon S3 metadata service to assume it, and a permissions policy that grants the actions needed to read annotations from your bucket. The following examples show a trust policy and a permissions policy that you can adapt for your bucket and account.</p>
29/// <p>The following operations are related to <code>UpdateBucketMetadataAnnotationTableConfiguration</code>:</p>
30/// <ul>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataConfiguration.html">CreateBucketMetadataConfiguration</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataConfiguration.html">GetBucketMetadataConfiguration</a></p></li>
35/// </ul>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct UpdateBucketMetadataAnnotationTableConfigurationFluentBuilder {
38                handle: ::std::sync::Arc<crate::client::Handle>,
39                inner: crate::operation::update_bucket_metadata_annotation_table_configuration::builders::UpdateBucketMetadataAnnotationTableConfigurationInputBuilder,
40config_override: ::std::option::Option<crate::config::Builder>,
41            }
42impl
43    crate::client::customize::internal::CustomizableSend<
44        crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfigurationOutput,
45        crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfigurationError,
46    > for UpdateBucketMetadataAnnotationTableConfigurationFluentBuilder
47{
48    fn send(
49        self,
50        config_override: crate::config::Builder,
51    ) -> crate::client::customize::internal::BoxFuture<
52        crate::client::customize::internal::SendResult<
53            crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfigurationOutput,
54            crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfigurationError,
55        >,
56    > {
57        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58    }
59}
60impl UpdateBucketMetadataAnnotationTableConfigurationFluentBuilder {
61    /// Creates a new `UpdateBucketMetadataAnnotationTableConfigurationFluentBuilder`.
62    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63        Self {
64            handle,
65            inner: ::std::default::Default::default(),
66            config_override: ::std::option::Option::None,
67        }
68    }
69    /// Access the UpdateBucketMetadataAnnotationTableConfiguration as a reference.
70    pub fn as_input(&self) -> &crate::operation::update_bucket_metadata_annotation_table_configuration::builders::UpdateBucketMetadataAnnotationTableConfigurationInputBuilder{
71        &self.inner
72    }
73    /// Sends the request and returns the response.
74    ///
75    /// If an error occurs, an `SdkError` will be returned with additional details that
76    /// can be matched against.
77    ///
78    /// By default, any retryable failures will be retried twice. Retry behavior
79    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
80    /// set when configuring the client.
81    pub async fn send(
82        self,
83    ) -> ::std::result::Result<
84        crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfigurationOutput,
85        ::aws_smithy_runtime_api::client::result::SdkError<
86            crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfigurationError,
87            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
88        >,
89    > {
90        let input = self
91            .inner
92            .build()
93            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
94        let runtime_plugins = crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfiguration::operation_runtime_plugins(
95                            self.handle.runtime_plugins.clone(),
96                            &self.handle.conf,
97                            self.config_override,
98                        );
99        crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfiguration::orchestrate(
100            &runtime_plugins,
101            input,
102        )
103        .await
104    }
105
106    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107    pub fn customize(
108        self,
109    ) -> crate::client::customize::CustomizableOperation<
110        crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfigurationOutput,
111        crate::operation::update_bucket_metadata_annotation_table_configuration::UpdateBucketMetadataAnnotationTableConfigurationError,
112        Self,
113    > {
114        crate::client::customize::CustomizableOperation::new(self)
115    }
116    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117        self.set_config_override(::std::option::Option::Some(config_override.into()));
118        self
119    }
120
121    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122        self.config_override = config_override;
123        self
124    }
125    /// <p>The name of the bucket whose annotation table configuration to update.</p>
126    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.bucket(input.into());
128        self
129    }
130    /// <p>The name of the bucket whose annotation table configuration to update.</p>
131    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_bucket(input);
133        self
134    }
135    /// <p>The name of the bucket whose annotation table configuration to update.</p>
136    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_bucket()
138    }
139    /// <p>Base64-encoded MD5 digest of the message body.</p>
140    pub fn content_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.content_md5(input.into());
142        self
143    }
144    /// <p>Base64-encoded MD5 digest of the message body.</p>
145    pub fn set_content_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_content_md5(input);
147        self
148    }
149    /// <p>Base64-encoded MD5 digest of the message body.</p>
150    pub fn get_content_md5(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_content_md5()
152    }
153    /// <p>Checksum algorithm for the request payload.</p>
154    pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
155        self.inner = self.inner.checksum_algorithm(input);
156        self
157    }
158    /// <p>Checksum algorithm for the request payload.</p>
159    pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
160        self.inner = self.inner.set_checksum_algorithm(input);
161        self
162    }
163    /// <p>Checksum algorithm for the request payload.</p>
164    pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
165        self.inner.get_checksum_algorithm()
166    }
167    /// <p>The annotation table configuration updates to apply.</p>
168    pub fn annotation_table_configuration(mut self, input: crate::types::AnnotationTableConfigurationUpdates) -> Self {
169        self.inner = self.inner.annotation_table_configuration(input);
170        self
171    }
172    /// <p>The annotation table configuration updates to apply.</p>
173    pub fn set_annotation_table_configuration(mut self, input: ::std::option::Option<crate::types::AnnotationTableConfigurationUpdates>) -> Self {
174        self.inner = self.inner.set_annotation_table_configuration(input);
175        self
176    }
177    /// <p>The annotation table configuration updates to apply.</p>
178    pub fn get_annotation_table_configuration(&self) -> &::std::option::Option<crate::types::AnnotationTableConfigurationUpdates> {
179        self.inner.get_annotation_table_configuration()
180    }
181    /// <p>The account ID of the expected bucket owner.</p>
182    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.expected_bucket_owner(input.into());
184        self
185    }
186    /// <p>The account ID of the expected bucket owner.</p>
187    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_expected_bucket_owner(input);
189        self
190    }
191    /// <p>The account ID of the expected bucket owner.</p>
192    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_expected_bucket_owner()
194    }
195}