Skip to main content

nominal_api/conjure/objects/scout/savedviews/api/
metric_column_style.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct MetricColumnStyle {
13    #[serde(rename = "type")]
14    type_: super::MetricColumnThresholdType,
15    #[builder(default, into)]
16    #[serde(rename = "value", skip_serializing_if = "Option::is_none", default)]
17    value: Option<Vec<super::MetricColumnThreshold>>,
18}
19impl MetricColumnStyle {
20    /// Constructs a new instance of the type.
21    #[inline]
22    pub fn new(type_: super::MetricColumnThresholdType) -> Self {
23        Self::builder().type_(type_).build()
24    }
25    #[inline]
26    pub fn type_(&self) -> &super::MetricColumnThresholdType {
27        &self.type_
28    }
29    #[inline]
30    pub fn value(&self) -> Option<&[super::MetricColumnThreshold]> {
31        self.value.as_ref().map(|o| &**o)
32    }
33}