Skip to main content

nominal_api/conjure/objects/timeseries/logicalseries/api/
timestream_locator.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 TimestreamLocator {
16    #[serde(rename = "table")]
17    table: super::TableName,
18    #[builder(
19        default,
20        map(
21            key(type = super::super::super::super::api::TagName),
22            value(type = super::super::super::super::api::TagValue)
23        )
24    )]
25    #[serde(
26        rename = "dimensions",
27        skip_serializing_if = "std::collections::BTreeMap::is_empty",
28        default
29    )]
30    dimensions: std::collections::BTreeMap<
31        super::super::super::super::api::TagName,
32        super::super::super::super::api::TagValue,
33    >,
34    #[serde(rename = "measure")]
35    measure: super::MeasureName,
36    #[builder(default, into)]
37    #[serde(rename = "attribute", skip_serializing_if = "Option::is_none", default)]
38    attribute: Option<super::AttributeName>,
39    #[serde(rename = "type")]
40    type_: super::TimestreamType,
41}
42impl TimestreamLocator {
43    /// Constructs a new instance of the type.
44    #[inline]
45    pub fn new(
46        table: super::TableName,
47        measure: super::MeasureName,
48        type_: super::TimestreamType,
49    ) -> Self {
50        Self::builder().table(table).measure(measure).type_(type_).build()
51    }
52    #[inline]
53    pub fn table(&self) -> &super::TableName {
54        &self.table
55    }
56    #[inline]
57    pub fn dimensions(
58        &self,
59    ) -> &std::collections::BTreeMap<
60        super::super::super::super::api::TagName,
61        super::super::super::super::api::TagValue,
62    > {
63        &self.dimensions
64    }
65    #[inline]
66    pub fn measure(&self) -> &super::MeasureName {
67        &self.measure
68    }
69    /// If present, will be the attribute within the measurement for multi-measures.
70    #[inline]
71    pub fn attribute(&self) -> Option<&super::AttributeName> {
72        self.attribute.as_ref().map(|o| &*o)
73    }
74    #[inline]
75    pub fn type_(&self) -> &super::TimestreamType {
76        &self.type_
77    }
78}