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/// <note>
26/// <p>This operation is not supported by directory buckets.</p>
27/// </note> <note>
28/// <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. The previous version of the API supported filtering based only on an object key name prefix, which is supported for backward compatibility. For the related API description, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html">GetBucketLifecycle</a>. Accordingly, this section describes the latest API. The response describes the new filter element that you can use to specify a filter to select a subset of objects to which the rule applies. If you are using a previous version of the lifecycle configuration, it still works. For the earlier action,</p>
29/// </note>
30/// <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>
31/// <p>To use this operation, you must have permission to perform the <code>s3:GetLifecycleConfiguration</code> action. The bucket owner has this permission, by default. The bucket owner can grant this permission to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources">Permissions Related to Bucket Subresource Operations</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3 Resources</a>.</p>
32/// <p><code>GetBucketLifecycleConfiguration</code> has the following special error:</p>
33/// <ul>
34/// <li>
35/// <p>Error code: <code>NoSuchLifecycleConfiguration</code></p>
36/// <ul>
37/// <li>
38/// <p>Description: The lifecycle configuration does not exist.</p></li>
39/// <li>
40/// <p>HTTP Status Code: 404 Not Found</p></li>
41/// <li>
42/// <p>SOAP Fault Code Prefix: Client</p></li>
43/// </ul></li>
44/// </ul>
45/// <p>The following operations are related to <code>GetBucketLifecycleConfiguration</code>:</p>
46/// <ul>
47/// <li>
48/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html">GetBucketLifecycle</a></p></li>
49/// <li>
50/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html">PutBucketLifecycle</a></p></li>
51/// <li>
52/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html">DeleteBucketLifecycle</a></p></li>
53/// </ul>
54#[derive(::std::clone::Clone, ::std::fmt::Debug)]
55pub struct GetBucketLifecycleConfigurationFluentBuilder {
56    handle: ::std::sync::Arc<crate::client::Handle>,
57    inner: crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder,
58    config_override: ::std::option::Option<crate::config::Builder>,
59}
60impl
61    crate::client::customize::internal::CustomizableSend<
62        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
63        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
64    > for GetBucketLifecycleConfigurationFluentBuilder
65{
66    fn send(
67        self,
68        config_override: crate::config::Builder,
69    ) -> crate::client::customize::internal::BoxFuture<
70        crate::client::customize::internal::SendResult<
71            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
72            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
73        >,
74    > {
75        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
76    }
77}
78impl GetBucketLifecycleConfigurationFluentBuilder {
79    /// Creates a new `GetBucketLifecycleConfigurationFluentBuilder`.
80    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
81        Self {
82            handle,
83            inner: ::std::default::Default::default(),
84            config_override: ::std::option::Option::None,
85        }
86    }
87    /// Access the GetBucketLifecycleConfiguration as a reference.
88    pub fn as_input(&self) -> &crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder {
89        &self.inner
90    }
91    /// Sends the request and returns the response.
92    ///
93    /// If an error occurs, an `SdkError` will be returned with additional details that
94    /// can be matched against.
95    ///
96    /// By default, any retryable failures will be retried twice. Retry behavior
97    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
98    /// set when configuring the client.
99    pub async fn send(
100        self,
101    ) -> ::std::result::Result<
102        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
103        ::aws_smithy_runtime_api::client::result::SdkError<
104            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
105            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
106        >,
107    > {
108        let input = self
109            .inner
110            .build()
111            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
112        let runtime_plugins = crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfiguration::operation_runtime_plugins(
113            self.handle.runtime_plugins.clone(),
114            &self.handle.conf,
115            self.config_override,
116        );
117        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfiguration::orchestrate(&runtime_plugins, input).await
118    }
119
120    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
121    pub fn customize(
122        self,
123    ) -> crate::client::customize::CustomizableOperation<
124        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
125        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
126        Self,
127    > {
128        crate::client::customize::CustomizableOperation::new(self)
129    }
130    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
131        self.set_config_override(::std::option::Option::Some(config_override.into()));
132        self
133    }
134
135    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
136        self.config_override = config_override;
137        self
138    }
139    /// <p>The name of the bucket for which to get the lifecycle information.</p>
140    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.bucket(input.into());
142        self
143    }
144    /// <p>The name of the bucket for which to get the lifecycle information.</p>
145    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_bucket(input);
147        self
148    }
149    /// <p>The name of the bucket for which to get the lifecycle information.</p>
150    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_bucket()
152    }
153    /// <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>
154    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.expected_bucket_owner(input.into());
156        self
157    }
158    /// <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>
159    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_expected_bucket_owner(input);
161        self
162    }
163    /// <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>
164    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_expected_bucket_owner()
166    }
167}