#[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 AggregateNumericSeriesNode {
    #[builder(custom(type = super::SeriesNode, convert = Box::new))]
    #[serde(rename = "input")]
    input: Box<super::SeriesNode>,
    #[builder(custom(type = super::ResolvedNumericAggregation, convert = Box::new))]
    #[serde(rename = "aggregation")]
    aggregation: Box<super::ResolvedNumericAggregation>,
    #[builder(default, into)]
    #[serde(rename = "groupByTags", skip_serializing_if = "Option::is_none", default)]
    group_by_tags: Option<std::collections::BTreeSet<String>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::FillStrategy>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "fillStrategy", skip_serializing_if = "Option::is_none", default)]
    fill_strategy: Option<Box<super::FillStrategy>>,
}
impl AggregateNumericSeriesNode {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        input: super::SeriesNode,
        aggregation: super::ResolvedNumericAggregation,
    ) -> Self {
        Self::builder().input(input).aggregation(aggregation).build()
    }
    #[inline]
    pub fn input(&self) -> &super::SeriesNode {
        &*self.input
    }
    #[inline]
    pub fn aggregation(&self) -> &super::ResolvedNumericAggregation {
        &*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)
    }
    #[inline]
    pub fn fill_strategy(&self) -> Option<&super::FillStrategy> {
        self.fill_strategy.as_ref().map(|o| &**o)
    }
}
