Skip to main content

nominal_api/conjure/objects/scout/compute/resolved/api/
integral_series_node.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct IntegralSeriesNode {
13    #[builder(custom(type = super::NumericSeriesNode, convert = Box::new))]
14    #[serde(rename = "input")]
15    input: Box<super::NumericSeriesNode>,
16    #[builder(
17        custom(
18            type = super::super::super::super::super::api::Timestamp,
19            convert = Box::new
20        )
21    )]
22    #[serde(rename = "startTimestamp")]
23    start_timestamp: Box<super::super::super::super::super::api::Timestamp>,
24    #[builder(default, into)]
25    #[serde(rename = "timeUnit", skip_serializing_if = "Option::is_none", default)]
26    time_unit: Option<super::super::super::super::super::api::TimeUnit>,
27}
28impl IntegralSeriesNode {
29    /// Constructs a new instance of the type.
30    #[inline]
31    pub fn new(
32        input: super::NumericSeriesNode,
33        start_timestamp: super::super::super::super::super::api::Timestamp,
34    ) -> Self {
35        Self::builder().input(input).start_timestamp(start_timestamp).build()
36    }
37    #[inline]
38    pub fn input(&self) -> &super::NumericSeriesNode {
39        &*self.input
40    }
41    #[inline]
42    pub fn start_timestamp(&self) -> &super::super::super::super::super::api::Timestamp {
43        &*self.start_timestamp
44    }
45    #[inline]
46    pub fn time_unit(
47        &self,
48    ) -> Option<&super::super::super::super::super::api::TimeUnit> {
49        self.time_unit.as_ref().map(|o| &*o)
50    }
51}