#[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 NumericHistogramBucketWidthAndOffset {
    #[serde(rename = "width")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    width: f64,
    #[builder(default, into)]
    #[serde(rename = "offset", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    offset: Option<f64>,
}
impl NumericHistogramBucketWidthAndOffset {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(width: f64) -> Self {
        Self::builder().width(width).build()
    }
    #[inline]
    pub fn width(&self) -> f64 {
        self.width
    }
    #[inline]
    pub fn offset(&self) -> Option<f64> {
        self.offset.as_ref().map(|o| *o)
    }
}
