aws-sdk-lightsail 1.106.0

AWS SDK for Amazon Lightsail
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes an Amazon Lightsail bucket.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Bucket {
    /// <p>The Lightsail resource type of the bucket.</p>
    pub resource_type: ::std::option::Option<::std::string::String>,
    /// <p>An object that describes the access rules of the bucket.</p>
    pub access_rules: ::std::option::Option<crate::types::AccessRules>,
    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the bundle currently applied to the bucket.</p>
    /// <p>A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html">UpdateBucketBundle</a> action to change the bundle of a bucket.</p>
    pub bundle_id: ::std::option::Option<::std::string::String>,
    /// <p>The timestamp when the distribution was created.</p>
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The URL of the bucket.</p>
    pub url: ::std::option::Option<::std::string::String>,
    /// <p>An object that describes the location of the bucket, such as the Amazon Web Services Region and Availability Zone.</p>
    pub location: ::std::option::Option<crate::types::ResourceLocation>,
    /// <p>The name of the bucket.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The support code for a bucket. Include this code in your email to support when you have questions about a Lightsail bucket. This code enables our support team to look up your Lightsail information more easily.</p>
    pub support_code: ::std::option::Option<::std::string::String>,
    /// <p>The tag keys and optional values for the bucket. For more information, see <a href="https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags">Tags in Amazon Lightsail</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>Indicates whether object versioning is enabled for the bucket.</p>
    /// <p>The following options can be configured:</p>
    /// <ul>
    /// <li>
    /// <p><code>Enabled</code> - Object versioning is enabled.</p></li>
    /// <li>
    /// <p><code>Suspended</code> - Object versioning was previously enabled but is currently suspended. Existing object versions are retained.</p></li>
    /// <li>
    /// <p><code>NeverEnabled</code> - Object versioning has never been enabled.</p></li>
    /// </ul>
    pub object_versioning: ::std::option::Option<::std::string::String>,
    /// <p>Indicates whether the bundle that is currently applied to a bucket can be changed to another bundle.</p>
    /// <p>You can update a bucket's bundle only one time within a monthly Amazon Web Services billing cycle.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html">UpdateBucketBundle</a> action to change a bucket's bundle.</p>
    pub able_to_update_bundle: ::std::option::Option<bool>,
    /// <p>An array of strings that specify the Amazon Web Services account IDs that have read-only access to the bucket.</p>
    pub readonly_access_accounts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>An array of objects that describe Lightsail instances that have access to the bucket.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html">SetResourceAccessForBucket</a> action to update the instances that have access to a bucket.</p>
    pub resources_receiving_access: ::std::option::Option<::std::vec::Vec<crate::types::ResourceReceivingAccess>>,
    /// <p>An object that describes the state of the bucket.</p>
    pub state: ::std::option::Option<crate::types::BucketState>,
    /// <p>An object that describes the access log configuration for the bucket.</p>
    pub access_log_config: ::std::option::Option<crate::types::BucketAccessLogConfig>,
    /// <p>An array of cross-origin resource sharing (CORS) rules that identify origins and the HTTP methods that can be executed on your bucket. This field is only included in the response when CORS configuration is requested or when updating CORS configuration. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p>
    pub cors: ::std::option::Option<crate::types::BucketCorsConfig>,
}
impl Bucket {
    /// <p>The Lightsail resource type of the bucket.</p>
    pub fn resource_type(&self) -> ::std::option::Option<&str> {
        self.resource_type.as_deref()
    }
    /// <p>An object that describes the access rules of the bucket.</p>
    pub fn access_rules(&self) -> ::std::option::Option<&crate::types::AccessRules> {
        self.access_rules.as_ref()
    }
    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The ID of the bundle currently applied to the bucket.</p>
    /// <p>A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html">UpdateBucketBundle</a> action to change the bundle of a bucket.</p>
    pub fn bundle_id(&self) -> ::std::option::Option<&str> {
        self.bundle_id.as_deref()
    }
    /// <p>The timestamp when the distribution was created.</p>
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>The URL of the bucket.</p>
    pub fn url(&self) -> ::std::option::Option<&str> {
        self.url.as_deref()
    }
    /// <p>An object that describes the location of the bucket, such as the Amazon Web Services Region and Availability Zone.</p>
    pub fn location(&self) -> ::std::option::Option<&crate::types::ResourceLocation> {
        self.location.as_ref()
    }
    /// <p>The name of the bucket.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The support code for a bucket. Include this code in your email to support when you have questions about a Lightsail bucket. This code enables our support team to look up your Lightsail information more easily.</p>
    pub fn support_code(&self) -> ::std::option::Option<&str> {
        self.support_code.as_deref()
    }
    /// <p>The tag keys and optional values for the bucket. For more information, see <a href="https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags">Tags in Amazon Lightsail</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
    /// <p>Indicates whether object versioning is enabled for the bucket.</p>
    /// <p>The following options can be configured:</p>
    /// <ul>
    /// <li>
    /// <p><code>Enabled</code> - Object versioning is enabled.</p></li>
    /// <li>
    /// <p><code>Suspended</code> - Object versioning was previously enabled but is currently suspended. Existing object versions are retained.</p></li>
    /// <li>
    /// <p><code>NeverEnabled</code> - Object versioning has never been enabled.</p></li>
    /// </ul>
    pub fn object_versioning(&self) -> ::std::option::Option<&str> {
        self.object_versioning.as_deref()
    }
    /// <p>Indicates whether the bundle that is currently applied to a bucket can be changed to another bundle.</p>
    /// <p>You can update a bucket's bundle only one time within a monthly Amazon Web Services billing cycle.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html">UpdateBucketBundle</a> action to change a bucket's bundle.</p>
    pub fn able_to_update_bundle(&self) -> ::std::option::Option<bool> {
        self.able_to_update_bundle
    }
    /// <p>An array of strings that specify the Amazon Web Services account IDs that have read-only access to the bucket.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.readonly_access_accounts.is_none()`.
    pub fn readonly_access_accounts(&self) -> &[::std::string::String] {
        self.readonly_access_accounts.as_deref().unwrap_or_default()
    }
    /// <p>An array of objects that describe Lightsail instances that have access to the bucket.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html">SetResourceAccessForBucket</a> action to update the instances that have access to a bucket.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources_receiving_access.is_none()`.
    pub fn resources_receiving_access(&self) -> &[crate::types::ResourceReceivingAccess] {
        self.resources_receiving_access.as_deref().unwrap_or_default()
    }
    /// <p>An object that describes the state of the bucket.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::BucketState> {
        self.state.as_ref()
    }
    /// <p>An object that describes the access log configuration for the bucket.</p>
    pub fn access_log_config(&self) -> ::std::option::Option<&crate::types::BucketAccessLogConfig> {
        self.access_log_config.as_ref()
    }
    /// <p>An array of cross-origin resource sharing (CORS) rules that identify origins and the HTTP methods that can be executed on your bucket. This field is only included in the response when CORS configuration is requested or when updating CORS configuration. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p>
    pub fn cors(&self) -> ::std::option::Option<&crate::types::BucketCorsConfig> {
        self.cors.as_ref()
    }
}
impl Bucket {
    /// Creates a new builder-style object to manufacture [`Bucket`](crate::types::Bucket).
    pub fn builder() -> crate::types::builders::BucketBuilder {
        crate::types::builders::BucketBuilder::default()
    }
}

