nominal-api 0.1239.0

API bindings for the Nominal platform
Documentation
#[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 LineThreshold {
    #[serde(rename = "value")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    value: f64,
    #[builder(default, into)]
    #[serde(rename = "label", skip_serializing_if = "Option::is_none", default)]
    label: Option<String>,
    #[serde(rename = "color")]
    color: super::super::super::api::HexColor,
    #[serde(rename = "lineStyle")]
    line_style: super::ThresholdLineStyle,
}
impl LineThreshold {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        value: f64,
        color: super::super::super::api::HexColor,
        line_style: super::ThresholdLineStyle,
    ) -> Self {
        Self::builder().value(value).color(color).line_style(line_style).build()
    }
    #[inline]
    pub fn value(&self) -> f64 {
        self.value
    }
    #[inline]
    pub fn label(&self) -> Option<&str> {
        self.label.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn color(&self) -> &super::super::super::api::HexColor {
        &self.color
    }
    #[inline]
    pub fn line_style(&self) -> &super::ThresholdLineStyle {
        &self.line_style
    }
}