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