Skip to main content

nominal_api/conjure/objects/scout/savedviews/api/
asset_metric_column.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 AssetMetricColumn {
13    #[builder(custom(type = super::MetricColumnMetadata, convert = Box::new))]
14    #[serde(rename = "metadata")]
15    metadata: Box<super::MetricColumnMetadata>,
16    #[builder(custom(type = super::AssetMetricColumnTimeRange, convert = Box::new))]
17    #[serde(rename = "timeRange")]
18    time_range: Box<super::AssetMetricColumnTimeRange>,
19    #[serde(rename = "aggregation")]
20    aggregation: super::MetricColumnAggregation,
21    #[builder(custom(type = super::MetricColumnData, convert = Box::new))]
22    #[serde(rename = "data")]
23    data: Box<super::MetricColumnData>,
24    #[builder(
25        default,
26        custom(
27            type = impl
28            Into<Option<super::MetricColumnStyle>>,
29            convert = |v|v.into().map(Box::new)
30        )
31    )]
32    #[serde(rename = "style", skip_serializing_if = "Option::is_none", default)]
33    style: Option<Box<super::MetricColumnStyle>>,
34}
35impl AssetMetricColumn {
36    #[inline]
37    pub fn metadata(&self) -> &super::MetricColumnMetadata {
38        &*self.metadata
39    }
40    #[inline]
41    pub fn time_range(&self) -> &super::AssetMetricColumnTimeRange {
42        &*self.time_range
43    }
44    #[inline]
45    pub fn aggregation(&self) -> &super::MetricColumnAggregation {
46        &self.aggregation
47    }
48    #[inline]
49    pub fn data(&self) -> &super::MetricColumnData {
50        &*self.data
51    }
52    #[inline]
53    pub fn style(&self) -> Option<&super::MetricColumnStyle> {
54        self.style.as_ref().map(|o| &**o)
55    }
56}