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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as IDs. The filters supported by a describe operation are documented with the describe operation.</p> <note>
/// <p>Currently, wildcards are not supported in filters.</p>
/// </note>
/// <p>The following actions can be filtered:</p>
/// <ul>
/// <li> <p> <code>DescribeDBClusterBacktracks</code> </p> </li>
/// <li> <p> <code>DescribeDBClusterEndpoints</code> </p> </li>
/// <li> <p> <code>DescribeDBClusters</code> </p> </li>
/// <li> <p> <code>DescribeDBInstances</code> </p> </li>
/// <li> <p> <code>DescribePendingMaintenanceActions</code> </p> </li>
/// </ul>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Filter {
/// <p>The name of the filter. Filter names are case-sensitive.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>One or more filter values. Filter values are case-sensitive.</p>
pub values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Filter {
/// <p>The name of the filter. Filter names are case-sensitive.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>One or more filter values. Filter values are case-sensitive.</p>
pub fn values(&self) -> ::std::option::Option<&[::std::string::String]> {
self.values.as_deref()
}
}
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) name: ::std::option::Option<::std::string::String>,
pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl FilterBuilder {
/// <p>The name of the filter. Filter names are case-sensitive.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the filter. Filter names are case-sensitive.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the filter. Filter names are case-sensitive.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// Appends an item to `values`.
///
/// To override the contents of this collection use [`set_values`](Self::set_values).
///
/// <p>One or more filter values. Filter values are case-sensitive.</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>One or more filter values. Filter values are case-sensitive.</p>
pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.values = input;
self
}
/// <p>One or more filter values. Filter values are case-sensitive.</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 {
name: self.name,
values: self.values,
}
}
}