aws_sdk_s3control/operation/create_bucket/
_create_bucket_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateBucketInput {
6    /// <p>The canned ACL to apply to the bucket.</p><note>
7    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
8    /// </note>
9    pub acl: ::std::option::Option<crate::types::BucketCannedAcl>,
10    /// <p>The name of the bucket.</p>
11    pub bucket: ::std::option::Option<::std::string::String>,
12    /// <p>The configuration information for the bucket.</p><note>
13    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
14    /// </note>
15    pub create_bucket_configuration: ::std::option::Option<crate::types::CreateBucketConfiguration>,
16    /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p><note>
17    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
18    /// </note>
19    pub grant_full_control: ::std::option::Option<::std::string::String>,
20    /// <p>Allows grantee to list the objects in the bucket.</p><note>
21    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
22    /// </note>
23    pub grant_read: ::std::option::Option<::std::string::String>,
24    /// <p>Allows grantee to read the bucket ACL.</p><note>
25    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
26    /// </note>
27    pub grant_read_acp: ::std::option::Option<::std::string::String>,
28    /// <p>Allows grantee to create, overwrite, and delete any object in the bucket.</p><note>
29    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
30    /// </note>
31    pub grant_write: ::std::option::Option<::std::string::String>,
32    /// <p>Allows grantee to write the ACL for the applicable bucket.</p><note>
33    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
34    /// </note>
35    pub grant_write_acp: ::std::option::Option<::std::string::String>,
36    /// <p>Specifies whether you want S3 Object Lock to be enabled for the new bucket.</p><note>
37    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
38    /// </note>
39    pub object_lock_enabled_for_bucket: ::std::option::Option<bool>,
40    /// <p>The ID of the Outposts where the bucket is being created.</p><note>
41    /// <p>This ID is required by Amazon S3 on Outposts buckets.</p>
42    /// </note>
43    pub outpost_id: ::std::option::Option<::std::string::String>,
44}
45impl CreateBucketInput {
46    /// <p>The canned ACL to apply to the bucket.</p><note>
47    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
48    /// </note>
49    pub fn acl(&self) -> ::std::option::Option<&crate::types::BucketCannedAcl> {
50        self.acl.as_ref()
51    }
52    /// <p>The name of the bucket.</p>
53    pub fn bucket(&self) -> ::std::option::Option<&str> {
54        self.bucket.as_deref()
55    }
56    /// <p>The configuration information for the bucket.</p><note>
57    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
58    /// </note>
59    pub fn create_bucket_configuration(&self) -> ::std::option::Option<&crate::types::CreateBucketConfiguration> {
60        self.create_bucket_configuration.as_ref()
61    }
62    /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p><note>
63    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
64    /// </note>
65    pub fn grant_full_control(&self) -> ::std::option::Option<&str> {
66        self.grant_full_control.as_deref()
67    }
68    /// <p>Allows grantee to list the objects in the bucket.</p><note>
69    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
70    /// </note>
71    pub fn grant_read(&self) -> ::std::option::Option<&str> {
72        self.grant_read.as_deref()
73    }
74    /// <p>Allows grantee to read the bucket ACL.</p><note>
75    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
76    /// </note>
77    pub fn grant_read_acp(&self) -> ::std::option::Option<&str> {
78        self.grant_read_acp.as_deref()
79    }
80    /// <p>Allows grantee to create, overwrite, and delete any object in the bucket.</p><note>
81    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
82    /// </note>
83    pub fn grant_write(&self) -> ::std::option::Option<&str> {
84        self.grant_write.as_deref()
85    }
86    /// <p>Allows grantee to write the ACL for the applicable bucket.</p><note>
87    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
88    /// </note>
89    pub fn grant_write_acp(&self) -> ::std::option::Option<&str> {
90        self.grant_write_acp.as_deref()
91    }
92    /// <p>Specifies whether you want S3 Object Lock to be enabled for the new bucket.</p><note>
93    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
94    /// </note>
95    pub fn object_lock_enabled_for_bucket(&self) -> ::std::option::Option<bool> {
96        self.object_lock_enabled_for_bucket
97    }
98    /// <p>The ID of the Outposts where the bucket is being created.</p><note>
99    /// <p>This ID is required by Amazon S3 on Outposts buckets.</p>
100    /// </note>
101    pub fn outpost_id(&self) -> ::std::option::Option<&str> {
102        self.outpost_id.as_deref()
103    }
104}
105impl CreateBucketInput {
106    /// Creates a new builder-style object to manufacture [`CreateBucketInput`](crate::operation::create_bucket::CreateBucketInput).
107    pub fn builder() -> crate::operation::create_bucket::builders::CreateBucketInputBuilder {
108        crate::operation::create_bucket::builders::CreateBucketInputBuilder::default()
109    }
110}
111
112/// A builder for [`CreateBucketInput`](crate::operation::create_bucket::CreateBucketInput).
113#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
114#[non_exhaustive]
115pub struct CreateBucketInputBuilder {
116    pub(crate) acl: ::std::option::Option<crate::types::BucketCannedAcl>,
117    pub(crate) bucket: ::std::option::Option<::std::string::String>,
118    pub(crate) create_bucket_configuration: ::std::option::Option<crate::types::CreateBucketConfiguration>,
119    pub(crate) grant_full_control: ::std::option::Option<::std::string::String>,
120    pub(crate) grant_read: ::std::option::Option<::std::string::String>,
121    pub(crate) grant_read_acp: ::std::option::Option<::std::string::String>,
122    pub(crate) grant_write: ::std::option::Option<::std::string::String>,
123    pub(crate) grant_write_acp: ::std::option::Option<::std::string::String>,
124    pub(crate) object_lock_enabled_for_bucket: ::std::option::Option<bool>,
125    pub(crate) outpost_id: ::std::option::Option<::std::string::String>,
126}
127impl CreateBucketInputBuilder {
128    /// <p>The canned ACL to apply to the bucket.</p><note>
129    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
130    /// </note>
131    pub fn acl(mut self, input: crate::types::BucketCannedAcl) -> Self {
132        self.acl = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>The canned ACL to apply to the bucket.</p><note>
136    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
137    /// </note>
138    pub fn set_acl(mut self, input: ::std::option::Option<crate::types::BucketCannedAcl>) -> Self {
139        self.acl = input;
140        self
141    }
142    /// <p>The canned ACL to apply to the bucket.</p><note>
143    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
144    /// </note>
145    pub fn get_acl(&self) -> &::std::option::Option<crate::types::BucketCannedAcl> {
146        &self.acl
147    }
148    /// <p>The name of the bucket.</p>
149    /// This field is required.
150    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.bucket = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// <p>The name of the bucket.</p>
155    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.bucket = input;
157        self
158    }
159    /// <p>The name of the bucket.</p>
160    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
161        &self.bucket
162    }
163    /// <p>The configuration information for the bucket.</p><note>
164    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
165    /// </note>
166    pub fn create_bucket_configuration(mut self, input: crate::types::CreateBucketConfiguration) -> Self {
167        self.create_bucket_configuration = ::std::option::Option::Some(input);
168        self
169    }
170    /// <p>The configuration information for the bucket.</p><note>
171    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
172    /// </note>
173    pub fn set_create_bucket_configuration(mut self, input: ::std::option::Option<crate::types::CreateBucketConfiguration>) -> Self {
174        self.create_bucket_configuration = input;
175        self
176    }
177    /// <p>The configuration information for the bucket.</p><note>
178    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
179    /// </note>
180    pub fn get_create_bucket_configuration(&self) -> &::std::option::Option<crate::types::CreateBucketConfiguration> {
181        &self.create_bucket_configuration
182    }
183    /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p><note>
184    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
185    /// </note>
186    pub fn grant_full_control(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.grant_full_control = ::std::option::Option::Some(input.into());
188        self
189    }
190    /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p><note>
191    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
192    /// </note>
193    pub fn set_grant_full_control(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194        self.grant_full_control = input;
195        self
196    }
197    /// <p>Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.</p><note>
198    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
199    /// </note>
200    pub fn get_grant_full_control(&self) -> &::std::option::Option<::std::string::String> {
201        &self.grant_full_control
202    }
203    /// <p>Allows grantee to list the objects in the bucket.</p><note>
204    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
205    /// </note>
206    pub fn grant_read(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.grant_read = ::std::option::Option::Some(input.into());
208        self
209    }
210    /// <p>Allows grantee to list the objects in the bucket.</p><note>
211    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
212    /// </note>
213    pub fn set_grant_read(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214        self.grant_read = input;
215        self
216    }
217    /// <p>Allows grantee to list the objects in the bucket.</p><note>
218    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
219    /// </note>
220    pub fn get_grant_read(&self) -> &::std::option::Option<::std::string::String> {
221        &self.grant_read
222    }
223    /// <p>Allows grantee to read the bucket ACL.</p><note>
224    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
225    /// </note>
226    pub fn grant_read_acp(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227        self.grant_read_acp = ::std::option::Option::Some(input.into());
228        self
229    }
230    /// <p>Allows grantee to read the bucket ACL.</p><note>
231    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
232    /// </note>
233    pub fn set_grant_read_acp(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234        self.grant_read_acp = input;
235        self
236    }
237    /// <p>Allows grantee to read the bucket ACL.</p><note>
238    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
239    /// </note>
240    pub fn get_grant_read_acp(&self) -> &::std::option::Option<::std::string::String> {
241        &self.grant_read_acp
242    }
243    /// <p>Allows grantee to create, overwrite, and delete any object in the bucket.</p><note>
244    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
245    /// </note>
246    pub fn grant_write(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
247        self.grant_write = ::std::option::Option::Some(input.into());
248        self
249    }
250    /// <p>Allows grantee to create, overwrite, and delete any object in the bucket.</p><note>
251    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
252    /// </note>
253    pub fn set_grant_write(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
254        self.grant_write = input;
255        self
256    }
257    /// <p>Allows grantee to create, overwrite, and delete any object in the bucket.</p><note>
258    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
259    /// </note>
260    pub fn get_grant_write(&self) -> &::std::option::Option<::std::string::String> {
261        &self.grant_write
262    }
263    /// <p>Allows grantee to write the ACL for the applicable bucket.</p><note>
264    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
265    /// </note>
266    pub fn grant_write_acp(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
267        self.grant_write_acp = ::std::option::Option::Some(input.into());
268        self
269    }
270    /// <p>Allows grantee to write the ACL for the applicable bucket.</p><note>
271    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
272    /// </note>
273    pub fn set_grant_write_acp(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
274        self.grant_write_acp = input;
275        self
276    }
277    /// <p>Allows grantee to write the ACL for the applicable bucket.</p><note>
278    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
279    /// </note>
280    pub fn get_grant_write_acp(&self) -> &::std::option::Option<::std::string::String> {
281        &self.grant_write_acp
282    }
283    /// <p>Specifies whether you want S3 Object Lock to be enabled for the new bucket.</p><note>
284    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
285    /// </note>
286    pub fn object_lock_enabled_for_bucket(mut self, input: bool) -> Self {
287        self.object_lock_enabled_for_bucket = ::std::option::Option::Some(input);
288        self
289    }
290    /// <p>Specifies whether you want S3 Object Lock to be enabled for the new bucket.</p><note>
291    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
292    /// </note>
293    pub fn set_object_lock_enabled_for_bucket(mut self, input: ::std::option::Option<bool>) -> Self {
294        self.object_lock_enabled_for_bucket = input;
295        self
296    }
297    /// <p>Specifies whether you want S3 Object Lock to be enabled for the new bucket.</p><note>
298    /// <p>This is not supported by Amazon S3 on Outposts buckets.</p>
299    /// </note>
300    pub fn get_object_lock_enabled_for_bucket(&self) -> &::std::option::Option<bool> {
301        &self.object_lock_enabled_for_bucket
302    }
303    /// <p>The ID of the Outposts where the bucket is being created.</p><note>
304    /// <p>This ID is required by Amazon S3 on Outposts buckets.</p>
305    /// </note>
306    pub fn outpost_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
307        self.outpost_id = ::std::option::Option::Some(input.into());
308        self
309    }
310    /// <p>The ID of the Outposts where the bucket is being created.</p><note>
311    /// <p>This ID is required by Amazon S3 on Outposts buckets.</p>
312    /// </note>
313    pub fn set_outpost_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
314        self.outpost_id = input;
315        self
316    }
317    /// <p>The ID of the Outposts where the bucket is being created.</p><note>
318    /// <p>This ID is required by Amazon S3 on Outposts buckets.</p>
319    /// </note>
320    pub fn get_outpost_id(&self) -> &::std::option::Option<::std::string::String> {
321        &self.outpost_id
322    }
323    /// Consumes the builder and constructs a [`CreateBucketInput`](crate::operation::create_bucket::CreateBucketInput).
324    pub fn build(
325        self,
326    ) -> ::std::result::Result<crate::operation::create_bucket::CreateBucketInput, ::aws_smithy_types::error::operation::BuildError> {
327        ::std::result::Result::Ok(crate::operation::create_bucket::CreateBucketInput {
328            acl: self.acl,
329            bucket: self.bucket,
330            create_bucket_configuration: self.create_bucket_configuration,
331            grant_full_control: self.grant_full_control,
332            grant_read: self.grant_read,
333            grant_read_acp: self.grant_read_acp,
334            grant_write: self.grant_write,
335            grant_write_acp: self.grant_write_acp,
336            object_lock_enabled_for_bucket: self.object_lock_enabled_for_bucket,
337            outpost_id: self.outpost_id,
338        })
339    }
340}