Skip to main content

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

1/// Calculates the running total of the series values.
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 CumulativeSumSeries {
14    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
15    #[serde(rename = "input")]
16    input: Box<super::NumericSeries>,
17    #[builder(custom(type = super::TimestampConstant, convert = Box::new))]
18    #[serde(rename = "startTimestamp")]
19    start_timestamp: Box<super::TimestampConstant>,
20}
21impl CumulativeSumSeries {
22    /// Constructs a new instance of the type.
23    #[inline]
24    pub fn new(
25        input: super::NumericSeries,
26        start_timestamp: super::TimestampConstant,
27    ) -> Self {
28        Self::builder().input(input).start_timestamp(start_timestamp).build()
29    }
30    #[inline]
31    pub fn input(&self) -> &super::NumericSeries {
32        &*self.input
33    }
34    #[inline]
35    pub fn start_timestamp(&self) -> &super::TimestampConstant {
36        &*self.start_timestamp
37    }
38}