#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct FrequencyPlotTypeFft {
    #[builder(default, into)]
    #[serde(rename = "window", skip_serializing_if = "Option::is_none", default)]
    window: Option<super::super::super::compute::api::FftWindow>,
    #[builder(default, into)]
    #[serde(
        rename = "peakDetectionMode",
        skip_serializing_if = "Option::is_none",
        default
    )]
    peak_detection_mode: Option<super::PeakDetectionMode>,
    #[builder(default, into)]
    #[serde(rename = "nfft", skip_serializing_if = "Option::is_none", default)]
    nfft: Option<i32>,
}
impl FrequencyPlotTypeFft {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    #[inline]
    pub fn window(&self) -> Option<&super::super::super::compute::api::FftWindow> {
        self.window.as_ref().map(|o| &*o)
    }
    /// The aggregate amplitude to render for bucketed FFT data. If not specified,
    /// clients should treat this as the legacy mean behavior.
    #[inline]
    pub fn peak_detection_mode(&self) -> Option<&super::PeakDetectionMode> {
        self.peak_detection_mode.as_ref().map(|o| &*o)
    }
    /// Length of the FFT. When nfft < input length, the input is truncated to the first nfft samples before
    /// windowing and transforming. When nfft > input length, the windowed input is zero-padded up to nfft
    /// before transforming. When nfft is unset, defaults to the input length, producing the same result as
    /// setting nfft to the input length. The output contains nfft/2 + 1 single-sided frequency bins with spacing
    /// fs/nfft. For best performance, prefer a power of 2 (e.g. 512, 1024, 2048).
    #[inline]
    pub fn nfft(&self) -> Option<i32> {
        self.nfft.as_ref().map(|o| *o)
    }
}
