#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct AggregateEnumSeriesNode {
    #[builder(custom(type = super::SeriesNode, convert = Box::new))]
    #[serde(rename = "input")]
    input: Box<super::SeriesNode>,
    #[builder(custom(type = super::ResolvedEnumAggregation, convert = Box::new))]
    #[serde(rename = "aggregation")]
    aggregation: Box<super::ResolvedEnumAggregation>,
    #[builder(default, into)]
    #[serde(rename = "groupByTags", skip_serializing_if = "Option::is_none", default)]
    group_by_tags: Option<std::collections::BTreeSet<String>>,
}
impl AggregateEnumSeriesNode {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        input: super::SeriesNode,
        aggregation: super::ResolvedEnumAggregation,
    ) -> Self {
        Self::builder().input(input).aggregation(aggregation).build()
    }
    #[inline]
    pub fn input(&self) -> &super::SeriesNode {
        &*self.input
    }
    #[inline]
    pub fn aggregation(&self) -> &super::ResolvedEnumAggregation {
        &*self.aggregation
    }
    /// Present optional containing empty set means explicitly group by NO tags.
    /// Empty optional means inherit tag groupings from input.
    #[inline]
    pub fn group_by_tags(&self) -> Option<&std::collections::BTreeSet<String>> {
        self.group_by_tags.as_ref().map(|o| &*o)
    }
}
