aws_sdk_s3control/operation/delete_bucket_lifecycle_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_bucket_lifecycle_configuration::_delete_bucket_lifecycle_configuration_output::DeleteBucketLifecycleConfigurationOutputBuilder;
3
4pub use crate::operation::delete_bucket_lifecycle_configuration::_delete_bucket_lifecycle_configuration_input::DeleteBucketLifecycleConfigurationInputBuilder;
5
6impl crate::operation::delete_bucket_lifecycle_configuration::builders::DeleteBucketLifecycleConfigurationInputBuilder {
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::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_bucket_lifecycle_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteBucketLifecycleConfiguration`.
24///
25/// <note>
26/// <p>This action deletes an Amazon S3 on Outposts bucket's lifecycle configuration. To delete an S3 bucket's lifecycle configuration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html">DeleteBucketLifecycle</a> in the <i>Amazon S3 API Reference</i>.</p>
27/// </note>
28/// <p>Deletes the lifecycle configuration from the specified Outposts bucket. Amazon S3 on Outposts removes all the lifecycle configuration rules in the lifecycle subresource associated with the bucket. Your objects never expire, and Amazon S3 on Outposts no longer automatically deletes any objects on the basis of rules contained in the deleted lifecycle configuration. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">Using Amazon S3 on Outposts</a> in <i>Amazon S3 User Guide</i>.</p>
29/// <p>To use this operation, you must have permission to perform the <code>s3-outposts:PutLifecycleConfiguration</code> action. By default, the bucket owner has this permission and the Outposts bucket owner can grant this permission to others.</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_DeleteBucketLifecycleConfiguration.html#API_control_DeleteBucketLifecycleConfiguration_Examples">Examples</a> section.</p>
31/// <p>For more information about object expiration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions">Elements to Describe Lifecycle Actions</a>.</p>
32/// <p>Related actions include:</p>
33/// <ul>
34/// <li>
35/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html">PutBucketLifecycleConfiguration</a></p></li>
36/// <li>
37/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html">GetBucketLifecycleConfiguration</a></p></li>
38/// </ul>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct DeleteBucketLifecycleConfigurationFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::delete_bucket_lifecycle_configuration::builders::DeleteBucketLifecycleConfigurationInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfigurationOutput,
48        crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfigurationError,
49    > for DeleteBucketLifecycleConfigurationFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfigurationOutput,
57            crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfigurationError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl DeleteBucketLifecycleConfigurationFluentBuilder {
64    /// Creates a new `DeleteBucketLifecycleConfigurationFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the DeleteBucketLifecycleConfiguration as a reference.
73    pub fn as_input(&self) -> &crate::operation::delete_bucket_lifecycle_configuration::builders::DeleteBucketLifecycleConfigurationInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfigurationOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfigurationError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfiguration::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfiguration::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfigurationOutput,
110        crate::operation::delete_bucket_lifecycle_configuration::DeleteBucketLifecycleConfigurationError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// <p>The account ID of the lifecycle configuration to delete.</p>
125    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.account_id(input.into());
127        self
128    }
129    /// <p>The account ID of the lifecycle configuration to delete.</p>
130    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_account_id(input);
132        self
133    }
134    /// <p>The account ID of the lifecycle configuration to delete.</p>
135    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_account_id()
137    }
138    /// <p>Specifies the bucket.</p>
139    /// <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>
140    /// <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>
141    /// :
142    /// <account-id>
143    /// :outpost/
144    /// <outpost-id>
145    /// /bucket/
146    /// <my-bucket-name></my-bucket-name>
147    /// </outpost-id>
148    /// </account-id>
149    /// </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>
150    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.bucket(input.into());
152        self
153    }
154    /// <p>Specifies the bucket.</p>
155    /// <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>
156    /// <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>
157    /// :
158    /// <account-id>
159    /// :outpost/
160    /// <outpost-id>
161    /// /bucket/
162    /// <my-bucket-name></my-bucket-name>
163    /// </outpost-id>
164    /// </account-id>
165    /// </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>
166    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_bucket(input);
168        self
169    }
170    /// <p>Specifies the bucket.</p>
171    /// <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>
172    /// <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>
173    /// :
174    /// <account-id>
175    /// :outpost/
176    /// <outpost-id>
177    /// /bucket/
178    /// <my-bucket-name></my-bucket-name>
179    /// </outpost-id>
180    /// </account-id>
181    /// </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>
182    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
183        self.inner.get_bucket()
184    }
185}