nominal_api/conjure/objects/timeseries/metadata/api/
series_metadata.rs1#[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 SeriesMetadata {
16 #[serde(rename = "rid")]
17 rid: conjure_object::ResourceIdentifier,
18 #[builder(into)]
19 #[serde(rename = "channel")]
20 channel: String,
21 #[serde(rename = "dataSourceRid")]
22 data_source_rid: conjure_object::ResourceIdentifier,
23 #[builder(custom(type = super::LocatorTemplate, convert = Box::new))]
24 #[serde(rename = "locator")]
25 locator: Box<super::LocatorTemplate>,
26 #[builder(default, into)]
27 #[serde(rename = "unit", skip_serializing_if = "Option::is_none", default)]
28 unit: Option<String>,
29 #[builder(default, into)]
30 #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
31 description: Option<String>,
32 #[builder(default, map(key(type = String, into), value(type = String, into)))]
33 #[serde(
34 rename = "tags",
35 skip_serializing_if = "std::collections::BTreeMap::is_empty",
36 default
37 )]
38 tags: std::collections::BTreeMap<String, String>,
39 #[builder(default, into)]
40 #[serde(rename = "seriesDataType", skip_serializing_if = "Option::is_none", default)]
41 series_data_type: Option<super::super::super::super::api::SeriesDataType>,
42}
43impl SeriesMetadata {
44 #[inline]
45 pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
46 &self.rid
47 }
48 #[inline]
49 pub fn channel(&self) -> &str {
50 &*self.channel
51 }
52 #[inline]
53 pub fn data_source_rid(&self) -> &conjure_object::ResourceIdentifier {
54 &self.data_source_rid
55 }
56 #[inline]
57 pub fn locator(&self) -> &super::LocatorTemplate {
58 &*self.locator
59 }
60 #[inline]
61 pub fn unit(&self) -> Option<&str> {
62 self.unit.as_ref().map(|o| &**o)
63 }
64 #[inline]
65 pub fn description(&self) -> Option<&str> {
66 self.description.as_ref().map(|o| &**o)
67 }
68 #[deprecated(note = "Deprecated. Should not be used.")]
70 #[inline]
71 pub fn tags(&self) -> &std::collections::BTreeMap<String, String> {
72 &self.tags
73 }
74 #[inline]
75 pub fn series_data_type(
76 &self,
77 ) -> Option<&super::super::super::super::api::SeriesDataType> {
78 self.series_data_type.as_ref().map(|o| &*o)
79 }
80}