#[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 StabilityWindowConfiguration {
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::IntegerConstant>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "minPoints", skip_serializing_if = "Option::is_none", default)]
    min_points: Option<Box<super::IntegerConstant>>,
    #[builder(custom(type = super::DurationConstant, convert = Box::new))]
    #[serde(rename = "duration")]
    duration: Box<super::DurationConstant>,
}
impl StabilityWindowConfiguration {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(duration: super::DurationConstant) -> Self {
        Self::builder().duration(duration).build()
    }
    /// The minimum number of points within the window to create a stable range. Must be non-negative. If not
    /// present, will default to 2.
    #[inline]
    pub fn min_points(&self) -> Option<&super::IntegerConstant> {
        self.min_points.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn duration(&self) -> &super::DurationConstant {
        &*self.duration
    }
}
