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