aws_sdk_s3control/operation/create_bucket/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_bucket::_create_bucket_output::CreateBucketOutputBuilder;
3
4pub use crate::operation::create_bucket::_create_bucket_input::CreateBucketInputBuilder;
5
6impl crate::operation::create_bucket::builders::CreateBucketInputBuilder {
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::create_bucket::CreateBucketOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_bucket::CreateBucketError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_bucket();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateBucket`.
24///
25/// <note>
26/// <p>This action creates an Amazon S3 on Outposts bucket. To create an S3 bucket, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html">Create Bucket</a> in the <i>Amazon S3 API Reference</i>.</p>
27/// </note>
28/// <p>Creates a new Outposts bucket. By creating the bucket, you become the bucket owner. To create an Outposts bucket, you must have S3 on Outposts. 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>Not every string is an acceptable bucket name. For information on bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/BucketRestrictions.html#bucketnamingrules">Working with Amazon S3 Buckets</a>.</p>
30/// <p>S3 on Outposts buckets support:</p>
31/// <ul>
32/// <li>
33/// <p>Tags</p></li>
34/// <li>
35/// <p>LifecycleConfigurations for deleting expired objects</p></li>
36/// </ul>
37/// <p>For a complete list of restrictions and Amazon S3 feature limitations on S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OnOutpostsRestrictionsLimitations.html"> Amazon S3 on Outposts Restrictions and Limitations</a>.</p>
38/// <p>For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and <code>x-amz-outpost-id</code> in your API request, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html#API_control_CreateBucket_Examples">Examples</a> section.</p>
39/// <p>The following actions are related to <code>CreateBucket</code> for Amazon S3 on Outposts:</p>
40/// <ul>
41/// <li>
42/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">PutObject</a></p></li>
43/// <li>
44/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html">GetBucket</a></p></li>
45/// <li>
46/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucket.html">DeleteBucket</a></p></li>
47/// <li>
48/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html">CreateAccessPoint</a></p></li>
49/// <li>
50/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html">PutAccessPointPolicy</a></p></li>
51/// </ul>
52#[derive(::std::clone::Clone, ::std::fmt::Debug)]
53pub struct CreateBucketFluentBuilder {
54    handle: ::std::sync::Arc<crate::client::Handle>,
55    inner: crate::operation::create_bucket::builders::CreateBucketInputBuilder,
56    config_override: ::std::option::Option<crate::config::Builder>,
57}
58impl
59    crate::client::customize::internal::CustomizableSend<
60        crate::operation::create_bucket::CreateBucketOutput,
61        crate::operation::create_bucket::CreateBucketError,
62    > for CreateBucketFluentBuilder
63{
64    fn send(
65        self,
66        config_override: crate::config::Builder,
67    ) -> crate::client::customize::internal::BoxFuture<
68        crate::client::customize::internal::SendResult<
69            crate::operation::create_bucket::CreateBucketOutput,
70            crate::operation::create_bucket::CreateBucketError,
71        >,
72    > {
73        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
74    }
75}
76impl CreateBucketFluentBuilder {
77    /// Creates a new `CreateBucketFluentBuilder`.
78    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
79        Self {
80            handle,
81            inner: ::std::default::Default::default(),
82            config_override: ::std::option::Option::None,
83        }
84    }
85    /// Access the CreateBucket as a reference.
86    pub fn as_input(&self) -> &crate::operation::create_bucket::builders::CreateBucketInputBuilder {
87        &self.inner
88    }
89    /// Sends the request and returns the response.
90    ///
91    /// If an error occurs, an `SdkError` will be returned with additional details that
92    /// can be matched against.
93    ///
94    /// By default, any retryable failures will be retried twice. Retry behavior
95    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
96    /// set when configuring the client.
97    pub async fn send(
98        self,
99    ) -> ::std::result::Result<
100        crate::operation::create_bucket::CreateBucketOutput,
101        ::aws_smithy_runtime_api::client::result::SdkError<
102            crate::operation::create_bucket::CreateBucketError,
103            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
104        >,
105    > {
106        let input = self
107            .inner
108            .build()
109            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
110        let runtime_plugins = crate::operation::create_bucket::CreateBucket::operation_runtime_plugins(
111            self.handle.runtime_plugins.clone(),
112            &self.handle.conf,
113            self.config_override,
114        );
115        crate::operation::create_bucket::CreateBucket::orchestrate(&runtime_plugins, input).await
116    }
117
118    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
119    pub fn customize(
120        self,
121    ) -> crate::client::customize::CustomizableOperation<
122        crate::operation::create_bucket::CreateBucketOutput,
123        crate::operation::create_bucket::CreateBucketError,
124        Self,
125    > {
126        crate::client::customize::CustomizableOperation::new(self)
127    }
128    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
129        self.set_config_override(::std::option::Option::Some(config_override.into()));
130        self
131    }
132
133    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
134        self.config_override = config_override;
135        self
136    }
137    /// <p>The canned ACL to apply to the bucket.</p><note>
138    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
139    /// </note>
140    pub fn acl(mut self, input: crate::types::BucketCannedAcl) -> Self {
141        self.inner = self.inner.acl(input);
142        self
143    }
144    /// <p>The canned ACL to apply to the bucket.</p><note>
145    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
146    /// </note>
147    pub fn set_acl(mut self, input: ::std::option::Option<crate::types::BucketCannedAcl>) -> Self {
148        self.inner = self.inner.set_acl(input);
149        self
150    }
151    /// <p>The canned ACL to apply to the bucket.</p><note>
152    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
153    /// </note>
154    pub fn get_acl(&self) -> &::std::option::Option<crate::types::BucketCannedAcl> {
155        self.inner.get_acl()
156    }
157    /// <p>The name of the bucket.</p>
158    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.bucket(input.into());
160        self
161    }
162    /// <p>The name of the bucket.</p>
163    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_bucket(input);
165        self
166    }
167    /// <p>The name of the bucket.</p>
168    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
169        self.inner.get_bucket()
170    }
171    /// <p>The configuration information for the bucket.</p><note>
172    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
173    /// </note>
174    pub fn create_bucket_configuration(mut self, input: crate::types::CreateBucketConfiguration) -> Self {
175        self.inner = self.inner.create_bucket_configuration(input);
176        self
177    }
178    /// <p>The configuration information for the bucket.</p><note>
179    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
180    /// </note>
181    pub fn set_create_bucket_configuration(mut self, input: ::std::option::Option<crate::types::CreateBucketConfiguration>) -> Self {
182        self.inner = self.inner.set_create_bucket_configuration(input);
183        self
184    }
185    /// <p>The configuration information for the bucket.</p><note>
186    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
187    /// </note>
188    pub fn get_create_bucket_configuration(&self) -> &::std::option::Option<crate::types::CreateBucketConfiguration> {
189        self.inner.get_create_bucket_configuration()
190    }
191    /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p><note>
192    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
193    /// </note>
194    pub fn grant_full_control(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195        self.inner = self.inner.grant_full_control(input.into());
196        self
197    }
198    /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p><note>
199    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
200    /// </note>
201    pub fn set_grant_full_control(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_grant_full_control(input);
203        self
204    }
205    /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p><note>
206    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
207    /// </note>
208    pub fn get_grant_full_control(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_grant_full_control()
210    }
211    /// <p>Allows grantee to list the objects in the bucket.</p><note>
212    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
213    /// </note>
214    pub fn grant_read(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215        self.inner = self.inner.grant_read(input.into());
216        self
217    }
218    /// <p>Allows grantee to list the objects in the bucket.</p><note>
219    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
220    /// </note>
221    pub fn set_grant_read(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222        self.inner = self.inner.set_grant_read(input);
223        self
224    }
225    /// <p>Allows grantee to list the objects in the bucket.</p><note>
226    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
227    /// </note>
228    pub fn get_grant_read(&self) -> &::std::option::Option<::std::string::String> {
229        self.inner.get_grant_read()
230    }
231    /// <p>Allows grantee to read the bucket ACL.</p><note>
232    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
233    /// </note>
234    pub fn grant_read_acp(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.inner = self.inner.grant_read_acp(input.into());
236        self
237    }
238    /// <p>Allows grantee to read the bucket ACL.</p><note>
239    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
240    /// </note>
241    pub fn set_grant_read_acp(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
242        self.inner = self.inner.set_grant_read_acp(input);
243        self
244    }
245    /// <p>Allows grantee to read the bucket ACL.</p><note>
246    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
247    /// </note>
248    pub fn get_grant_read_acp(&self) -> &::std::option::Option<::std::string::String> {
249        self.inner.get_grant_read_acp()
250    }
251    /// <p>Allows grantee to create, overwrite, and delete any object in the bucket.</p><note>
252    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
253    /// </note>
254    pub fn grant_write(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
255        self.inner = self.inner.grant_write(input.into());
256        self
257    }
258    /// <p>Allows grantee to create, overwrite, and delete any object in the bucket.</p><note>
259    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
260    /// </note>
261    pub fn set_grant_write(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262        self.inner = self.inner.set_grant_write(input);
263        self
264    }
265    /// <p>Allows grantee to create, overwrite, and delete any object in the bucket.</p><note>
266    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
267    /// </note>
268    pub fn get_grant_write(&self) -> &::std::option::Option<::std::string::String> {
269        self.inner.get_grant_write()
270    }
271    /// <p>Allows grantee to write the ACL for the applicable bucket.</p><note>
272    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
273    /// </note>
274    pub fn grant_write_acp(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
275        self.inner = self.inner.grant_write_acp(input.into());
276        self
277    }
278    /// <p>Allows grantee to write the ACL for the applicable bucket.</p><note>
279    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
280    /// </note>
281    pub fn set_grant_write_acp(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
282        self.inner = self.inner.set_grant_write_acp(input);
283        self
284    }
285    /// <p>Allows grantee to write the ACL for the applicable bucket.</p><note>
286    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
287    /// </note>
288    pub fn get_grant_write_acp(&self) -> &::std::option::Option<::std::string::String> {
289        self.inner.get_grant_write_acp()
290    }
291    /// <p>Specifies whether you want S3 Object Lock to be enabled for the new bucket.</p><note>
292    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
293    /// </note>
294    pub fn object_lock_enabled_for_bucket(mut self, input: bool) -> Self {
295        self.inner = self.inner.object_lock_enabled_for_bucket(input);
296        self
297    }
298    /// <p>Specifies whether you want S3 Object Lock to be enabled for the new bucket.</p><note>
299    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
300    /// </note>
301    pub fn set_object_lock_enabled_for_bucket(mut self, input: ::std::option::Option<bool>) -> Self {
302        self.inner = self.inner.set_object_lock_enabled_for_bucket(input);
303        self
304    }
305    /// <p>Specifies whether you want S3 Object Lock to be enabled for the new bucket.</p><note>
306    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
307    /// </note>
308    pub fn get_object_lock_enabled_for_bucket(&self) -> &::std::option::Option<bool> {
309        self.inner.get_object_lock_enabled_for_bucket()
310    }
311    /// <p>The ID of the Outposts where the bucket is being created.</p><note>
312    /// <p>This ID is required by Amazon S3 on Outposts buckets.</p>
313    /// </note>
314    pub fn outpost_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
315        self.inner = self.inner.outpost_id(input.into());
316        self
317    }
318    /// <p>The ID of the Outposts where the bucket is being created.</p><note>
319    /// <p>This ID is required by Amazon S3 on Outposts buckets.</p>
320    /// </note>
321    pub fn set_outpost_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
322        self.inner = self.inner.set_outpost_id(input);
323        self
324    }
325    /// <p>The ID of the Outposts where the bucket is being created.</p><note>
326    /// <p>This ID is required by Amazon S3 on Outposts buckets.</p>
327    /// </note>
328    pub fn get_outpost_id(&self) -> &::std::option::Option<::std::string::String> {
329        self.inner.get_outpost_id()
330    }
331}