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