aws_sdk_s3control/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 action gets an Amazon S3 on Outposts bucket's lifecycle configuration. To get an S3 bucket's lifecycle configuration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html">GetBucketLifecycleConfiguration</a> in the <i>Amazon S3 API Reference</i>.</p>
27/// </note>
28/// <p>Returns the lifecycle configuration information set on the Outposts bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using Amazon S3 on Outposts</a> and for information about lifecycle configuration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html"> Object Lifecycle Management</a> in <i>Amazon S3 User Guide</i>.</p>
29/// <p>To use this action, you must have permission to perform the <code>s3-outposts:GetLifecycleConfiguration</code> action. The Outposts 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>
30/// <p>All Amazon S3 on Outposts REST API requests for this action require an additional parameter of <code>x-amz-outpost-id</code> to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the <code>x-amz-outpost-id</code> derived by using the access point ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html#API_control_GetBucketLifecycleConfiguration_Examples">Examples</a> section.</p>
31/// <p><code>GetBucketLifecycleConfiguration</code> has the following special error:</p>
32/// <ul>
33/// <li>
34/// <p>Error code: <code>NoSuchLifecycleConfiguration</code></p>
35/// <ul>
36/// <li>
37/// <p>Description: The lifecycle configuration does not exist.</p></li>
38/// <li>
39/// <p>HTTP Status Code: 404 Not Found</p></li>
40/// <li>
41/// <p>SOAP Fault Code Prefix: Client</p></li>
42/// </ul></li>
43/// </ul>
44/// <p>The following actions are related to <code>GetBucketLifecycleConfiguration</code>:</p>
45/// <ul>
46/// <li>
47/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html">PutBucketLifecycleConfiguration</a></p></li>
48/// <li>
49/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketLifecycleConfiguration.html">DeleteBucketLifecycleConfiguration</a></p></li>
50/// </ul>
51#[derive(::std::clone::Clone, ::std::fmt::Debug)]
52pub struct GetBucketLifecycleConfigurationFluentBuilder {
53    handle: ::std::sync::Arc<crate::client::Handle>,
54    inner: crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder,
55    config_override: ::std::option::Option<crate::config::Builder>,
56}
57impl
58    crate::client::customize::internal::CustomizableSend<
59        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
60        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
61    > for GetBucketLifecycleConfigurationFluentBuilder
62{
63    fn send(
64        self,
65        config_override: crate::config::Builder,
66    ) -> crate::client::customize::internal::BoxFuture<
67        crate::client::customize::internal::SendResult<
68            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
69            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
70        >,
71    > {
72        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
73    }
74}
75impl GetBucketLifecycleConfigurationFluentBuilder {
76    /// Creates a new `GetBucketLifecycleConfigurationFluentBuilder`.
77    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
78        Self {
79            handle,
80            inner: ::std::default::Default::default(),
81            config_override: ::std::option::Option::None,
82        }
83    }
84    /// Access the GetBucketLifecycleConfiguration as a reference.
85    pub fn as_input(&self) -> &crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder {
86        &self.inner
87    }
88    /// Sends the request and returns the response.
89    ///
90    /// If an error occurs, an `SdkError` will be returned with additional details that
91    /// can be matched against.
92    ///
93    /// By default, any retryable failures will be retried twice. Retry behavior
94    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
95    /// set when configuring the client.
96    pub async fn send(
97        self,
98    ) -> ::std::result::Result<
99        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
100        ::aws_smithy_runtime_api::client::result::SdkError<
101            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
102            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
103        >,
104    > {
105        let input = self
106            .inner
107            .build()
108            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
109        let runtime_plugins = crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfiguration::operation_runtime_plugins(
110            self.handle.runtime_plugins.clone(),
111            &self.handle.conf,
112            self.config_override,
113        );
114        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfiguration::orchestrate(&runtime_plugins, input).await
115    }
116
117    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
118    pub fn customize(
119        self,
120    ) -> crate::client::customize::CustomizableOperation<
121        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
122        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
123        Self,
124    > {
125        crate::client::customize::CustomizableOperation::new(self)
126    }
127    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
128        self.set_config_override(::std::option::Option::Some(config_override.into()));
129        self
130    }
131
132    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
133        self.config_override = config_override;
134        self
135    }
136    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
137    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.inner = self.inner.account_id(input.into());
139        self
140    }
141    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
142    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.inner = self.inner.set_account_id(input);
144        self
145    }
146    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
147    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_account_id()
149    }
150    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
151    /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
152    /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
153    /// :
154    /// <account-id>
155    /// :outpost/
156    /// <outpost-id>
157    /// /bucket/
158    /// <my-bucket-name></my-bucket-name>
159    /// </outpost-id>
160    /// </account-id>
161    /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</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 Amazon Resource Name (ARN) of the bucket.</p>
167    /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
168    /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
169    /// :
170    /// <account-id>
171    /// :outpost/
172    /// <outpost-id>
173    /// /bucket/
174    /// <my-bucket-name></my-bucket-name>
175    /// </outpost-id>
176    /// </account-id>
177    /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
178    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.inner = self.inner.set_bucket(input);
180        self
181    }
182    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
183    /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
184    /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
185    /// :
186    /// <account-id>
187    /// :outpost/
188    /// <outpost-id>
189    /// /bucket/
190    /// <my-bucket-name></my-bucket-name>
191    /// </outpost-id>
192    /// </account-id>
193    /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
194    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_bucket()
196    }
197}