#[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 {
#[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
}
#[inline]
pub fn min_points(&self) -> Option<&super::IntegerConstant> {
self.min_points.as_ref().map(|o| &**o)
}
#[inline]
pub fn min_duration(&self) -> Option<&super::Duration> {
self.min_duration.as_ref().map(|o| &**o)
}
#[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
}
}