aws_sdk_s3/operation/list_buckets/
_list_buckets_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ListBucketsOutput {
6 pub buckets: ::std::option::Option<::std::vec::Vec<crate::types::Bucket>>,
8 pub owner: ::std::option::Option<crate::types::Owner>,
10 pub continuation_token: ::std::option::Option<::std::string::String>,
12 pub prefix: ::std::option::Option<::std::string::String>,
15 _extended_request_id: Option<String>,
16 _request_id: Option<String>,
17}
18impl ListBucketsOutput {
19 pub fn buckets(&self) -> &[crate::types::Bucket] {
23 self.buckets.as_deref().unwrap_or_default()
24 }
25 pub fn owner(&self) -> ::std::option::Option<&crate::types::Owner> {
27 self.owner.as_ref()
28 }
29 pub fn continuation_token(&self) -> ::std::option::Option<&str> {
31 self.continuation_token.as_deref()
32 }
33 pub fn prefix(&self) -> ::std::option::Option<&str> {
36 self.prefix.as_deref()
37 }
38}
39impl crate::s3_request_id::RequestIdExt for ListBucketsOutput {
40 fn extended_request_id(&self) -> Option<&str> {
41 self._extended_request_id.as_deref()
42 }
43}
44impl ::aws_types::request_id::RequestId for ListBucketsOutput {
45 fn request_id(&self) -> Option<&str> {
46 self._request_id.as_deref()
47 }
48}
49impl ListBucketsOutput {
50 pub fn builder() -> crate::operation::list_buckets::builders::ListBucketsOutputBuilder {
52 crate::operation::list_buckets::builders::ListBucketsOutputBuilder::default()
53 }
54}
55
56#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct ListBucketsOutputBuilder {
60 pub(crate) buckets: ::std::option::Option<::std::vec::Vec<crate::types::Bucket>>,
61 pub(crate) owner: ::std::option::Option<crate::types::Owner>,
62 pub(crate) continuation_token: ::std::option::Option<::std::string::String>,
63 pub(crate) prefix: ::std::option::Option<::std::string::String>,
64 _extended_request_id: Option<String>,
65 _request_id: Option<String>,
66}
67impl ListBucketsOutputBuilder {
68 pub fn buckets(mut self, input: crate::types::Bucket) -> Self {
74 let mut v = self.buckets.unwrap_or_default();
75 v.push(input);
76 self.buckets = ::std::option::Option::Some(v);
77 self
78 }
79 pub fn set_buckets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Bucket>>) -> Self {
81 self.buckets = input;
82 self
83 }
84 pub fn get_buckets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Bucket>> {
86 &self.buckets
87 }
88 pub fn owner(mut self, input: crate::types::Owner) -> Self {
90 self.owner = ::std::option::Option::Some(input);
91 self
92 }
93 pub fn set_owner(mut self, input: ::std::option::Option<crate::types::Owner>) -> Self {
95 self.owner = input;
96 self
97 }
98 pub fn get_owner(&self) -> &::std::option::Option<crate::types::Owner> {
100 &self.owner
101 }
102 pub fn continuation_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.continuation_token = ::std::option::Option::Some(input.into());
105 self
106 }
107 pub fn set_continuation_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.continuation_token = input;
110 self
111 }
112 pub fn get_continuation_token(&self) -> &::std::option::Option<::std::string::String> {
114 &self.continuation_token
115 }
116 pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.prefix = ::std::option::Option::Some(input.into());
120 self
121 }
122 pub fn set_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.prefix = input;
126 self
127 }
128 pub fn get_prefix(&self) -> &::std::option::Option<::std::string::String> {
131 &self.prefix
132 }
133 pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
134 self._extended_request_id = Some(extended_request_id.into());
135 self
136 }
137
138 pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
139 self._extended_request_id = extended_request_id;
140 self
141 }
142 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
143 self._request_id = Some(request_id.into());
144 self
145 }
146
147 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
148 self._request_id = request_id;
149 self
150 }
151 pub fn build(self) -> crate::operation::list_buckets::ListBucketsOutput {
153 crate::operation::list_buckets::ListBucketsOutput {
154 buckets: self.buckets,
155 owner: self.owner,
156 continuation_token: self.continuation_token,
157 prefix: self.prefix,
158 _extended_request_id: self._extended_request_id,
159 _request_id: self._request_id,
160 }
161 }
162}