aws_sdk_s3/operation/put_bucket_intelligent_tiering_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_bucket_intelligent_tiering_configuration::_put_bucket_intelligent_tiering_configuration_output::PutBucketIntelligentTieringConfigurationOutputBuilder;
3
4pub use crate::operation::put_bucket_intelligent_tiering_configuration::_put_bucket_intelligent_tiering_configuration_input::PutBucketIntelligentTieringConfigurationInputBuilder;
5
6impl crate::operation::put_bucket_intelligent_tiering_configuration::builders::PutBucketIntelligentTieringConfigurationInputBuilder {
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::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_bucket_intelligent_tiering_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutBucketIntelligentTieringConfiguration`.
24///
25/// <note>
26/// <p>This operation is not supported for directory buckets.</p>
27/// </note>
28/// <p>Puts a S3 Intelligent-Tiering configuration to the specified bucket. You can have up to 1,000 S3 Intelligent-Tiering configurations per bucket.</p>
29/// <p>The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost-effective storage access tier, without performance impact or operational overhead. S3 Intelligent-Tiering delivers automatic cost savings in three low latency and high throughput access tiers. To get the lowest storage cost on data that can be accessed in minutes to hours, you can choose to activate additional archiving capabilities.</p>
30/// <p>The S3 Intelligent-Tiering storage class is the ideal storage class for data with unknown, changing, or unpredictable access patterns, independent of object size or retention period. If the size of an object is less than 128 KB, it is not monitored and not eligible for auto-tiering. Smaller objects can be stored, but they are always charged at the Frequent Access tier rates in the S3 Intelligent-Tiering storage class.</p>
31/// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access">Storage class for automatically optimizing frequently and infrequently accessed objects</a>.</p>
32/// <p>Operations related to <code>PutBucketIntelligentTieringConfiguration</code> include:</p>
33/// <ul>
34/// <li>
35/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html">DeleteBucketIntelligentTieringConfiguration</a></p></li>
36/// <li>
37/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html">GetBucketIntelligentTieringConfiguration</a></p></li>
38/// <li>
39/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html">ListBucketIntelligentTieringConfigurations</a></p></li>
40/// </ul><note>
41/// <p>You only need S3 Intelligent-Tiering enabled on a bucket if you want to automatically move objects stored in the S3 Intelligent-Tiering storage class to the Archive Access or Deep Archive Access tier.</p>
42/// </note>
43/// <p><code>PutBucketIntelligentTieringConfiguration</code> has the following special errors:</p>
44/// <dl>
45/// <dt>
46/// HTTP 400 Bad Request Error
47/// </dt>
48/// <dd>
49/// <p><i>Code:</i> InvalidArgument</p>
50/// <p><i>Cause:</i> Invalid Argument</p>
51/// </dd>
52/// <dt>
53/// HTTP 400 Bad Request Error
54/// </dt>
55/// <dd>
56/// <p><i>Code:</i> TooManyConfigurations</p>
57/// <p><i>Cause:</i> You are attempting to create a new configuration but have already reached the 1,000-configuration limit.</p>
58/// </dd>
59/// <dt>
60/// HTTP 403 Forbidden Error
61/// </dt>
62/// <dd>
63/// <p><i>Cause:</i> You are not the owner of the specified bucket, or you do not have the <code>s3:PutIntelligentTieringConfiguration</code> bucket permission to set the configuration on the bucket.</p>
64/// </dd>
65/// </dl><important>
66/// <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>
67/// </important>
68#[derive(::std::clone::Clone, ::std::fmt::Debug)]
69pub struct PutBucketIntelligentTieringConfigurationFluentBuilder {
70    handle: ::std::sync::Arc<crate::client::Handle>,
71    inner: crate::operation::put_bucket_intelligent_tiering_configuration::builders::PutBucketIntelligentTieringConfigurationInputBuilder,
72    config_override: ::std::option::Option<crate::config::Builder>,
73}
74impl
75    crate::client::customize::internal::CustomizableSend<
76        crate::operation::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfigurationOutput,
77        crate::operation::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfigurationError,
78    > for PutBucketIntelligentTieringConfigurationFluentBuilder
79{
80    fn send(
81        self,
82        config_override: crate::config::Builder,
83    ) -> crate::client::customize::internal::BoxFuture<
84        crate::client::customize::internal::SendResult<
85            crate::operation::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfigurationOutput,
86            crate::operation::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfigurationError,
87        >,
88    > {
89        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
90    }
91}
92impl PutBucketIntelligentTieringConfigurationFluentBuilder {
93    /// Creates a new `PutBucketIntelligentTieringConfigurationFluentBuilder`.
94    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
95        Self {
96            handle,
97            inner: ::std::default::Default::default(),
98            config_override: ::std::option::Option::None,
99        }
100    }
101    /// Access the PutBucketIntelligentTieringConfiguration as a reference.
102    pub fn as_input(
103        &self,
104    ) -> &crate::operation::put_bucket_intelligent_tiering_configuration::builders::PutBucketIntelligentTieringConfigurationInputBuilder {
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::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfigurationOutput,
119        ::aws_smithy_runtime_api::client::result::SdkError<
120            crate::operation::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfigurationError,
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 =
129            crate::operation::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfiguration::operation_runtime_plugins(
130                self.handle.runtime_plugins.clone(),
131                &self.handle.conf,
132                self.config_override,
133            );
134        crate::operation::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfiguration::orchestrate(&runtime_plugins, input)
135            .await
136    }
137
138    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
139    pub fn customize(
140        self,
141    ) -> crate::client::customize::CustomizableOperation<
142        crate::operation::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfigurationOutput,
143        crate::operation::put_bucket_intelligent_tiering_configuration::PutBucketIntelligentTieringConfigurationError,
144        Self,
145    > {
146        crate::client::customize::CustomizableOperation::new(self)
147    }
148    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
149        self.set_config_override(::std::option::Option::Some(config_override.into()));
150        self
151    }
152
153    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
154        self.config_override = config_override;
155        self
156    }
157    /// <p>The name of the Amazon S3 bucket whose configuration you want to modify or retrieve.</p>
158    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.bucket(input.into());
160        self
161    }
162    /// <p>The name of the Amazon S3 bucket whose configuration you want to modify or retrieve.</p>
163    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_bucket(input);
165        self
166    }
167    /// <p>The name of the Amazon S3 bucket whose configuration you want to modify or retrieve.</p>
168    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
169        self.inner.get_bucket()
170    }
171    /// <p>The ID used to identify the S3 Intelligent-Tiering configuration.</p>
172    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.inner = self.inner.id(input.into());
174        self
175    }
176    /// <p>The ID used to identify the S3 Intelligent-Tiering configuration.</p>
177    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.inner = self.inner.set_id(input);
179        self
180    }
181    /// <p>The ID used to identify the S3 Intelligent-Tiering configuration.</p>
182    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
183        self.inner.get_id()
184    }
185    /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
186    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.inner = self.inner.expected_bucket_owner(input.into());
188        self
189    }
190    /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
191    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192        self.inner = self.inner.set_expected_bucket_owner(input);
193        self
194    }
195    /// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
196    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
197        self.inner.get_expected_bucket_owner()
198    }
199    /// <p>Container for S3 Intelligent-Tiering configuration.</p>
200    pub fn intelligent_tiering_configuration(mut self, input: crate::types::IntelligentTieringConfiguration) -> Self {
201        self.inner = self.inner.intelligent_tiering_configuration(input);
202        self
203    }
204    /// <p>Container for S3 Intelligent-Tiering configuration.</p>
205    pub fn set_intelligent_tiering_configuration(mut self, input: ::std::option::Option<crate::types::IntelligentTieringConfiguration>) -> Self {
206        self.inner = self.inner.set_intelligent_tiering_configuration(input);
207        self
208    }
209    /// <p>Container for S3 Intelligent-Tiering configuration.</p>
210    pub fn get_intelligent_tiering_configuration(&self) -> &::std::option::Option<crate::types::IntelligentTieringConfiguration> {
211        self.inner.get_intelligent_tiering_configuration()
212    }
213}