aws_sdk_secretsmanager/operation/list_secrets/
_list_secrets_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 ListSecretsInput {
6    /// <p>Specifies whether to include secrets scheduled for deletion. By default, secrets scheduled for deletion aren't included.</p>
7    pub include_planned_deletion: ::std::option::Option<bool>,
8    /// <p>The number of results to include in the response.</p>
9    /// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecrets</code> again with the value from <code>NextToken</code>.</p>
10    pub max_results: ::std::option::Option<i32>,
11    /// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecrets</code> again with this value.</p>
12    pub next_token: ::std::option::Option<::std::string::String>,
13    /// <p>The filters to apply to the list of secrets.</p>
14    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
15    /// <p>Secrets are listed by <code>CreatedDate</code>.</p>
16    pub sort_order: ::std::option::Option<crate::types::SortOrderType>,
17}
18impl ListSecretsInput {
19    /// <p>Specifies whether to include secrets scheduled for deletion. By default, secrets scheduled for deletion aren't included.</p>
20    pub fn include_planned_deletion(&self) -> ::std::option::Option<bool> {
21        self.include_planned_deletion
22    }
23    /// <p>The number of results to include in the response.</p>
24    /// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecrets</code> again with the value from <code>NextToken</code>.</p>
25    pub fn max_results(&self) -> ::std::option::Option<i32> {
26        self.max_results
27    }
28    /// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecrets</code> again with this value.</p>
29    pub fn next_token(&self) -> ::std::option::Option<&str> {
30        self.next_token.as_deref()
31    }
32    /// <p>The filters to apply to the list of secrets.</p>
33    ///
34    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
35    pub fn filters(&self) -> &[crate::types::Filter] {
36        self.filters.as_deref().unwrap_or_default()
37    }
38    /// <p>Secrets are listed by <code>CreatedDate</code>.</p>
39    pub fn sort_order(&self) -> ::std::option::Option<&crate::types::SortOrderType> {
40        self.sort_order.as_ref()
41    }
42}
43impl ListSecretsInput {
44    /// Creates a new builder-style object to manufacture [`ListSecretsInput`](crate::operation::list_secrets::ListSecretsInput).
45    pub fn builder() -> crate::operation::list_secrets::builders::ListSecretsInputBuilder {
46        crate::operation::list_secrets::builders::ListSecretsInputBuilder::default()
47    }
48}
49
50/// A builder for [`ListSecretsInput`](crate::operation::list_secrets::ListSecretsInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct ListSecretsInputBuilder {
54    pub(crate) include_planned_deletion: ::std::option::Option<bool>,
55    pub(crate) max_results: ::std::option::Option<i32>,
56    pub(crate) next_token: ::std::option::Option<::std::string::String>,
57    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
58    pub(crate) sort_order: ::std::option::Option<crate::types::SortOrderType>,
59}
60impl ListSecretsInputBuilder {
61    /// <p>Specifies whether to include secrets scheduled for deletion. By default, secrets scheduled for deletion aren't included.</p>
62    pub fn include_planned_deletion(mut self, input: bool) -> Self {
63        self.include_planned_deletion = ::std::option::Option::Some(input);
64        self
65    }
66    /// <p>Specifies whether to include secrets scheduled for deletion. By default, secrets scheduled for deletion aren't included.</p>
67    pub fn set_include_planned_deletion(mut self, input: ::std::option::Option<bool>) -> Self {
68        self.include_planned_deletion = input;
69        self
70    }
71    /// <p>Specifies whether to include secrets scheduled for deletion. By default, secrets scheduled for deletion aren't included.</p>
72    pub fn get_include_planned_deletion(&self) -> &::std::option::Option<bool> {
73        &self.include_planned_deletion
74    }
75    /// <p>The number of results to include in the response.</p>
76    /// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecrets</code> again with the value from <code>NextToken</code>.</p>
77    pub fn max_results(mut self, input: i32) -> Self {
78        self.max_results = ::std::option::Option::Some(input);
79        self
80    }
81    /// <p>The number of results to include in the response.</p>
82    /// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecrets</code> again with the value from <code>NextToken</code>.</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 number of results to include in the response.</p>
88    /// <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecrets</code> again with the value from <code>NextToken</code>.</p>
89    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
90        &self.max_results
91    }
92    /// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecrets</code> again with this value.</p>
93    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.next_token = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecrets</code> again with this value.</p>
98    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.next_token = input;
100        self
101    }
102    /// <p>A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecrets</code> again with this value.</p>
103    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
104        &self.next_token
105    }
106    /// Appends an item to `filters`.
107    ///
108    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
109    ///
110    /// <p>The filters to apply to the list of secrets.</p>
111    pub fn filters(mut self, input: crate::types::Filter) -> Self {
112        let mut v = self.filters.unwrap_or_default();
113        v.push(input);
114        self.filters = ::std::option::Option::Some(v);
115        self
116    }
117    /// <p>The filters to apply to the list of secrets.</p>
118    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
119        self.filters = input;
120        self
121    }
122    /// <p>The filters to apply to the list of secrets.</p>
123    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
124        &self.filters
125    }
126    /// <p>Secrets are listed by <code>CreatedDate</code>.</p>
127    pub fn sort_order(mut self, input: crate::types::SortOrderType) -> Self {
128        self.sort_order = ::std::option::Option::Some(input);
129        self
130    }
131    /// <p>Secrets are listed by <code>CreatedDate</code>.</p>
132    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrderType>) -> Self {
133        self.sort_order = input;
134        self
135    }
136    /// <p>Secrets are listed by <code>CreatedDate</code>.</p>
137    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrderType> {
138        &self.sort_order
139    }
140    /// Consumes the builder and constructs a [`ListSecretsInput`](crate::operation::list_secrets::ListSecretsInput).
141    pub fn build(self) -> ::std::result::Result<crate::operation::list_secrets::ListSecretsInput, ::aws_smithy_types::error::operation::BuildError> {
142        ::std::result::Result::Ok(crate::operation::list_secrets::ListSecretsInput {
143            include_planned_deletion: self.include_planned_deletion,
144            max_results: self.max_results,
145            next_token: self.next_token,
146            filters: self.filters,
147            sort_order: self.sort_order,
148        })
149    }
150}