nominal-api-conjure 0.1422.0

Conjure HTTP API bindings for the Nominal platform
Documentation
/// Produces ranges where a numeric input satisfies a threshold comparison.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct ThresholdRangesV2 {
    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
    #[serde(rename = "input")]
    input: Box<super::NumericSeries>,
    #[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(
        default,
        custom(
            type = impl
            Into<Option<super::Duration>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "minDuration", skip_serializing_if = "Option::is_none", default)]
    min_duration: Option<Box<super::Duration>>,
    #[builder(default, into)]
    #[serde(rename = "rangeStart", skip_serializing_if = "Option::is_none", default)]
    range_start: Option<super::RangeStart>,
    #[builder(custom(type = super::ThresholdRangesComparison, convert = Box::new))]
    #[serde(rename = "comparison")]
    comparison: Box<super::ThresholdRangesComparison>,
}
impl ThresholdRangesV2 {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        input: super::NumericSeries,
        comparison: super::ThresholdRangesComparison,
    ) -> Self {
        Self::builder().input(input).comparison(comparison).build()
    }
    #[inline]
    pub fn input(&self) -> &super::NumericSeries {
        &*self.input
    }
    /// Minimum number of matching points. Defaults to 1.
    #[inline]
    pub fn min_points(&self) -> Option<&super::IntegerConstant> {
        self.min_points.as_ref().map(|o| &**o)
    }
    /// Minimum matching duration. Defaults to one nanosecond.
    #[inline]
    pub fn min_duration(&self) -> Option<&super::Duration> {
        self.min_duration.as_ref().map(|o| &**o)
    }
    /// Selects whether the output begins at the first match or after persistence is satisfied.
    #[inline]
    pub fn range_start(&self) -> Option<&super::RangeStart> {
        self.range_start.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn comparison(&self) -> &super::ThresholdRangesComparison {
        &*self.comparison
    }
}