Skip to main content

nominal_api/conjure/objects/scout/compute/api/
enum_aggregation.rs

1/// Aggregates an input series using an enum aggregation operator. `AggregationBuilder.rollingTime`
2/// is not supported; only `AggregationBuilder.groupBy` is accepted at resolution time.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    conjure_object::private::DeriveWith
9)]
10#[serde(crate = "conjure_object::serde")]
11#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
12#[conjure_object::private::staged_builder::staged_builder]
13#[builder(crate = conjure_object::private::staged_builder, update, inline)]
14pub struct EnumAggregation {
15    #[builder(custom(type = super::AggregationBuilder, convert = Box::new))]
16    #[serde(rename = "input")]
17    input: Box<super::AggregationBuilder>,
18    #[builder(custom(type = super::EnumAggregationOperator, convert = Box::new))]
19    #[serde(rename = "operator")]
20    operator: Box<super::EnumAggregationOperator>,
21}
22impl EnumAggregation {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(
26        input: super::AggregationBuilder,
27        operator: super::EnumAggregationOperator,
28    ) -> Self {
29        Self::builder().input(input).operator(operator).build()
30    }
31    #[inline]
32    pub fn input(&self) -> &super::AggregationBuilder {
33        &*self.input
34    }
35    #[inline]
36    pub fn operator(&self) -> &super::EnumAggregationOperator {
37        &*self.operator
38    }
39}