#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct EnumFilterRangesNode {
    #[builder(custom(type = super::EnumSeriesNode, convert = Box::new))]
    #[serde(rename = "input")]
    input: Box<super::EnumSeriesNode>,
    #[serde(rename = "operator")]
    operator: super::super::EnumFilterOperator,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "values",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    values: std::collections::BTreeSet<String>,
    #[builder(default, into)]
    #[serde(rename = "minPoints", skip_serializing_if = "Option::is_none", default)]
    min_points: Option<i32>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::super::run::api::Duration>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "minDuration", skip_serializing_if = "Option::is_none", default)]
    min_duration: Option<Box<super::super::super::super::run::api::Duration>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::PersistenceWindowConfiguration>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "persistenceWindowConfiguration",
        skip_serializing_if = "Option::is_none",
        default
    )]
    persistence_window_configuration: Option<Box<super::PersistenceWindowConfiguration>>,
}
impl EnumFilterRangesNode {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        input: super::EnumSeriesNode,
        operator: super::super::EnumFilterOperator,
    ) -> Self {
        Self::builder().input(input).operator(operator).build()
    }
    #[inline]
    pub fn input(&self) -> &super::EnumSeriesNode {
        &*self.input
    }
    #[inline]
    pub fn operator(&self) -> &super::super::EnumFilterOperator {
        &self.operator
    }
    #[inline]
    pub fn values(&self) -> &std::collections::BTreeSet<String> {
        &self.values
    }
    /// The minimum number of points for which this condition is satisfied. Must be non-negative. If not present,
    /// will default to 1.
    #[deprecated(note = "Use persistenceWindowConfiguration instead.")]
    #[inline]
    pub fn min_points(&self) -> Option<i32> {
        self.min_points.as_ref().map(|o| *o)
    }
    /// The minimum duration for which this condition is satisfied. Must be non-negative. If not present, will
    /// default to 1 nanosecond.
    #[deprecated(note = "Use persistenceWindowConfiguration instead.")]
    #[inline]
    pub fn min_duration(
        &self,
    ) -> Option<&super::super::super::super::run::api::Duration> {
        self.min_duration.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn persistence_window_configuration(
        &self,
    ) -> Option<&super::PersistenceWindowConfiguration> {
        self.persistence_window_configuration.as_ref().map(|o| &**o)
    }
}
