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>The configuration of the alert filters.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AlertFilters {
/// <p>The list of measures that you want to get alerts for.</p>
pub metric_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The list of DimensionFilter objects that are used for dimension-based filtering.</p>
pub dimension_filter_list: ::std::option::Option<::std::vec::Vec<crate::types::DimensionFilter>>,
}
impl AlertFilters {
/// <p>The list of measures that you want to get alerts for.</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 `.metric_list.is_none()`.
pub fn metric_list(&self) -> &[::std::string::String] {
self.metric_list.as_deref().unwrap_or_default()
}
/// <p>The list of DimensionFilter objects that are used for dimension-based filtering.</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 `.dimension_filter_list.is_none()`.
pub fn dimension_filter_list(&self) -> &[crate::types::DimensionFilter] {
self.dimension_filter_list.as_deref().unwrap_or_default()
}
}
impl AlertFilters {
/// Creates a new builder-style object to manufacture [`AlertFilters`](crate::types::AlertFilters).
pub fn builder() -> crate::types::builders::AlertFiltersBuilder {
crate::types::builders::AlertFiltersBuilder::default()
}
}
/// A builder for [`AlertFilters`](crate::types::AlertFilters).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AlertFiltersBuilder {
pub(crate) metric_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) dimension_filter_list: ::std::option::Option<::std::vec::Vec<crate::types::DimensionFilter>>,
}
impl AlertFiltersBuilder {
/// Appends an item to `metric_list`.
///
/// To override the contents of this collection use [`set_metric_list`](Self::set_metric_list).
///
/// <p>The list of measures that you want to get alerts for.</p>
pub fn metric_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.metric_list.unwrap_or_default();
v.push(input.into());
self.metric_list = ::std::option::Option::Some(v);
self
}
/// <p>The list of measures that you want to get alerts for.</p>
pub fn set_metric_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.metric_list = input;
self
}
/// <p>The list of measures that you want to get alerts for.</p>
pub fn get_metric_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.metric_list
}
/// Appends an item to `dimension_filter_list`.
///
/// To override the contents of this collection use [`set_dimension_filter_list`](Self::set_dimension_filter_list).
///
/// <p>The list of DimensionFilter objects that are used for dimension-based filtering.</p>
pub fn dimension_filter_list(mut self, input: crate::types::DimensionFilter) -> Self {
let mut v = self.dimension_filter_list.unwrap_or_default();
v.push(input);
self.dimension_filter_list = ::std::option::Option::Some(v);
self
}
/// <p>The list of DimensionFilter objects that are used for dimension-based filtering.</p>
pub fn set_dimension_filter_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DimensionFilter>>) -> Self {
self.dimension_filter_list = input;
self
}
/// <p>The list of DimensionFilter objects that are used for dimension-based filtering.</p>
pub fn get_dimension_filter_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DimensionFilter>> {
&self.dimension_filter_list
}
/// Consumes the builder and constructs a [`AlertFilters`](crate::types::AlertFilters).
pub fn build(self) -> crate::types::AlertFilters {
crate::types::AlertFilters {
metric_list: self.metric_list,
dimension_filter_list: self.dimension_filter_list,
}
}
}