Skip to main content

nominal_api/conjure/objects/scout/compute/api/deprecated/
arithmetic_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 ArithmeticSeriesNode {
13    #[builder(
14        default,
15        map(
16            key(type = super::super::LocalVariableName),
17            value(type = super::NumericSeriesNode)
18        )
19    )]
20    #[serde(
21        rename = "inputs",
22        skip_serializing_if = "std::collections::BTreeMap::is_empty",
23        default
24    )]
25    inputs: std::collections::BTreeMap<
26        super::super::LocalVariableName,
27        super::NumericSeriesNode,
28    >,
29    #[builder(into)]
30    #[serde(rename = "expression")]
31    expression: String,
32}
33impl ArithmeticSeriesNode {
34    /// Constructs a new instance of the type.
35    #[inline]
36    pub fn new(expression: impl Into<String>) -> Self {
37        Self::builder().expression(expression).build()
38    }
39    #[inline]
40    pub fn inputs(
41        &self,
42    ) -> &std::collections::BTreeMap<
43        super::super::LocalVariableName,
44        super::NumericSeriesNode,
45    > {
46        &self.inputs
47    }
48    #[inline]
49    pub fn expression(&self) -> &str {
50        &*self.expression
51    }
52}