Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
range_raw_visualisation.rs

1/// The settings for a raw range visualisation.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct RangeRawVisualisation {
17    #[builder(default, into)]
18    #[serde(rename = "rangeColor", skip_serializing_if = "Option::is_none", default)]
19    range_color: Option<super::super::super::api::HexColor>,
20    #[builder(default, into)]
21    #[serde(rename = "rangeLabel", skip_serializing_if = "Option::is_none", default)]
22    range_label: Option<String>,
23    #[builder(default, into)]
24    #[serde(rename = "noRangeColor", skip_serializing_if = "Option::is_none", default)]
25    no_range_color: Option<super::super::super::api::HexColor>,
26    #[builder(default, into)]
27    #[serde(rename = "noRangeLabel", skip_serializing_if = "Option::is_none", default)]
28    no_range_label: Option<String>,
29}
30impl RangeRawVisualisation {
31    /// Constructs a new instance of the type.
32    #[inline]
33    pub fn new() -> Self {
34        Self::builder().build()
35    }
36    #[inline]
37    pub fn range_color(&self) -> Option<&super::super::super::api::HexColor> {
38        self.range_color.as_ref().map(|o| &*o)
39    }
40    /// The string to display when the condition defined by the variable's function spec is met.
41    #[inline]
42    pub fn range_label(&self) -> Option<&str> {
43        self.range_label.as_ref().map(|o| &**o)
44    }
45    #[inline]
46    pub fn no_range_color(&self) -> Option<&super::super::super::api::HexColor> {
47        self.no_range_color.as_ref().map(|o| &*o)
48    }
49    /// The string to display when the condition defined by the variable's function spec is not met.
50    #[inline]
51    pub fn no_range_label(&self) -> Option<&str> {
52        self.no_range_label.as_ref().map(|o| &**o)
53    }
54}