Skip to main content

nominal_api/conjure/objects/event/
time_series_channel_association.rs

1/// A singular time series to associate the event with.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct TimeSeriesChannelAssociation {
17    #[builder(into)]
18    #[serde(rename = "variableName")]
19    variable_name: String,
20    #[builder(default, into)]
21    #[serde(rename = "tags", skip_serializing_if = "Option::is_none", default)]
22    tags: Option<std::collections::BTreeMap<String, String>>,
23}
24impl TimeSeriesChannelAssociation {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(variable_name: impl Into<String>) -> Self {
28        Self::builder().variable_name(variable_name).build()
29    }
30    #[inline]
31    pub fn variable_name(&self) -> &str {
32        &*self.variable_name
33    }
34    /// If this variable is grouped, the tags within the groupings this event should associate with
35    #[inline]
36    pub fn tags(&self) -> Option<&std::collections::BTreeMap<String, String>> {
37        self.tags.as_ref().map(|o| &*o)
38    }
39}