#[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 PeakRanges {
#[builder(custom(type = super::NumericSeries, convert = Box::new))]
#[serde(rename = "input")]
input: Box<super::NumericSeries>,
#[builder(default, into)]
#[serde(rename = "returnsPeaks", skip_serializing_if = "Option::is_none", default)]
returns_peaks: Option<bool>,
#[builder(default, into)]
#[serde(rename = "returnType", skip_serializing_if = "Option::is_none", default)]
return_type: Option<super::PeakType>,
#[builder(
default,
custom(
type = impl
Into<Option<super::DoubleConstant>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(
rename = "minimumProminence",
skip_serializing_if = "Option::is_none",
default
)]
minimum_prominence: Option<Box<super::DoubleConstant>>,
}
impl PeakRanges {
#[inline]
pub fn new(input: super::NumericSeries) -> Self {
Self::builder().input(input).build()
}
#[inline]
pub fn input(&self) -> &super::NumericSeries {
&*self.input
}
#[deprecated(note = "No longer used, use returnType instead")]
#[inline]
pub fn returns_peaks(&self) -> Option<bool> {
self.returns_peaks.as_ref().map(|o| *o)
}
#[inline]
pub fn return_type(&self) -> Option<&super::PeakType> {
self.return_type.as_ref().map(|o| &*o)
}
#[inline]
pub fn minimum_prominence(&self) -> Option<&super::DoubleConstant> {
self.minimum_prominence.as_ref().map(|o| &**o)
}
}