#[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 FrequencyBucket {
#[serde(rename = "frequencyStart")]
#[derive_with(with = conjure_object::private::DoubleWrapper)]
frequency_start: f64,
#[serde(rename = "frequencyEnd")]
#[derive_with(with = conjure_object::private::DoubleWrapper)]
frequency_end: f64,
#[serde(rename = "frequencyCenter")]
#[derive_with(with = conjure_object::private::DoubleWrapper)]
frequency_center: f64,
#[serde(rename = "minAmplitude")]
#[derive_with(with = conjure_object::private::DoubleWrapper)]
min_amplitude: f64,
#[serde(rename = "maxAmplitude")]
#[derive_with(with = conjure_object::private::DoubleWrapper)]
max_amplitude: f64,
#[serde(rename = "meanAmplitude")]
#[derive_with(with = conjure_object::private::DoubleWrapper)]
mean_amplitude: f64,
#[serde(rename = "count")]
count: conjure_object::SafeLong,
#[builder(custom(type = super::FrequencyPoint, convert = Box::new))]
#[serde(rename = "firstPoint")]
first_point: Box<super::FrequencyPoint>,
#[builder(
default,
custom(
type = impl
Into<Option<super::FrequencyPoint>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "lastPoint", skip_serializing_if = "Option::is_none", default)]
last_point: Option<Box<super::FrequencyPoint>>,
}
impl FrequencyBucket {
#[inline]
pub fn frequency_start(&self) -> f64 {
self.frequency_start
}
#[inline]
pub fn frequency_end(&self) -> f64 {
self.frequency_end
}
#[inline]
pub fn frequency_center(&self) -> f64 {
self.frequency_center
}
#[inline]
pub fn min_amplitude(&self) -> f64 {
self.min_amplitude
}
#[inline]
pub fn max_amplitude(&self) -> f64 {
self.max_amplitude
}
#[inline]
pub fn mean_amplitude(&self) -> f64 {
self.mean_amplitude
}
#[inline]
pub fn count(&self) -> conjure_object::SafeLong {
self.count
}
#[inline]
pub fn first_point(&self) -> &super::FrequencyPoint {
&*self.first_point
}
#[inline]
pub fn last_point(&self) -> Option<&super::FrequencyPoint> {
self.last_point.as_ref().map(|o| &**o)
}
}