aws_sdk_s3/operation/delete_bucket_lifecycle/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_bucket_lifecycle::_delete_bucket_lifecycle_output::DeleteBucketLifecycleOutputBuilder;
3
4pub use crate::operation::delete_bucket_lifecycle::_delete_bucket_lifecycle_input::DeleteBucketLifecycleInputBuilder;
5
6impl crate::operation::delete_bucket_lifecycle::builders::DeleteBucketLifecycleInputBuilder {
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::DeleteBucketLifecycleOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycleError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.delete_bucket_lifecycle();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DeleteBucketLifecycle`.
24///
25/// <p>Deletes the lifecycle configuration from the specified bucket. Amazon S3 removes all the lifecycle configuration rules in the lifecycle subresource associated with the bucket. Your objects never expire, and Amazon S3 no longer automatically deletes any objects on the basis of rules contained in the deleted lifecycle configuration.</p>
26/// <dl>
27/// <dt>
28/// Permissions
29/// </dt>
30/// <dd>
31/// <ul>
32/// <li>
33/// <p><b>General purpose bucket permissions</b> - By default, all Amazon S3 resources are private, including buckets, objects, and related subresources (for example, lifecycle configuration and website configuration). Only the resource owner (that is, the Amazon Web Services account that created it) can access the resource. The resource owner can optionally grant access permissions to others by writing an access policy. For this operation, a user must have the <code>s3:PutLifecycleConfiguration</code> permission.</p>
34/// <p>For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html">Managing Access Permissions to Your Amazon S3 Resources</a>.</p></li>
35/// </ul>
36/// <ul>
37/// <li>
38/// <p><b>Directory bucket permissions</b> - You must have the <code>s3express:PutLifecycleConfiguration</code> permission in an IAM identity-based policy to use this operation. Cross-account access to this API operation isn't supported. The resource owner can optionally grant access permissions to others by creating a role or user for them as long as they are within the same account as the owner and resource.</p>
39/// <p>For more information about directory bucket policies and permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html">Authorizing Regional endpoint APIs with IAM</a> in the <i>Amazon S3 User Guide</i>.</p><note>
40/// <p><b>Directory buckets </b> - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format <code>https://s3express-control.<i>region-code</i>.amazonaws.com/<i>bucket-name</i> </code>. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/endpoint-directory-buckets-AZ.html">Regional and Zonal endpoints for directory buckets in Availability Zones</a> in the <i>Amazon S3 User Guide</i>. For more information about endpoints in Local Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html">Concepts for directory buckets in Local Zones</a> in the <i>Amazon S3 User Guide</i>.</p>
41/// </note></li>
42/// </ul>
43/// </dd>
44/// </dl>
45/// <dl>
46/// <dt>
47/// HTTP Host header syntax
48/// </dt>
49/// <dd>
50/// <p><b>Directory buckets </b> - The HTTP Host header syntax is <code>s3express-control.<i>region</i>.amazonaws.com</code>.</p>
51/// </dd>
52/// </dl>
53/// <p>For more information about the 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>
54/// <p>Related actions include:</p>
55/// <ul>
56/// <li>
57/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html">PutBucketLifecycleConfiguration</a></p></li>
58/// <li>
59/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html">GetBucketLifecycleConfiguration</a></p></li>
60/// </ul><important>
61/// <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>
62/// </important>
63#[derive(::std::clone::Clone, ::std::fmt::Debug)]
64pub struct DeleteBucketLifecycleFluentBuilder {
65 handle: ::std::sync::Arc<crate::client::Handle>,
66 inner: crate::operation::delete_bucket_lifecycle::builders::DeleteBucketLifecycleInputBuilder,
67 config_override: ::std::option::Option<crate::config::Builder>,
68}
69impl
70 crate::client::customize::internal::CustomizableSend<
71 crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycleOutput,
72 crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycleError,
73 > for DeleteBucketLifecycleFluentBuilder
74{
75 fn send(
76 self,
77 config_override: crate::config::Builder,
78 ) -> crate::client::customize::internal::BoxFuture<
79 crate::client::customize::internal::SendResult<
80 crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycleOutput,
81 crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycleError,
82 >,
83 > {
84 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
85 }
86}
87impl DeleteBucketLifecycleFluentBuilder {
88 /// Creates a new `DeleteBucketLifecycleFluentBuilder`.
89 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
90 Self {
91 handle,
92 inner: ::std::default::Default::default(),
93 config_override: ::std::option::Option::None,
94 }
95 }
96 /// Access the DeleteBucketLifecycle as a reference.
97 pub fn as_input(&self) -> &crate::operation::delete_bucket_lifecycle::builders::DeleteBucketLifecycleInputBuilder {
98 &self.inner
99 }
100 /// Sends the request and returns the response.
101 ///
102 /// If an error occurs, an `SdkError` will be returned with additional details that
103 /// can be matched against.
104 ///
105 /// By default, any retryable failures will be retried twice. Retry behavior
106 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
107 /// set when configuring the client.
108 pub async fn send(
109 self,
110 ) -> ::std::result::Result<
111 crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycleOutput,
112 ::aws_smithy_runtime_api::client::result::SdkError<
113 crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycleError,
114 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
115 >,
116 > {
117 let input = self
118 .inner
119 .build()
120 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
121 let runtime_plugins = crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycle::operation_runtime_plugins(
122 self.handle.runtime_plugins.clone(),
123 &self.handle.conf,
124 self.config_override,
125 );
126 crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycle::orchestrate(&runtime_plugins, input).await
127 }
128
129 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
130 pub fn customize(
131 self,
132 ) -> crate::client::customize::CustomizableOperation<
133 crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycleOutput,
134 crate::operation::delete_bucket_lifecycle::DeleteBucketLifecycleError,
135 Self,
136 > {
137 crate::client::customize::CustomizableOperation::new(self)
138 }
139 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
140 self.set_config_override(::std::option::Option::Some(config_override.into()));
141 self
142 }
143
144 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
145 self.config_override = config_override;
146 self
147 }
148 /// <p>The bucket name of the lifecycle to delete.</p>
149 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150 self.inner = self.inner.bucket(input.into());
151 self
152 }
153 /// <p>The bucket name of the lifecycle to delete.</p>
154 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155 self.inner = self.inner.set_bucket(input);
156 self
157 }
158 /// <p>The bucket name of the lifecycle to delete.</p>
159 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
160 self.inner.get_bucket()
161 }
162 /// <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><note>
163 /// <p>This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.</p>
164 /// </note>
165 pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166 self.inner = self.inner.expected_bucket_owner(input.into());
167 self
168 }
169 /// <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><note>
170 /// <p>This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.</p>
171 /// </note>
172 pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.inner = self.inner.set_expected_bucket_owner(input);
174 self
175 }
176 /// <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><note>
177 /// <p>This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.</p>
178 /// </note>
179 pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
180 self.inner.get_expected_bucket_owner()
181 }
182}