aws_sdk_lightsail/operation/get_buckets/_get_buckets_output.rs
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 GetBucketsOutput {
6 /// <p>An array of objects that describe buckets.</p>
7 pub buckets: ::std::option::Option<::std::vec::Vec<crate::types::Bucket>>,
8 /// <p>The token to advance to the next page of results from your request.</p>
9 /// <p>A next page token is not returned if there are no more results to display.</p>
10 /// <p>To get the next page of results, perform another <code>GetBuckets</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
11 pub next_page_token: ::std::option::Option<::std::string::String>,
12 /// <p>An object that describes the synchronization status of the Amazon S3 account-level block public access feature for your Lightsail buckets.</p>
13 /// <p>For more information about this feature and how it affects Lightsail buckets, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-block-public-access-for-buckets">Block public access for buckets in Amazon Lightsail</a>.</p>
14 pub account_level_bpa_sync: ::std::option::Option<crate::types::AccountLevelBpaSync>,
15 _request_id: Option<String>,
16}
17impl GetBucketsOutput {
18 /// <p>An array of objects that describe buckets.</p>
19 ///
20 /// 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()`.
21 pub fn buckets(&self) -> &[crate::types::Bucket] {
22 self.buckets.as_deref().unwrap_or_default()
23 }
24 /// <p>The token to advance to the next page of results from your request.</p>
25 /// <p>A next page token is not returned if there are no more results to display.</p>
26 /// <p>To get the next page of results, perform another <code>GetBuckets</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
27 pub fn next_page_token(&self) -> ::std::option::Option<&str> {
28 self.next_page_token.as_deref()
29 }
30 /// <p>An object that describes the synchronization status of the Amazon S3 account-level block public access feature for your Lightsail buckets.</p>
31 /// <p>For more information about this feature and how it affects Lightsail buckets, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-block-public-access-for-buckets">Block public access for buckets in Amazon Lightsail</a>.</p>
32 pub fn account_level_bpa_sync(&self) -> ::std::option::Option<&crate::types::AccountLevelBpaSync> {
33 self.account_level_bpa_sync.as_ref()
34 }
35}
36impl ::aws_types::request_id::RequestId for GetBucketsOutput {
37 fn request_id(&self) -> Option<&str> {
38 self._request_id.as_deref()
39 }
40}
41impl GetBucketsOutput {
42 /// Creates a new builder-style object to manufacture [`GetBucketsOutput`](crate::operation::get_buckets::GetBucketsOutput).
43 pub fn builder() -> crate::operation::get_buckets::builders::GetBucketsOutputBuilder {
44 crate::operation::get_buckets::builders::GetBucketsOutputBuilder::default()
45 }
46}
47
48/// A builder for [`GetBucketsOutput`](crate::operation::get_buckets::GetBucketsOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct GetBucketsOutputBuilder {
52 pub(crate) buckets: ::std::option::Option<::std::vec::Vec<crate::types::Bucket>>,
53 pub(crate) next_page_token: ::std::option::Option<::std::string::String>,
54 pub(crate) account_level_bpa_sync: ::std::option::Option<crate::types::AccountLevelBpaSync>,
55 _request_id: Option<String>,
56}
57impl GetBucketsOutputBuilder {
58 /// Appends an item to `buckets`.
59 ///
60 /// To override the contents of this collection use [`set_buckets`](Self::set_buckets).
61 ///
62 /// <p>An array of objects that describe buckets.</p>
63 pub fn buckets(mut self, input: crate::types::Bucket) -> Self {
64 let mut v = self.buckets.unwrap_or_default();
65 v.push(input);
66 self.buckets = ::std::option::Option::Some(v);
67 self
68 }
69 /// <p>An array of objects that describe buckets.</p>
70 pub fn set_buckets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Bucket>>) -> Self {
71 self.buckets = input;
72 self
73 }
74 /// <p>An array of objects that describe buckets.</p>
75 pub fn get_buckets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Bucket>> {
76 &self.buckets
77 }
78 /// <p>The token to advance to the next page of results from your request.</p>
79 /// <p>A next page token is not returned if there are no more results to display.</p>
80 /// <p>To get the next page of results, perform another <code>GetBuckets</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
81 pub fn next_page_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.next_page_token = ::std::option::Option::Some(input.into());
83 self
84 }
85 /// <p>The token to advance to the next page of results from your request.</p>
86 /// <p>A next page token is not returned if there are no more results to display.</p>
87 /// <p>To get the next page of results, perform another <code>GetBuckets</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
88 pub fn set_next_page_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.next_page_token = input;
90 self
91 }
92 /// <p>The token to advance to the next page of results from your request.</p>
93 /// <p>A next page token is not returned if there are no more results to display.</p>
94 /// <p>To get the next page of results, perform another <code>GetBuckets</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
95 pub fn get_next_page_token(&self) -> &::std::option::Option<::std::string::String> {
96 &self.next_page_token
97 }
98 /// <p>An object that describes the synchronization status of the Amazon S3 account-level block public access feature for your Lightsail buckets.</p>
99 /// <p>For more information about this feature and how it affects Lightsail buckets, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-block-public-access-for-buckets">Block public access for buckets in Amazon Lightsail</a>.</p>
100 pub fn account_level_bpa_sync(mut self, input: crate::types::AccountLevelBpaSync) -> Self {
101 self.account_level_bpa_sync = ::std::option::Option::Some(input);
102 self
103 }
104 /// <p>An object that describes the synchronization status of the Amazon S3 account-level block public access feature for your Lightsail buckets.</p>
105 /// <p>For more information about this feature and how it affects Lightsail buckets, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-block-public-access-for-buckets">Block public access for buckets in Amazon Lightsail</a>.</p>
106 pub fn set_account_level_bpa_sync(mut self, input: ::std::option::Option<crate::types::AccountLevelBpaSync>) -> Self {
107 self.account_level_bpa_sync = input;
108 self
109 }
110 /// <p>An object that describes the synchronization status of the Amazon S3 account-level block public access feature for your Lightsail buckets.</p>
111 /// <p>For more information about this feature and how it affects Lightsail buckets, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-block-public-access-for-buckets">Block public access for buckets in Amazon Lightsail</a>.</p>
112 pub fn get_account_level_bpa_sync(&self) -> &::std::option::Option<crate::types::AccountLevelBpaSync> {
113 &self.account_level_bpa_sync
114 }
115 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
116 self._request_id = Some(request_id.into());
117 self
118 }
119
120 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
121 self._request_id = request_id;
122 self
123 }
124 /// Consumes the builder and constructs a [`GetBucketsOutput`](crate::operation::get_buckets::GetBucketsOutput).
125 pub fn build(self) -> crate::operation::get_buckets::GetBucketsOutput {
126 crate::operation::get_buckets::GetBucketsOutput {
127 buckets: self.buckets,
128 next_page_token: self.next_page_token,
129 account_level_bpa_sync: self.account_level_bpa_sync,
130 _request_id: self._request_id,
131 }
132 }
133}