Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
table_column_enum_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 TableColumnEnumConfig {
16    #[builder(custom(type = super::TableColumnEnumAggregation, convert = Box::new))]
17    #[serde(rename = "aggregation")]
18    aggregation: Box<super::TableColumnEnumAggregation>,
19    #[builder(
20        default,
21        custom(
22            type = impl
23            Into<Option<super::TableColumnEnumAggregation>>,
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::TableColumnEnumAggregation>>,
33}
34impl TableColumnEnumConfig {
35    /// Constructs a new instance of the type.
36    #[inline]
37    pub fn new(aggregation: super::TableColumnEnumAggregation) -> Self {
38        Self::builder().aggregation(aggregation).build()
39    }
40    #[inline]
41    pub fn aggregation(&self) -> &super::TableColumnEnumAggregation {
42        &*self.aggregation
43    }
44    #[inline]
45    pub fn summary_row_aggregation(&self) -> Option<&super::TableColumnEnumAggregation> {
46        self.summary_row_aggregation.as_ref().map(|o| &**o)
47    }
48}