aws_sdk_s3control/operation/get_bucket/
_get_bucket_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetBucketOutput {
6 pub bucket: ::std::option::Option<::std::string::String>,
8 pub public_access_block_enabled: bool,
10 pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
12 _request_id: Option<String>,
13}
14impl GetBucketOutput {
15 pub fn bucket(&self) -> ::std::option::Option<&str> {
17 self.bucket.as_deref()
18 }
19 pub fn public_access_block_enabled(&self) -> bool {
21 self.public_access_block_enabled
22 }
23 pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
25 self.creation_date.as_ref()
26 }
27}
28impl ::aws_types::request_id::RequestId for GetBucketOutput {
29 fn request_id(&self) -> Option<&str> {
30 self._request_id.as_deref()
31 }
32}
33impl GetBucketOutput {
34 pub fn builder() -> crate::operation::get_bucket::builders::GetBucketOutputBuilder {
36 crate::operation::get_bucket::builders::GetBucketOutputBuilder::default()
37 }
38}
39
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetBucketOutputBuilder {
44 pub(crate) bucket: ::std::option::Option<::std::string::String>,
45 pub(crate) public_access_block_enabled: ::std::option::Option<bool>,
46 pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
47 _request_id: Option<String>,
48}
49impl GetBucketOutputBuilder {
50 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52 self.bucket = ::std::option::Option::Some(input.into());
53 self
54 }
55 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57 self.bucket = input;
58 self
59 }
60 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
62 &self.bucket
63 }
64 pub fn public_access_block_enabled(mut self, input: bool) -> Self {
66 self.public_access_block_enabled = ::std::option::Option::Some(input);
67 self
68 }
69 pub fn set_public_access_block_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
71 self.public_access_block_enabled = input;
72 self
73 }
74 pub fn get_public_access_block_enabled(&self) -> &::std::option::Option<bool> {
76 &self.public_access_block_enabled
77 }
78 pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
80 self.creation_date = ::std::option::Option::Some(input);
81 self
82 }
83 pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
85 self.creation_date = input;
86 self
87 }
88 pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
90 &self.creation_date
91 }
92 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93 self._request_id = Some(request_id.into());
94 self
95 }
96
97 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98 self._request_id = request_id;
99 self
100 }
101 pub fn build(self) -> crate::operation::get_bucket::GetBucketOutput {
103 crate::operation::get_bucket::GetBucketOutput {
104 bucket: self.bucket,
105 public_access_block_enabled: self.public_access_block_enabled.unwrap_or_default(),
106 creation_date: self.creation_date,
107 _request_id: self._request_id,
108 }
109 }
110}