#[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 SummarizeSeriesNode {
    #[builder(custom(type = super::SeriesNode, convert = Box::new))]
    #[serde(rename = "input")]
    input: Box<super::SeriesNode>,
    #[builder(
        custom(
            type = super::super::super::api::SummarizationStrategy,
            convert = Box::new
        )
    )]
    #[serde(rename = "summarizationStrategy")]
    summarization_strategy: Box<super::super::super::api::SummarizationStrategy>,
    #[serde(rename = "outputFormat")]
    output_format: super::super::super::api::OutputFormat,
    #[builder(default, into)]
    #[serde(
        rename = "numericOutputFields",
        skip_serializing_if = "Option::is_none",
        default
    )]
    numeric_output_fields: Option<
        std::collections::BTreeSet<super::super::super::api::NumericOutputField>,
    >,
    #[builder(
        default,
        map(key(type = String, into), value(type = super::ResolvedNumericAggregation))
    )]
    #[serde(
        rename = "numericAggregations",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    numeric_aggregations: std::collections::BTreeMap<
        String,
        super::ResolvedNumericAggregation,
    >,
}
impl SummarizeSeriesNode {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        input: super::SeriesNode,
        summarization_strategy: super::super::super::api::SummarizationStrategy,
        output_format: super::super::super::api::OutputFormat,
    ) -> Self {
        Self::builder()
            .input(input)
            .summarization_strategy(summarization_strategy)
            .output_format(output_format)
            .build()
    }
    #[inline]
    pub fn input(&self) -> &super::SeriesNode {
        &*self.input
    }
    #[inline]
    pub fn summarization_strategy(
        &self,
    ) -> &super::super::super::api::SummarizationStrategy {
        &*self.summarization_strategy
    }
    #[inline]
    pub fn output_format(&self) -> &super::super::super::api::OutputFormat {
        &self.output_format
    }
    #[inline]
    pub fn numeric_output_fields(
        &self,
    ) -> Option<
        &std::collections::BTreeSet<super::super::super::api::NumericOutputField>,
    > {
        self.numeric_output_fields.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn numeric_aggregations(
        &self,
    ) -> &std::collections::BTreeMap<String, super::ResolvedNumericAggregation> {
        &self.numeric_aggregations
    }
}
