Skip to main content

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

1/// Aggregates the values of a numeric series at each range specified by the input ranges.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    conjure_object::private::DeriveWith
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct RangesNumericAggregation {
14    #[builder(custom(type = super::RangeSeries, convert = Box::new))]
15    #[serde(rename = "ranges")]
16    ranges: Box<super::RangeSeries>,
17    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
18    #[serde(rename = "input")]
19    input: Box<super::NumericSeries>,
20    #[builder(custom(type = super::RangeAggregationOperation, convert = Box::new))]
21    #[serde(rename = "operation")]
22    operation: Box<super::RangeAggregationOperation>,
23}
24impl RangesNumericAggregation {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(
28        ranges: super::RangeSeries,
29        input: super::NumericSeries,
30        operation: super::RangeAggregationOperation,
31    ) -> Self {
32        Self::builder().ranges(ranges).input(input).operation(operation).build()
33    }
34    #[inline]
35    pub fn ranges(&self) -> &super::RangeSeries {
36        &*self.ranges
37    }
38    #[inline]
39    pub fn input(&self) -> &super::NumericSeries {
40        &*self.input
41    }
42    #[inline]
43    pub fn operation(&self) -> &super::RangeAggregationOperation {
44        &*self.operation
45    }
46}