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><important>
51/// <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>
52/// </important>
53#[derive(::std::clone::Clone, ::std::fmt::Debug)]
54pub struct GetBucketLifecycleConfigurationFluentBuilder {
55    handle: ::std::sync::Arc<crate::client::Handle>,
56    inner: crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder,
57    config_override: ::std::option::Option<crate::config::Builder>,
58}
59impl
60    crate::client::customize::internal::CustomizableSend<
61        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
62        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
63    > for GetBucketLifecycleConfigurationFluentBuilder
64{
65    fn send(
66        self,
67        config_override: crate::config::Builder,
68    ) -> crate::client::customize::internal::BoxFuture<
69        crate::client::customize::internal::SendResult<
70            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
71            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
72        >,
73    > {
74        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
75    }
76}
77impl GetBucketLifecycleConfigurationFluentBuilder {
78    /// Creates a new `GetBucketLifecycleConfigurationFluentBuilder`.
79    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
80        Self {
81            handle,
82            inner: ::std::default::Default::default(),
83            config_override: ::std::option::Option::None,
84        }
85    }
86    /// Access the GetBucketLifecycleConfiguration as a reference.
87    pub fn as_input(&self) -> &crate::operation::get_bucket_lifecycle_configuration::builders::GetBucketLifecycleConfigurationInputBuilder {
88        &self.inner
89    }
90    /// Sends the request and returns the response.
91    ///
92    /// If an error occurs, an `SdkError` will be returned with additional details that
93    /// can be matched against.
94    ///
95    /// By default, any retryable failures will be retried twice. Retry behavior
96    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
97    /// set when configuring the client.
98    pub async fn send(
99        self,
100    ) -> ::std::result::Result<
101        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
102        ::aws_smithy_runtime_api::client::result::SdkError<
103            crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
104            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
105        >,
106    > {
107        let input = self
108            .inner
109            .build()
110            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
111        let runtime_plugins = crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfiguration::operation_runtime_plugins(
112            self.handle.runtime_plugins.clone(),
113            &self.handle.conf,
114            self.config_override,
115        );
116        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfiguration::orchestrate(&runtime_plugins, input).await
117    }
118
119    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
120    pub fn customize(
121        self,
122    ) -> crate::client::customize::CustomizableOperation<
123        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationOutput,
124        crate::operation::get_bucket_lifecycle_configuration::GetBucketLifecycleConfigurationError,
125        Self,
126    > {
127        crate::client::customize::CustomizableOperation::new(self)
128    }
129    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
130        self.set_config_override(::std::option::Option::Some(config_override.into()));
131        self
132    }
133
134    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
135        self.config_override = config_override;
136        self
137    }
138    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
139    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.account_id(input.into());
141        self
142    }
143    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
144    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_account_id(input);
146        self
147    }
148    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
149    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_account_id()
151    }
152    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
153    /// <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>
154    /// <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>
155    /// :
156    /// <account-id>
157    /// :outpost/
158    /// <outpost-id>
159    /// /bucket/
160    /// <my-bucket-name></my-bucket-name>
161    /// </outpost-id>
162    /// </account-id>
163    /// </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>
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 Amazon Resource Name (ARN) of the bucket.</p>
169    /// <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>
170    /// <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>
171    /// :
172    /// <account-id>
173    /// :outpost/
174    /// <outpost-id>
175    /// /bucket/
176    /// <my-bucket-name></my-bucket-name>
177    /// </outpost-id>
178    /// </account-id>
179    /// </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>
180    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_bucket(input);
182        self
183    }
184    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
185    /// <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>
186    /// <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>
187    /// :
188    /// <account-id>
189    /// :outpost/
190    /// <outpost-id>
191    /// /bucket/
192    /// <my-bucket-name></my-bucket-name>
193    /// </outpost-id>
194    /// </account-id>
195    /// </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>
196    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
197        self.inner.get_bucket()
198    }
199}