Skip to main content

nominal_api/conjure/objects/scout/comparisonnotebook/api/
variable_with_aggregation.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct VariableWithAggregation {
16    #[builder(custom(type = super::VariableLocator, convert = Box::new))]
17    #[serde(rename = "locator")]
18    locator: Box<super::VariableLocator>,
19    #[builder(custom(type = super::AggregationType, convert = Box::new))]
20    #[serde(rename = "aggregationType")]
21    aggregation_type: Box<super::AggregationType>,
22}
23impl VariableWithAggregation {
24    /// Constructs a new instance of the type.
25    #[inline]
26    pub fn new(
27        locator: super::VariableLocator,
28        aggregation_type: super::AggregationType,
29    ) -> Self {
30        Self::builder().locator(locator).aggregation_type(aggregation_type).build()
31    }
32    #[inline]
33    pub fn locator(&self) -> &super::VariableLocator {
34        &*self.locator
35    }
36    #[inline]
37    pub fn aggregation_type(&self) -> &super::AggregationType {
38        &*self.aggregation_type
39    }
40}