aws_sdk_s3/operation/get_bucket_lifecycle_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_bucket_lifecycle_configuration::_get_bucket_lifecycle_configuration_output::GetBucketLifecycleConfigurationOutputBuilder;
3
4pub use crate::operation::get_bucket_lifecycle_configuration::_get_bucket_lifecycle_configuration_input::GetBucketLifecycleConfigurationInputBuilder;
5
6impl crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder {
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_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_bucket_lifecycle_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetBucketLifecycleConfiguration`.
24///
25/// <p>Returns the lifecycle configuration information set on the bucket. For information about lifecycle configuration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html">Object Lifecycle Management</a>.</p>
26/// <p>Bucket lifecycle configuration now supports specifying a lifecycle rule using an object key name prefix, one or more object tags, object size, or any combination of these. Accordingly, this section describes the latest API, which is compatible with the new functionality. The previous version of the API supported filtering based only on an object key name prefix, which is supported for general purpose buckets for backward compatibility. For the related API description, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html">GetBucketLifecycle</a>.</p><note>
27/// <p>Lifecyle configurations for directory buckets only support expiring objects and cancelling multipart uploads. Expiring of versioned objects, transitions and tag filters are not supported.</p>
28/// </note>
29/// <dl>
30/// <dt>
31/// Permissions
32/// </dt>
33/// <dd>
34/// <ul>
35/// <li>
36/// <p><b>General purpose bucket permissions</b> - By default, all Amazon S3 resources are private, including buckets, objects, and related subresources (for example, lifecycle configuration and website configuration). Only the resource owner (that is, the Amazon Web Services account that created it) can access the resource. The resource owner can optionally grant access permissions to others by writing an access policy. For this operation, a user must have the <code>s3:GetLifecycleConfiguration</code> permission.</p>
37/// <p>For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3 Resources</a>.</p></li>
38/// </ul>
39/// <ul>
40/// <li>
41/// <p><b>Directory bucket permissions</b> - You must have the <code>s3express:GetLifecycleConfiguration</code> permission in an IAM identity-based policy to use this operation. Cross-account access to this API operation isn't supported. The resource owner can optionally grant access permissions to others by creating a role or user for them as long as they are within the same account as the owner and resource.</p>
42/// <p>For more information about directory bucket policies and permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html">Authorizing Regional endpoint APIs with IAM</a> in the <i>Amazon S3 User Guide</i>.</p><note>
43/// <p><b>Directory buckets </b> - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i> </code>. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/endpoint-directory-buckets-AZ.html">Regional and Zonal endpoints for directory buckets in Availability Zones</a> in the <i>Amazon S3 User Guide</i>. For more information about endpoints in Local Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html">Concepts for directory buckets in Local Zones</a> in the <i>Amazon S3 User Guide</i>.</p>
44/// </note></li>
45/// </ul>
46/// </dd>
47/// <dt>
48/// HTTP Host header syntax
49/// </dt>
50/// <dd>
51/// <p><b>Directory buckets </b> - The HTTP Host header syntax is <code>s3express-control.<i>region</i>.amazonaws.com</code>.</p>
52/// </dd>
53/// </dl>
54/// <p><code>GetBucketLifecycleConfiguration</code> has the following special error:</p>
55/// <ul>
56/// <li>
57/// <p>Error code: <code>NoSuchLifecycleConfiguration</code></p>
58/// <ul>
59/// <li>
60/// <p>Description: The lifecycle configuration does not exist.</p></li>
61/// <li>
62/// <p>HTTP Status Code: 404 Not Found</p></li>
63/// <li>
64/// <p>SOAP Fault Code Prefix: Client</p></li>
65/// </ul></li>
66/// </ul>
67/// <p>The following operations are related to <code>GetBucketLifecycleConfiguration</code>:</p>
68/// <ul>
69/// <li>
70/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html">GetBucketLifecycle</a></p></li>
71/// <li>
72/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html">PutBucketLifecycle</a></p></li>
73/// <li>
74/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html">DeleteBucketLifecycle</a></p></li>
75/// </ul><important>
76/// <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>
77/// </important>
78#[derive(::std::clone::Clone, ::std::fmt::Debug)]
79pub struct GetBucketLifecycleConfigurationFluentBuilder {
80    handle: ::std::sync::Arc<crate::client::Handle>,
81    inner: crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder,
82    config_override: ::std::option::Option<crate::config::Builder>,
83}
84impl
85    crate::client::customize::internal::CustomizableSend<
86        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
87        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
88    > for GetBucketLifecycleConfigurationFluentBuilder
89{
90    fn send(
91        self,
92        config_override: crate::config::Builder,
93    ) -> crate::client::customize::internal::BoxFuture<
94        crate::client::customize::internal::SendResult<
95            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
96            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
97        >,
98    > {
99        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
100    }
101}
102impl GetBucketLifecycleConfigurationFluentBuilder {
103    /// Creates a new `GetBucketLifecycleConfigurationFluentBuilder`.
104    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
105        Self {
106            handle,
107            inner: ::std::default::Default::default(),
108            config_override: ::std::option::Option::None,
109        }
110    }
111    /// Access the GetBucketLifecycleConfiguration as a reference.
112    pub fn as_input(&self) -> &crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder {
113        &self.inner
114    }
115    /// Sends the request and returns the response.
116    ///
117    /// If an error occurs, an `SdkError` will be returned with additional details that
118    /// can be matched against.
119    ///
120    /// By default, any retryable failures will be retried twice. Retry behavior
121    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
122    /// set when configuring the client.
123    pub async fn send(
124        self,
125    ) -> ::std::result::Result<
126        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
127        ::aws_smithy_runtime_api::client::result::SdkError<
128            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
129            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
130        >,
131    > {
132        let input = self
133            .inner
134            .build()
135            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
136        let runtime_plugins = crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfiguration::operation_runtime_plugins(
137            self.handle.runtime_plugins.clone(),
138            &self.handle.conf,
139            self.config_override,
140        );
141        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfiguration::orchestrate(&runtime_plugins, input).await
142    }
143
144    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
145    pub fn customize(
146        self,
147    ) -> crate::client::customize::CustomizableOperation<
148        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
149        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
150        Self,
151    > {
152        crate::client::customize::CustomizableOperation::new(self)
153    }
154    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
155        self.set_config_override(::std::option::Option::Some(config_override.into()));
156        self
157    }
158
159    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
160        self.config_override = config_override;
161        self
162    }
163    /// <p>The name of the bucket for which to get the lifecycle information.</p>
164    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.bucket(input.into());
166        self
167    }
168    /// <p>The name of the bucket for which to get the lifecycle information.</p>
169    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_bucket(input);
171        self
172    }
173    /// <p>The name of the bucket for which to get the lifecycle information.</p>
174    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
175        self.inner.get_bucket()
176    }
177    /// <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><note>
178    /// <p>This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.</p>
179    /// </note>
180    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.inner = self.inner.expected_bucket_owner(input.into());
182        self
183    }
184    /// <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><note>
185    /// <p>This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.</p>
186    /// </note>
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. 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><note>
192    /// <p>This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.</p>
193    /// </note>
194    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_expected_bucket_owner()
196    }
197}