/// A builder for [`Bucket`](crate::types::Bucket).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BucketBuilder {
    pub(crate) resource_type: ::std::option::Option<::std::string::String>,
    pub(crate) access_rules: ::std::option::Option<crate::types::AccessRules>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) bundle_id: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) url: ::std::option::Option<::std::string::String>,
    pub(crate) location: ::std::option::Option<crate::types::ResourceLocation>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) support_code: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) object_versioning: ::std::option::Option<::std::string::String>,
    pub(crate) able_to_update_bundle: ::std::option::Option<bool>,
    pub(crate) readonly_access_accounts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) resources_receiving_access: ::std::option::Option<::std::vec::Vec<crate::types::ResourceReceivingAccess>>,
    pub(crate) state: ::std::option::Option<crate::types::BucketState>,
    pub(crate) access_log_config: ::std::option::Option<crate::types::BucketAccessLogConfig>,
    pub(crate) cors: ::std::option::Option<crate::types::BucketCorsConfig>,
}
impl BucketBuilder {
    /// <p>The Lightsail resource type of the bucket.</p>
    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Lightsail resource type of the bucket.</p>
    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_type = input;
        self
    }
    /// <p>The Lightsail resource type of the bucket.</p>
    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_type
    }
    /// <p>An object that describes the access rules of the bucket.</p>
    pub fn access_rules(mut self, input: crate::types::AccessRules) -> Self {
        self.access_rules = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that describes the access rules of the bucket.</p>
    pub fn set_access_rules(mut self, input: ::std::option::Option<crate::types::AccessRules>) -> Self {
        self.access_rules = input;
        self
    }
    /// <p>An object that describes the access rules of the bucket.</p>
    pub fn get_access_rules(&self) -> &::std::option::Option<crate::types::AccessRules> {
        &self.access_rules
    }
    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The ID of the bundle currently applied to the bucket.</p>
    /// <p>A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html">UpdateBucketBundle</a> action to change the bundle of a bucket.</p>
    pub fn bundle_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.bundle_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the bundle currently applied to the bucket.</p>
    /// <p>A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html">UpdateBucketBundle</a> action to change the bundle of a bucket.</p>
    pub fn set_bundle_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.bundle_id = input;
        self
    }
    /// <p>The ID of the bundle currently applied to the bucket.</p>
    /// <p>A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html">UpdateBucketBundle</a> action to change the bundle of a bucket.</p>
    pub fn get_bundle_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.bundle_id
    }
    /// <p>The timestamp when the distribution was created.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp when the distribution was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The timestamp when the distribution was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The URL of the bucket.</p>
    pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URL of the bucket.</p>
    pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.url = input;
        self
    }
    /// <p>The URL of the bucket.</p>
    pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.url
    }
    /// <p>An object that describes the location of the bucket, such as the Amazon Web Services Region and Availability Zone.</p>
    pub fn location(mut self, input: crate::types::ResourceLocation) -> Self {
        self.location = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that describes the location of the bucket, such as the Amazon Web Services Region and Availability Zone.</p>
    pub fn set_location(mut self, input: ::std::option::Option<crate::types::ResourceLocation>) -> Self {
        self.location = input;
        self
    }
    /// <p>An object that describes the location of the bucket, such as the Amazon Web Services Region and Availability Zone.</p>
    pub fn get_location(&self) -> &::std::option::Option<crate::types::ResourceLocation> {
        &self.location
    }
    /// <p>The name of the bucket.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the bucket.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the bucket.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The support code for a bucket. Include this code in your email to support when you have questions about a Lightsail bucket. This code enables our support team to look up your Lightsail information more easily.</p>
    pub fn support_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.support_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The support code for a bucket. Include this code in your email to support when you have questions about a Lightsail bucket. This code enables our support team to look up your Lightsail information more easily.</p>
    pub fn set_support_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.support_code = input;
        self
    }
    /// <p>The support code for a bucket. Include this code in your email to support when you have questions about a Lightsail bucket. This code enables our support team to look up your Lightsail information more easily.</p>
    pub fn get_support_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.support_code
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tag keys and optional values for the bucket. For more information, see <a href="https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags">Tags in Amazon Lightsail</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>The tag keys and optional values for the bucket. For more information, see <a href="https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags">Tags in Amazon Lightsail</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tag keys and optional values for the bucket. For more information, see <a href="https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags">Tags in Amazon Lightsail</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>Indicates whether object versioning is enabled for the bucket.</p>
    /// <p>The following options can be configured:</p>
    /// <ul>
    /// <li>
    /// <p><code>Enabled</code> - Object versioning is enabled.</p></li>
    /// <li>
    /// <p><code>Suspended</code> - Object versioning was previously enabled but is currently suspended. Existing object versions are retained.</p></li>
    /// <li>
    /// <p><code>NeverEnabled</code> - Object versioning has never been enabled.</p></li>
    /// </ul>
    pub fn object_versioning(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.object_versioning = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Indicates whether object versioning is enabled for the bucket.</p>
    /// <p>The following options can be configured:</p>
    /// <ul>
    /// <li>
    /// <p><code>Enabled</code> - Object versioning is enabled.</p></li>
    /// <li>
    /// <p><code>Suspended</code> - Object versioning was previously enabled but is currently suspended. Existing object versions are retained.</p></li>
    /// <li>
    /// <p><code>NeverEnabled</code> - Object versioning has never been enabled.</p></li>
    /// </ul>
    pub fn set_object_versioning(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.object_versioning = input;
        self
    }
    /// <p>Indicates whether object versioning is enabled for the bucket.</p>
    /// <p>The following options can be configured:</p>
    /// <ul>
    /// <li>
    /// <p><code>Enabled</code> - Object versioning is enabled.</p></li>
    /// <li>
    /// <p><code>Suspended</code> - Object versioning was previously enabled but is currently suspended. Existing object versions are retained.</p></li>
    /// <li>
    /// <p><code>NeverEnabled</code> - Object versioning has never been enabled.</p></li>
    /// </ul>
    pub fn get_object_versioning(&self) -> &::std::option::Option<::std::string::String> {
        &self.object_versioning
    }
    /// <p>Indicates whether the bundle that is currently applied to a bucket can be changed to another bundle.</p>
    /// <p>You can update a bucket's bundle only one time within a monthly Amazon Web Services billing cycle.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html">UpdateBucketBundle</a> action to change a bucket's bundle.</p>
    pub fn able_to_update_bundle(mut self, input: bool) -> Self {
        self.able_to_update_bundle = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether the bundle that is currently applied to a bucket can be changed to another bundle.</p>
    /// <p>You can update a bucket's bundle only one time within a monthly Amazon Web Services billing cycle.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html">UpdateBucketBundle</a> action to change a bucket's bundle.</p>
    pub fn set_able_to_update_bundle(mut self, input: ::std::option::Option<bool>) -> Self {
        self.able_to_update_bundle = input;
        self
    }
    /// <p>Indicates whether the bundle that is currently applied to a bucket can be changed to another bundle.</p>
    /// <p>You can update a bucket's bundle only one time within a monthly Amazon Web Services billing cycle.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html">UpdateBucketBundle</a> action to change a bucket's bundle.</p>
    pub fn get_able_to_update_bundle(&self) -> &::std::option::Option<bool> {
        &self.able_to_update_bundle
    }
    /// Appends an item to `readonly_access_accounts`.
    ///
    /// To override the contents of this collection use [`set_readonly_access_accounts`](Self::set_readonly_access_accounts).
    ///
    /// <p>An array of strings that specify the Amazon Web Services account IDs that have read-only access to the bucket.</p>
    pub fn readonly_access_accounts(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.readonly_access_accounts.unwrap_or_default();
        v.push(input.into());
        self.readonly_access_accounts = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of strings that specify the Amazon Web Services account IDs that have read-only access to the bucket.</p>
    pub fn set_readonly_access_accounts(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.readonly_access_accounts = input;
        self
    }
    /// <p>An array of strings that specify the Amazon Web Services account IDs that have read-only access to the bucket.</p>
    pub fn get_readonly_access_accounts(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.readonly_access_accounts
    }
    /// Appends an item to `resources_receiving_access`.
    ///
    /// To override the contents of this collection use [`set_resources_receiving_access`](Self::set_resources_receiving_access).
    ///
    /// <p>An array of objects that describe Lightsail instances that have access to the bucket.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html">SetResourceAccessForBucket</a> action to update the instances that have access to a bucket.</p>
    pub fn resources_receiving_access(mut self, input: crate::types::ResourceReceivingAccess) -> Self {
        let mut v = self.resources_receiving_access.unwrap_or_default();
        v.push(input);
        self.resources_receiving_access = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of objects that describe Lightsail instances that have access to the bucket.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html">SetResourceAccessForBucket</a> action to update the instances that have access to a bucket.</p>
    pub fn set_resources_receiving_access(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceReceivingAccess>>) -> Self {
        self.resources_receiving_access = input;
        self
    }
    /// <p>An array of objects that describe Lightsail instances that have access to the bucket.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html">SetResourceAccessForBucket</a> action to update the instances that have access to a bucket.</p>
    pub fn get_resources_receiving_access(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceReceivingAccess>> {
        &self.resources_receiving_access
    }
    /// <p>An object that describes the state of the bucket.</p>
    pub fn state(mut self, input: crate::types::BucketState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that describes the state of the bucket.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::BucketState>) -> Self {
        self.state = input;
        self
    }
    /// <p>An object that describes the state of the bucket.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::BucketState> {
        &self.state
    }
    /// <p>An object that describes the access log configuration for the bucket.</p>
    pub fn access_log_config(mut self, input: crate::types::BucketAccessLogConfig) -> Self {
        self.access_log_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that describes the access log configuration for the bucket.</p>
    pub fn set_access_log_config(mut self, input: ::std::option::Option<crate::types::BucketAccessLogConfig>) -> Self {
        self.access_log_config = input;
        self
    }
    /// <p>An object that describes the access log configuration for the bucket.</p>
    pub fn get_access_log_config(&self) -> &::std::option::Option<crate::types::BucketAccessLogConfig> {
        &self.access_log_config
    }
    /// <p>An array of cross-origin resource sharing (CORS) rules that identify origins and the HTTP methods that can be executed on your bucket. This field is only included in the response when CORS configuration is requested or when updating CORS configuration. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p>
    pub fn cors(mut self, input: crate::types::BucketCorsConfig) -> Self {
        self.cors = ::std::option::Option::Some(input);
        self
    }
    /// <p>An array of cross-origin resource sharing (CORS) rules that identify origins and the HTTP methods that can be executed on your bucket. This field is only included in the response when CORS configuration is requested or when updating CORS configuration. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p>
    pub fn set_cors(mut self, input: ::std::option::Option<crate::types::BucketCorsConfig>) -> Self {
        self.cors = input;
        self
    }
    /// <p>An array of cross-origin resource sharing (CORS) rules that identify origins and the HTTP methods that can be executed on your bucket. This field is only included in the response when CORS configuration is requested or when updating CORS configuration. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p>
    pub fn get_cors(&self) -> &::std::option::Option<crate::types::BucketCorsConfig> {
        &self.cors
    }
    /// Consumes the builder and constructs a [`Bucket`](crate::types::Bucket).
    pub fn build(self) -> crate::types::Bucket {
        crate::types::Bucket {
            resource_type: self.resource_type,
            access_rules: self.access_rules,
            arn: self.arn,
            bundle_id: self.bundle_id,
            created_at: self.created_at,
            url: self.url,
            location: self.location,
            name: self.name,
            support_code: self.support_code,
            tags: self.tags,
            object_versioning: self.object_versioning,
            able_to_update_bundle: self.able_to_update_bundle,
            readonly_access_accounts: self.readonly_access_accounts,
            resources_receiving_access: self.resources_receiving_access,
            state: self.state,
            access_log_config: self.access_log_config,
            cors: self.cors,
        }
    }
}