1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
23/// <p>In terms of implementation, a Bucket is a resource.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Bucket {
7/// <p>The name of the bucket.</p>
8pub name: ::std::option::Option<::std::string::String>,
9/// <p>Date the bucket was created. This date can change when making changes to your bucket, such as editing its bucket policy.</p>
10pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
11/// <p><code>BucketRegion</code> indicates the Amazon Web Services region where the bucket is located. If the request contains at least one valid parameter, it is included in the response.</p>
12pub bucket_region: ::std::option::Option<::std::string::String>,
13}
14impl Bucket {
15/// <p>The name of the bucket.</p>
16pub fn name(&self) -> ::std::option::Option<&str> {
17self.name.as_deref()
18 }
19/// <p>Date the bucket was created. This date can change when making changes to your bucket, such as editing its bucket policy.</p>
20pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
21self.creation_date.as_ref()
22 }
23/// <p><code>BucketRegion</code> indicates the Amazon Web Services region where the bucket is located. If the request contains at least one valid parameter, it is included in the response.</p>
24pub fn bucket_region(&self) -> ::std::option::Option<&str> {
25self.bucket_region.as_deref()
26 }
27}
28impl Bucket {
29/// Creates a new builder-style object to manufacture [`Bucket`](crate::types::Bucket).
30pub fn builder() -> crate::types::builders::BucketBuilder {
31crate::types::builders::BucketBuilder::default()
32 }
33}
3435/// A builder for [`Bucket`](crate::types::Bucket).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct BucketBuilder {
39pub(crate) name: ::std::option::Option<::std::string::String>,
40pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
41pub(crate) bucket_region: ::std::option::Option<::std::string::String>,
42}
43impl BucketBuilder {
44/// <p>The name of the bucket.</p>
45pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46self.name = ::std::option::Option::Some(input.into());
47self
48}
49/// <p>The name of the bucket.</p>
50pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51self.name = input;
52self
53}
54/// <p>The name of the bucket.</p>
55pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
56&self.name
57 }
58/// <p>Date the bucket was created. This date can change when making changes to your bucket, such as editing its bucket policy.</p>
59pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
60self.creation_date = ::std::option::Option::Some(input);
61self
62}
63/// <p>Date the bucket was created. This date can change when making changes to your bucket, such as editing its bucket policy.</p>
64pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
65self.creation_date = input;
66self
67}
68/// <p>Date the bucket was created. This date can change when making changes to your bucket, such as editing its bucket policy.</p>
69pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
70&self.creation_date
71 }
72/// <p><code>BucketRegion</code> indicates the Amazon Web Services region where the bucket is located. If the request contains at least one valid parameter, it is included in the response.</p>
73pub fn bucket_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74self.bucket_region = ::std::option::Option::Some(input.into());
75self
76}
77/// <p><code>BucketRegion</code> indicates the Amazon Web Services region where the bucket is located. If the request contains at least one valid parameter, it is included in the response.</p>
78pub fn set_bucket_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79self.bucket_region = input;
80self
81}
82/// <p><code>BucketRegion</code> indicates the Amazon Web Services region where the bucket is located. If the request contains at least one valid parameter, it is included in the response.</p>
83pub fn get_bucket_region(&self) -> &::std::option::Option<::std::string::String> {
84&self.bucket_region
85 }
86/// Consumes the builder and constructs a [`Bucket`](crate::types::Bucket).
87pub fn build(self) -> crate::types::Bucket {
88crate::types::Bucket {
89 name: self.name,
90 creation_date: self.creation_date,
91 bucket_region: self.bucket_region,
92 }
93 }
94}