Skip to main content

nominal_api/conjure/objects/scout/chartdefinition/api/
table_column_log_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 TableColumnLogConfig {
16    #[builder(custom(type = super::TableColumnLogAggregation, convert = Box::new))]
17    #[serde(rename = "aggregation")]
18    aggregation: Box<super::TableColumnLogAggregation>,
19    #[builder(
20        default,
21        custom(
22            type = impl
23            Into<Option<super::TableColumnLogAggregation>>,
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::TableColumnLogAggregation>>,
33    #[builder(default, list(item(type = super::LogColumnName)))]
34    #[serde(rename = "visibleLogFields", skip_serializing_if = "Vec::is_empty", default)]
35    visible_log_fields: Vec<super::LogColumnName>,
36    #[builder(
37        default,
38        custom(
39            type = impl
40            Into<Option<super::LogColumnTagFilters>>,
41            convert = |v|v.into().map(Box::new)
42        )
43    )]
44    #[serde(rename = "tagFilters", skip_serializing_if = "Option::is_none", default)]
45    tag_filters: Option<Box<super::LogColumnTagFilters>>,
46}
47impl TableColumnLogConfig {
48    /// Constructs a new instance of the type.
49    #[inline]
50    pub fn new(aggregation: super::TableColumnLogAggregation) -> Self {
51        Self::builder().aggregation(aggregation).build()
52    }
53    #[inline]
54    pub fn aggregation(&self) -> &super::TableColumnLogAggregation {
55        &*self.aggregation
56    }
57    #[inline]
58    pub fn summary_row_aggregation(&self) -> Option<&super::TableColumnLogAggregation> {
59        self.summary_row_aggregation.as_ref().map(|o| &**o)
60    }
61    #[inline]
62    pub fn visible_log_fields(&self) -> &[super::LogColumnName] {
63        &*self.visible_log_fields
64    }
65    #[inline]
66    pub fn tag_filters(&self) -> Option<&super::LogColumnTagFilters> {
67        self.tag_filters.as_ref().map(|o| &**o)
68    }
69}