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