Skip to main content

aws_sdk_lightsail/operation/get_buckets/
_get_buckets_input.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 GetBucketsInput {
6    /// <p>The name of the bucket for which to return information.</p>
7    /// <p>When omitted, the response includes all of your buckets in the Amazon Web Services Region where the request is made.</p>
8    pub bucket_name: ::std::option::Option<::std::string::String>,
9    /// <p>The token to advance to the next page of results from your request.</p>
10    /// <p>To get a page token, perform an initial <code>GetBuckets</code> request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.</p>
11    pub page_token: ::std::option::Option<::std::string::String>,
12    /// <p>A Boolean value that indicates whether to include Lightsail instances that were given access to the bucket using the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html">SetResourceAccessForBucket</a> action.</p>
13    pub include_connected_resources: ::std::option::Option<bool>,
14    /// <p>A Boolean value that indicates whether to include Lightsail bucket CORS configuration in the response. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
15    /// <p>This parameter is only supported when getting a single bucket with <code>bucketName</code> specified. The default value for this parameter is <code>False</code>.</p>
16    /// </note>
17    pub include_cors: ::std::option::Option<bool>,
18}
19impl GetBucketsInput {
20    /// <p>The name of the bucket for which to return information.</p>
21    /// <p>When omitted, the response includes all of your buckets in the Amazon Web Services Region where the request is made.</p>
22    pub fn bucket_name(&self) -> ::std::option::Option<&str> {
23        self.bucket_name.as_deref()
24    }
25    /// <p>The token to advance to the next page of results from your request.</p>
26    /// <p>To get a page token, perform an initial <code>GetBuckets</code> request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.</p>
27    pub fn page_token(&self) -> ::std::option::Option<&str> {
28        self.page_token.as_deref()
29    }
30    /// <p>A Boolean value that indicates whether to include Lightsail instances that were given access to the bucket using the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html">SetResourceAccessForBucket</a> action.</p>
31    pub fn include_connected_resources(&self) -> ::std::option::Option<bool> {
32        self.include_connected_resources
33    }
34    /// <p>A Boolean value that indicates whether to include Lightsail bucket CORS configuration in the response. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
35    /// <p>This parameter is only supported when getting a single bucket with <code>bucketName</code> specified. The default value for this parameter is <code>False</code>.</p>
36    /// </note>
37    pub fn include_cors(&self) -> ::std::option::Option<bool> {
38        self.include_cors
39    }
40}
41impl GetBucketsInput {
42    /// Creates a new builder-style object to manufacture [`GetBucketsInput`](crate::operation::get_buckets::GetBucketsInput).
43    pub fn builder() -> crate::operation::get_buckets::builders::GetBucketsInputBuilder {
44        crate::operation::get_buckets::builders::GetBucketsInputBuilder::default()
45    }
46}
47
48/// A builder for [`GetBucketsInput`](crate::operation::get_buckets::GetBucketsInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct GetBucketsInputBuilder {
52    pub(crate) bucket_name: ::std::option::Option<::std::string::String>,
53    pub(crate) page_token: ::std::option::Option<::std::string::String>,
54    pub(crate) include_connected_resources: ::std::option::Option<bool>,
55    pub(crate) include_cors: ::std::option::Option<bool>,
56}
57impl GetBucketsInputBuilder {
58    /// <p>The name of the bucket for which to return information.</p>
59    /// <p>When omitted, the response includes all of your buckets in the Amazon Web Services Region where the request is made.</p>
60    pub fn bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.bucket_name = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The name of the bucket for which to return information.</p>
65    /// <p>When omitted, the response includes all of your buckets in the Amazon Web Services Region where the request is made.</p>
66    pub fn set_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.bucket_name = input;
68        self
69    }
70    /// <p>The name of the bucket for which to return information.</p>
71    /// <p>When omitted, the response includes all of your buckets in the Amazon Web Services Region where the request is made.</p>
72    pub fn get_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
73        &self.bucket_name
74    }
75    /// <p>The token to advance to the next page of results from your request.</p>
76    /// <p>To get a page token, perform an initial <code>GetBuckets</code> request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.</p>
77    pub fn page_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.page_token = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The token to advance to the next page of results from your request.</p>
82    /// <p>To get a page token, perform an initial <code>GetBuckets</code> request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.</p>
83    pub fn set_page_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84        self.page_token = input;
85        self
86    }
87    /// <p>The token to advance to the next page of results from your request.</p>
88    /// <p>To get a page token, perform an initial <code>GetBuckets</code> request. If your results are paginated, the response will return a next page token that you can specify as the page token in a subsequent request.</p>
89    pub fn get_page_token(&self) -> &::std::option::Option<::std::string::String> {
90        &self.page_token
91    }
92    /// <p>A Boolean value that indicates whether to include Lightsail instances that were given access to the bucket using the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html">SetResourceAccessForBucket</a> action.</p>
93    pub fn include_connected_resources(mut self, input: bool) -> Self {
94        self.include_connected_resources = ::std::option::Option::Some(input);
95        self
96    }
97    /// <p>A Boolean value that indicates whether to include Lightsail instances that were given access to the bucket using the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html">SetResourceAccessForBucket</a> action.</p>
98    pub fn set_include_connected_resources(mut self, input: ::std::option::Option<bool>) -> Self {
99        self.include_connected_resources = input;
100        self
101    }
102    /// <p>A Boolean value that indicates whether to include Lightsail instances that were given access to the bucket using the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html">SetResourceAccessForBucket</a> action.</p>
103    pub fn get_include_connected_resources(&self) -> &::std::option::Option<bool> {
104        &self.include_connected_resources
105    }
106    /// <p>A Boolean value that indicates whether to include Lightsail bucket CORS configuration in the response. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
107    /// <p>This parameter is only supported when getting a single bucket with <code>bucketName</code> specified. The default value for this parameter is <code>False</code>.</p>
108    /// </note>
109    pub fn include_cors(mut self, input: bool) -> Self {
110        self.include_cors = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>A Boolean value that indicates whether to include Lightsail bucket CORS configuration in the response. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
114    /// <p>This parameter is only supported when getting a single bucket with <code>bucketName</code> specified. The default value for this parameter is <code>False</code>.</p>
115    /// </note>
116    pub fn set_include_cors(mut self, input: ::std::option::Option<bool>) -> Self {
117        self.include_cors = input;
118        self
119    }
120    /// <p>A Boolean value that indicates whether to include Lightsail bucket CORS configuration in the response. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
121    /// <p>This parameter is only supported when getting a single bucket with <code>bucketName</code> specified. The default value for this parameter is <code>False</code>.</p>
122    /// </note>
123    pub fn get_include_cors(&self) -> &::std::option::Option<bool> {
124        &self.include_cors
125    }
126    /// Consumes the builder and constructs a [`GetBucketsInput`](crate::operation::get_buckets::GetBucketsInput).
127    pub fn build(self) -> ::std::result::Result<crate::operation::get_buckets::GetBucketsInput, ::aws_smithy_types::error::operation::BuildError> {
128        ::std::result::Result::Ok(crate::operation::get_buckets::GetBucketsInput {
129            bucket_name: self.bucket_name,
130            page_token: self.page_token,
131            include_connected_resources: self.include_connected_resources,
132            include_cors: self.include_cors,
133        })
134    }
135}