Skip to main content

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

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct TableColumnRangeConfig {
16    #[builder(custom(type = super::TableColumnRangeAggregation, convert = Box::new))]
17    #[serde(rename = "aggregation")]
18    aggregation: Box<super::TableColumnRangeAggregation>,
19    #[builder(
20        default,
21        custom(
22            type = impl
23            Into<Option<super::TableColumnRangeAggregation>>,
24            convert = |v|v.into().map(Box::new)
25        )
26    )]
27    #[serde(
28        rename = "summaryRowAggregation",
29        skip_serializing_if = "Option::is_none",
30        default
31    )]
32    summary_row_aggregation: Option<Box<super::TableColumnRangeAggregation>>,
33}
34impl TableColumnRangeConfig {
35    /// Constructs a new instance of the type.
36    #[inline]
37    pub fn new(aggregation: super::TableColumnRangeAggregation) -> Self {
38        Self::builder().aggregation(aggregation).build()
39    }
40    #[inline]
41    pub fn aggregation(&self) -> &super::TableColumnRangeAggregation {
42        &*self.aggregation
43    }
44    #[inline]
45    pub fn summary_row_aggregation(
46        &self,
47    ) -> Option<&super::TableColumnRangeAggregation> {
48        self.summary_row_aggregation.as_ref().map(|o| &**o)
49    }
50}