aws_sdk_s3control/operation/delete_bucket/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_bucket::_delete_bucket_output::DeleteBucketOutputBuilder;
3
4pub use crate::operation::delete_bucket::_delete_bucket_input::DeleteBucketInputBuilder;
5
6impl crate::operation::delete_bucket::builders::DeleteBucketInputBuilder {
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::DeleteBucketOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::delete_bucket::DeleteBucketError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.delete_bucket();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DeleteBucket`.
24///
25/// <note>
26/// <p>This action deletes an Amazon S3 on Outposts bucket. To delete an S3 bucket, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html">DeleteBucket</a> in the <i>Amazon S3 API Reference</i>.</p>
27/// </note>
28/// <p>Deletes the Amazon S3 on Outposts bucket. All objects (including all object versions and delete markers) in the bucket must be deleted before the bucket itself can be deleted. 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>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_DeleteBucket.html#API_control_DeleteBucket_Examples">Examples</a> section.</p>
30/// <p class="title"><b>Related Resources</b></p>
31/// <ul>
32/// <li>
33/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html">CreateBucket</a></p></li>
34/// <li>
35/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html">GetBucket</a></p></li>
36/// <li>
37/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html">DeleteObject</a></p></li>
38/// </ul>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct DeleteBucketFluentBuilder {
41 handle: ::std::sync::Arc<crate::client::Handle>,
42 inner: crate::operation::delete_bucket::builders::DeleteBucketInputBuilder,
43 config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46 crate::client::customize::internal::CustomizableSend<
47 crate::operation::delete_bucket::DeleteBucketOutput,
48 crate::operation::delete_bucket::DeleteBucketError,
49 > for DeleteBucketFluentBuilder
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::DeleteBucketOutput,
57 crate::operation::delete_bucket::DeleteBucketError,
58 >,
59 > {
60 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61 }
62}
63impl DeleteBucketFluentBuilder {
64 /// Creates a new `DeleteBucketFluentBuilder`.
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 DeleteBucket as a reference.
73 pub fn as_input(&self) -> &crate::operation::delete_bucket::builders::DeleteBucketInputBuilder {
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::DeleteBucketOutput,
88 ::aws_smithy_runtime_api::client::result::SdkError<
89 crate::operation::delete_bucket::DeleteBucketError,
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::DeleteBucket::operation_runtime_plugins(
98 self.handle.runtime_plugins.clone(),
99 &self.handle.conf,
100 self.config_override,
101 );
102 crate::operation::delete_bucket::DeleteBucket::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::DeleteBucketOutput,
110 crate::operation::delete_bucket::DeleteBucketError,
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 that owns the Outposts bucket.</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 that owns the Outposts bucket.</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 that owns the Outposts bucket.</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 being deleted.</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 being deleted.</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 being deleted.</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}