aws_sdk_macie2/operation/describe_buckets/
_describe_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 DescribeBucketsInput {
6    /// <p>The criteria to use to filter the query results.</p>
7    pub criteria: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::BucketCriteriaAdditionalProperties>>,
8    /// <p>The maximum number of items to include in each page of the response. The default value is 50.</p>
9    pub max_results: ::std::option::Option<i32>,
10    /// <p>The nextToken string that specifies which page of results to return in a paginated response.</p>
11    pub next_token: ::std::option::Option<::std::string::String>,
12    /// <p>The criteria to use to sort the query results.</p>
13    pub sort_criteria: ::std::option::Option<crate::types::BucketSortCriteria>,
14}
15impl DescribeBucketsInput {
16    /// <p>The criteria to use to filter the query results.</p>
17    pub fn criteria(
18        &self,
19    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::BucketCriteriaAdditionalProperties>> {
20        self.criteria.as_ref()
21    }
22    /// <p>The maximum number of items to include in each page of the response. The default value is 50.</p>
23    pub fn max_results(&self) -> ::std::option::Option<i32> {
24        self.max_results
25    }
26    /// <p>The nextToken string that specifies which page of results to return in a paginated response.</p>
27    pub fn next_token(&self) -> ::std::option::Option<&str> {
28        self.next_token.as_deref()
29    }
30    /// <p>The criteria to use to sort the query results.</p>
31    pub fn sort_criteria(&self) -> ::std::option::Option<&crate::types::BucketSortCriteria> {
32        self.sort_criteria.as_ref()
33    }
34}
35impl DescribeBucketsInput {
36    /// Creates a new builder-style object to manufacture [`DescribeBucketsInput`](crate::operation::describe_buckets::DescribeBucketsInput).
37    pub fn builder() -> crate::operation::describe_buckets::builders::DescribeBucketsInputBuilder {
38        crate::operation::describe_buckets::builders::DescribeBucketsInputBuilder::default()
39    }
40}
41
42/// A builder for [`DescribeBucketsInput`](crate::operation::describe_buckets::DescribeBucketsInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct DescribeBucketsInputBuilder {
46    pub(crate) criteria: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::BucketCriteriaAdditionalProperties>>,
47    pub(crate) max_results: ::std::option::Option<i32>,
48    pub(crate) next_token: ::std::option::Option<::std::string::String>,
49    pub(crate) sort_criteria: ::std::option::Option<crate::types::BucketSortCriteria>,
50}
51impl DescribeBucketsInputBuilder {
52    /// Adds a key-value pair to `criteria`.
53    ///
54    /// To override the contents of this collection use [`set_criteria`](Self::set_criteria).
55    ///
56    /// <p>The criteria to use to filter the query results.</p>
57    pub fn criteria(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::BucketCriteriaAdditionalProperties) -> Self {
58        let mut hash_map = self.criteria.unwrap_or_default();
59        hash_map.insert(k.into(), v);
60        self.criteria = ::std::option::Option::Some(hash_map);
61        self
62    }
63    /// <p>The criteria to use to filter the query results.</p>
64    pub fn set_criteria(
65        mut self,
66        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::BucketCriteriaAdditionalProperties>>,
67    ) -> Self {
68        self.criteria = input;
69        self
70    }
71    /// <p>The criteria to use to filter the query results.</p>
72    pub fn get_criteria(
73        &self,
74    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::BucketCriteriaAdditionalProperties>> {
75        &self.criteria
76    }
77    /// <p>The maximum number of items to include in each page of the response. The default value is 50.</p>
78    pub fn max_results(mut self, input: i32) -> Self {
79        self.max_results = ::std::option::Option::Some(input);
80        self
81    }
82    /// <p>The maximum number of items to include in each page of the response. The default value is 50.</p>
83    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
84        self.max_results = input;
85        self
86    }
87    /// <p>The maximum number of items to include in each page of the response. The default value is 50.</p>
88    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
89        &self.max_results
90    }
91    /// <p>The nextToken string that specifies which page of results to return in a paginated response.</p>
92    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.next_token = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// <p>The nextToken string that specifies which page of results to return in a paginated response.</p>
97    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.next_token = input;
99        self
100    }
101    /// <p>The nextToken string that specifies which page of results to return in a paginated response.</p>
102    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
103        &self.next_token
104    }
105    /// <p>The criteria to use to sort the query results.</p>
106    pub fn sort_criteria(mut self, input: crate::types::BucketSortCriteria) -> Self {
107        self.sort_criteria = ::std::option::Option::Some(input);
108        self
109    }
110    /// <p>The criteria to use to sort the query results.</p>
111    pub fn set_sort_criteria(mut self, input: ::std::option::Option<crate::types::BucketSortCriteria>) -> Self {
112        self.sort_criteria = input;
113        self
114    }
115    /// <p>The criteria to use to sort the query results.</p>
116    pub fn get_sort_criteria(&self) -> &::std::option::Option<crate::types::BucketSortCriteria> {
117        &self.sort_criteria
118    }
119    /// Consumes the builder and constructs a [`DescribeBucketsInput`](crate::operation::describe_buckets::DescribeBucketsInput).
120    pub fn build(
121        self,
122    ) -> ::std::result::Result<crate::operation::describe_buckets::DescribeBucketsInput, ::aws_smithy_types::error::operation::BuildError> {
123        ::std::result::Result::Ok(crate::operation::describe_buckets::DescribeBucketsInput {
124            criteria: self.criteria,
125            max_results: self.max_results,
126            next_token: self.next_token,
127            sort_criteria: self.sort_criteria,
128        })
129    }
130}