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 ListBucketsOutput {
6/// <p>The list of buckets owned by the requester.</p>
7pub buckets: ::std::option::Option<::std::vec::Vec<crate::types::Bucket>>,
8/// <p>The owner of the buckets listed.</p>
9pub owner: ::std::option::Option<crate::types::Owner>,
10/// <p><code>ContinuationToken</code> is included in the response when there are more buckets that can be listed with pagination. The next <code>ListBuckets</code> request to Amazon S3 can be continued with this <code>ContinuationToken</code>. <code>ContinuationToken</code> is obfuscated and is not a real bucket.</p>
11pub continuation_token: ::std::option::Option<::std::string::String>,
12/// <p>If <code>Prefix</code> was sent with the request, it is included in the response.</p>
13 /// <p>All bucket names in the response begin with the specified bucket name prefix.</p>
14pub prefix: ::std::option::Option<::std::string::String>,
15 _extended_request_id: Option<String>,
16 _request_id: Option<String>,
17}
18impl ListBucketsOutput {
19/// <p>The list of buckets owned by the requester.</p>
20 ///
21 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.buckets.is_none()`.
22pub fn buckets(&self) -> &[crate::types::Bucket] {
23self.buckets.as_deref().unwrap_or_default()
24 }
25/// <p>The owner of the buckets listed.</p>
26pub fn owner(&self) -> ::std::option::Option<&crate::types::Owner> {
27self.owner.as_ref()
28 }
29/// <p><code>ContinuationToken</code> is included in the response when there are more buckets that can be listed with pagination. The next <code>ListBuckets</code> request to Amazon S3 can be continued with this <code>ContinuationToken</code>. <code>ContinuationToken</code> is obfuscated and is not a real bucket.</p>
30pub fn continuation_token(&self) -> ::std::option::Option<&str> {
31self.continuation_token.as_deref()
32 }
33/// <p>If <code>Prefix</code> was sent with the request, it is included in the response.</p>
34 /// <p>All bucket names in the response begin with the specified bucket name prefix.</p>
35pub fn prefix(&self) -> ::std::option::Option<&str> {
36self.prefix.as_deref()
37 }
38}
39impl crate::s3_request_id::RequestIdExt for ListBucketsOutput {
40fn extended_request_id(&self) -> Option<&str> {
41self._extended_request_id.as_deref()
42 }
43}
44impl ::aws_types::request_id::RequestId for ListBucketsOutput {
45fn request_id(&self) -> Option<&str> {
46self._request_id.as_deref()
47 }
48}
49impl ListBucketsOutput {
50/// Creates a new builder-style object to manufacture [`ListBucketsOutput`](crate::operation::list_buckets::ListBucketsOutput).
51pub fn builder() -> crate::operation::list_buckets::builders::ListBucketsOutputBuilder {
52crate::operation::list_buckets::builders::ListBucketsOutputBuilder::default()
53 }
54}
5556/// A builder for [`ListBucketsOutput`](crate::operation::list_buckets::ListBucketsOutput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct ListBucketsOutputBuilder {
60pub(crate) buckets: ::std::option::Option<::std::vec::Vec<crate::types::Bucket>>,
61pub(crate) owner: ::std::option::Option<crate::types::Owner>,
62pub(crate) continuation_token: ::std::option::Option<::std::string::String>,
63pub(crate) prefix: ::std::option::Option<::std::string::String>,
64 _extended_request_id: Option<String>,
65 _request_id: Option<String>,
66}
67impl ListBucketsOutputBuilder {
68/// Appends an item to `buckets`.
69 ///
70 /// To override the contents of this collection use [`set_buckets`](Self::set_buckets).
71 ///
72 /// <p>The list of buckets owned by the requester.</p>
73pub fn buckets(mut self, input: crate::types::Bucket) -> Self {
74let mut v = self.buckets.unwrap_or_default();
75 v.push(input);
76self.buckets = ::std::option::Option::Some(v);
77self
78}
79/// <p>The list of buckets owned by the requester.</p>
80pub fn set_buckets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Bucket>>) -> Self {
81self.buckets = input;
82self
83}
84/// <p>The list of buckets owned by the requester.</p>
85pub fn get_buckets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Bucket>> {
86&self.buckets
87 }
88/// <p>The owner of the buckets listed.</p>
89pub fn owner(mut self, input: crate::types::Owner) -> Self {
90self.owner = ::std::option::Option::Some(input);
91self
92}
93/// <p>The owner of the buckets listed.</p>
94pub fn set_owner(mut self, input: ::std::option::Option<crate::types::Owner>) -> Self {
95self.owner = input;
96self
97}
98/// <p>The owner of the buckets listed.</p>
99pub fn get_owner(&self) -> &::std::option::Option<crate::types::Owner> {
100&self.owner
101 }
102/// <p><code>ContinuationToken</code> is included in the response when there are more buckets that can be listed with pagination. The next <code>ListBuckets</code> request to Amazon S3 can be continued with this <code>ContinuationToken</code>. <code>ContinuationToken</code> is obfuscated and is not a real bucket.</p>
103pub fn continuation_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104self.continuation_token = ::std::option::Option::Some(input.into());
105self
106}
107/// <p><code>ContinuationToken</code> is included in the response when there are more buckets that can be listed with pagination. The next <code>ListBuckets</code> request to Amazon S3 can be continued with this <code>ContinuationToken</code>. <code>ContinuationToken</code> is obfuscated and is not a real bucket.</p>
108pub fn set_continuation_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109self.continuation_token = input;
110self
111}
112/// <p><code>ContinuationToken</code> is included in the response when there are more buckets that can be listed with pagination. The next <code>ListBuckets</code> request to Amazon S3 can be continued with this <code>ContinuationToken</code>. <code>ContinuationToken</code> is obfuscated and is not a real bucket.</p>
113pub fn get_continuation_token(&self) -> &::std::option::Option<::std::string::String> {
114&self.continuation_token
115 }
116/// <p>If <code>Prefix</code> was sent with the request, it is included in the response.</p>
117 /// <p>All bucket names in the response begin with the specified bucket name prefix.</p>
118pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119self.prefix = ::std::option::Option::Some(input.into());
120self
121}
122/// <p>If <code>Prefix</code> was sent with the request, it is included in the response.</p>
123 /// <p>All bucket names in the response begin with the specified bucket name prefix.</p>
124pub fn set_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125self.prefix = input;
126self
127}
128/// <p>If <code>Prefix</code> was sent with the request, it is included in the response.</p>
129 /// <p>All bucket names in the response begin with the specified bucket name prefix.</p>
130pub fn get_prefix(&self) -> &::std::option::Option<::std::string::String> {
131&self.prefix
132 }
133pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
134self._extended_request_id = Some(extended_request_id.into());
135self
136}
137138pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
139self._extended_request_id = extended_request_id;
140self
141}
142pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
143self._request_id = Some(request_id.into());
144self
145}
146147pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
148self._request_id = request_id;
149self
150}
151/// Consumes the builder and constructs a [`ListBucketsOutput`](crate::operation::list_buckets::ListBucketsOutput).
152pub fn build(self) -> crate::operation::list_buckets::ListBucketsOutput {
153crate::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}