#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith,
    Copy
)]
#[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 FrequencyDecimateWithBuckets {
    #[serde(rename = "buckets")]
    buckets: i32,
    #[builder(default, into)]
    #[serde(rename = "minFrequency", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    min_frequency: Option<f64>,
    #[builder(default, into)]
    #[serde(rename = "maxFrequency", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    max_frequency: Option<f64>,
}
impl FrequencyDecimateWithBuckets {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(buckets: i32) -> Self {
        Self::builder().buckets(buckets).build()
    }
    /// Target number of frequency bins/buckets.
    #[inline]
    pub fn buckets(&self) -> i32 {
        self.buckets
    }
    /// Optional minimum frequency bound. When set, frequencies below this value are excluded
    /// before bucketing, increasing resolution within the requested range. This bound is inclusive.
    /// The bound uses the same unit as the transform's output frequency.
    #[inline]
    pub fn min_frequency(&self) -> Option<f64> {
        self.min_frequency.as_ref().map(|o| *o)
    }
    /// Optional maximum frequency bound. When set, frequencies above this value are excluded
    /// before bucketing, increasing resolution within the requested range. This bound is exclusive.
    /// The bound uses the same unit as the transform's output frequency.
    #[inline]
    pub fn max_frequency(&self) -> Option<f64> {
        self.max_frequency.as_ref().map(|o| *o)
    }
}
