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>
76#[derive(::std::clone::Clone, ::std::fmt::Debug)]
77pub struct GetBucketLifecycleConfigurationFluentBuilder {
78    handle: ::std::sync::Arc<crate::client::Handle>,
79    inner: crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder,
80    config_override: ::std::option::Option<crate::config::Builder>,
81}
82impl
83    crate::client::customize::internal::CustomizableSend<
84        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
85        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
86    > for GetBucketLifecycleConfigurationFluentBuilder
87{
88    fn send(
89        self,
90        config_override: crate::config::Builder,
91    ) -> crate::client::customize::internal::BoxFuture<
92        crate::client::customize::internal::SendResult<
93            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
94            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
95        >,
96    > {
97        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
98    }
99}
100impl GetBucketLifecycleConfigurationFluentBuilder {
101    /// Creates a new `GetBucketLifecycleConfigurationFluentBuilder`.
102    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
103        Self {
104            handle,
105            inner: ::std::default::Default::default(),
106            config_override: ::std::option::Option::None,
107        }
108    }
109    /// Access the GetBucketLifecycleConfiguration as a reference.
110    pub fn as_input(&self) -> &crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder {
111        &self.inner
112    }
113    /// Sends the request and returns the response.
114    ///
115    /// If an error occurs, an `SdkError` will be returned with additional details that
116    /// can be matched against.
117    ///
118    /// By default, any retryable failures will be retried twice. Retry behavior
119    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
120    /// set when configuring the client.
121    pub async fn send(
122        self,
123    ) -> ::std::result::Result<
124        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
125        ::aws_smithy_runtime_api::client::result::SdkError<
126            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
127            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
128        >,
129    > {
130        let input = self
131            .inner
132            .build()
133            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
134        let runtime_plugins = crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfiguration::operation_runtime_plugins(
135            self.handle.runtime_plugins.clone(),
136            &self.handle.conf,
137            self.config_override,
138        );
139        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfiguration::orchestrate(&runtime_plugins, input).await
140    }
141
142    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
143    pub fn customize(
144        self,
145    ) -> crate::client::customize::CustomizableOperation<
146        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
147        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
148        Self,
149    > {
150        crate::client::customize::CustomizableOperation::new(self)
151    }
152    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
153        self.set_config_override(::std::option::Option::Some(config_override.into()));
154        self
155    }
156
157    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
158        self.config_override = config_override;
159        self
160    }
161    /// <p>The name of the bucket for which to get the lifecycle information.</p>
162    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.bucket(input.into());
164        self
165    }
166    /// <p>The name of the bucket for which to get the lifecycle information.</p>
167    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_bucket(input);
169        self
170    }
171    /// <p>The name of the bucket for which to get the lifecycle information.</p>
172    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_bucket()
174    }
175    /// <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>
176    /// <p>This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.</p>
177    /// </note>
178    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.inner = self.inner.expected_bucket_owner(input.into());
180        self
181    }
182    /// <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>
183    /// <p>This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.</p>
184    /// </note>
185    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.inner = self.inner.set_expected_bucket_owner(input);
187        self
188    }
189    /// <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>
190    /// <p>This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.</p>
191    /// </note>
192    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_expected_bucket_owner()
194    }
195}