aws_sdk_secretsmanager/types/_filter.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Allows you to add filters when you use the search function in Secrets Manager. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html">Find secrets in Secrets Manager</a>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Filter {
7 /// <p>The following are keys you can use:</p>
8 /// <ul>
9 /// <li>
10 /// <p><b>description</b>: Prefix match, not case-sensitive.</p></li>
11 /// <li>
12 /// <p><b>name</b>: Prefix match, case-sensitive.</p></li>
13 /// <li>
14 /// <p><b>tag-key</b>: Prefix match, case-sensitive.</p></li>
15 /// <li>
16 /// <p><b>tag-value</b>: Prefix match, case-sensitive.</p></li>
17 /// <li>
18 /// <p><b>primary-region</b>: Prefix match, case-sensitive.</p></li>
19 /// <li>
20 /// <p><b>owning-service</b>: Prefix match, case-sensitive.</p></li>
21 /// <li>
22 /// <p><b>all</b>: Breaks the filter value string into words and then searches all attributes for matches. Not case-sensitive.</p></li>
23 /// </ul>
24 pub key: ::std::option::Option<crate::types::FilterNameStringType>,
25 /// <p>The keyword to filter for.</p>
26 /// <p>You can prefix your search value with an exclamation mark (<code>!</code>) in order to perform negation filters.</p>
27 pub values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
28}
29impl Filter {
30 /// <p>The following are keys you can use:</p>
31 /// <ul>
32 /// <li>
33 /// <p><b>description</b>: Prefix match, not case-sensitive.</p></li>
34 /// <li>
35 /// <p><b>name</b>: Prefix match, case-sensitive.</p></li>
36 /// <li>
37 /// <p><b>tag-key</b>: Prefix match, case-sensitive.</p></li>
38 /// <li>
39 /// <p><b>tag-value</b>: Prefix match, case-sensitive.</p></li>
40 /// <li>
41 /// <p><b>primary-region</b>: Prefix match, case-sensitive.</p></li>
42 /// <li>
43 /// <p><b>owning-service</b>: Prefix match, case-sensitive.</p></li>
44 /// <li>
45 /// <p><b>all</b>: Breaks the filter value string into words and then searches all attributes for matches. Not case-sensitive.</p></li>
46 /// </ul>
47 pub fn key(&self) -> ::std::option::Option<&crate::types::FilterNameStringType> {
48 self.key.as_ref()
49 }
50 /// <p>The keyword to filter for.</p>
51 /// <p>You can prefix your search value with an exclamation mark (<code>!</code>) in order to perform negation filters.</p>
52 ///
53 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.values.is_none()`.
54 pub fn values(&self) -> &[::std::string::String] {
55 self.values.as_deref().unwrap_or_default()
56 }
57}
58impl Filter {
59 /// Creates a new builder-style object to manufacture [`Filter`](crate::types::Filter).
60 pub fn builder() -> crate::types::builders::FilterBuilder {
61 crate::types::builders::FilterBuilder::default()
62 }
63}
64
65/// A builder for [`Filter`](crate::types::Filter).
66#[non_exhaustive]
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68pub struct FilterBuilder {
69 pub(crate) key: ::std::option::Option<crate::types::FilterNameStringType>,
70 pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
71}
72impl FilterBuilder {
73 /// <p>The following are keys you can use:</p>
74 /// <ul>
75 /// <li>
76 /// <p><b>description</b>: Prefix match, not case-sensitive.</p></li>
77 /// <li>
78 /// <p><b>name</b>: Prefix match, case-sensitive.</p></li>
79 /// <li>
80 /// <p><b>tag-key</b>: Prefix match, case-sensitive.</p></li>
81 /// <li>
82 /// <p><b>tag-value</b>: Prefix match, case-sensitive.</p></li>
83 /// <li>
84 /// <p><b>primary-region</b>: Prefix match, case-sensitive.</p></li>
85 /// <li>
86 /// <p><b>owning-service</b>: Prefix match, case-sensitive.</p></li>
87 /// <li>
88 /// <p><b>all</b>: Breaks the filter value string into words and then searches all attributes for matches. Not case-sensitive.</p></li>
89 /// </ul>
90 pub fn key(mut self, input: crate::types::FilterNameStringType) -> Self {
91 self.key = ::std::option::Option::Some(input);
92 self
93 }
94 /// <p>The following are keys you can use:</p>
95 /// <ul>
96 /// <li>
97 /// <p><b>description</b>: Prefix match, not case-sensitive.</p></li>
98 /// <li>
99 /// <p><b>name</b>: Prefix match, case-sensitive.</p></li>
100 /// <li>
101 /// <p><b>tag-key</b>: Prefix match, case-sensitive.</p></li>
102 /// <li>
103 /// <p><b>tag-value</b>: Prefix match, case-sensitive.</p></li>
104 /// <li>
105 /// <p><b>primary-region</b>: Prefix match, case-sensitive.</p></li>
106 /// <li>
107 /// <p><b>owning-service</b>: Prefix match, case-sensitive.</p></li>
108 /// <li>
109 /// <p><b>all</b>: Breaks the filter value string into words and then searches all attributes for matches. Not case-sensitive.</p></li>
110 /// </ul>
111 pub fn set_key(mut self, input: ::std::option::Option<crate::types::FilterNameStringType>) -> Self {
112 self.key = input;
113 self
114 }
115 /// <p>The following are keys you can use:</p>
116 /// <ul>
117 /// <li>
118 /// <p><b>description</b>: Prefix match, not case-sensitive.</p></li>
119 /// <li>
120 /// <p><b>name</b>: Prefix match, case-sensitive.</p></li>
121 /// <li>
122 /// <p><b>tag-key</b>: Prefix match, case-sensitive.</p></li>
123 /// <li>
124 /// <p><b>tag-value</b>: Prefix match, case-sensitive.</p></li>
125 /// <li>
126 /// <p><b>primary-region</b>: Prefix match, case-sensitive.</p></li>
127 /// <li>
128 /// <p><b>owning-service</b>: Prefix match, case-sensitive.</p></li>
129 /// <li>
130 /// <p><b>all</b>: Breaks the filter value string into words and then searches all attributes for matches. Not case-sensitive.</p></li>
131 /// </ul>
132 pub fn get_key(&self) -> &::std::option::Option<crate::types::FilterNameStringType> {
133 &self.key
134 }
135 /// Appends an item to `values`.
136 ///
137 /// To override the contents of this collection use [`set_values`](Self::set_values).
138 ///
139 /// <p>The keyword to filter for.</p>
140 /// <p>You can prefix your search value with an exclamation mark (<code>!</code>) in order to perform negation filters.</p>
141 pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 let mut v = self.values.unwrap_or_default();
143 v.push(input.into());
144 self.values = ::std::option::Option::Some(v);
145 self
146 }
147 /// <p>The keyword to filter for.</p>
148 /// <p>You can prefix your search value with an exclamation mark (<code>!</code>) in order to perform negation filters.</p>
149 pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
150 self.values = input;
151 self
152 }
153 /// <p>The keyword to filter for.</p>
154 /// <p>You can prefix your search value with an exclamation mark (<code>!</code>) in order to perform negation filters.</p>
155 pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
156 &self.values
157 }
158 /// Consumes the builder and constructs a [`Filter`](crate::types::Filter).
159 pub fn build(self) -> crate::types::Filter {
160 crate::types::Filter {
161 key: self.key,
162 values: self.values,
163 }
164 }
165}