nominal_api_conjure/conjure/objects/scout/compute/api/
data_source_channel.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 DataSourceChannel {
16 #[builder(custom(type = super::StringConstant, convert = Box::new))]
17 #[serde(rename = "dataSourceRid")]
18 data_source_rid: Box<super::StringConstant>,
19 #[builder(custom(type = super::StringConstant, convert = Box::new))]
20 #[serde(rename = "channel")]
21 channel: Box<super::StringConstant>,
22 #[builder(
23 default,
24 map(key(type = String, into), value(type = super::StringConstant))
25 )]
26 #[serde(
27 rename = "tags",
28 skip_serializing_if = "std::collections::BTreeMap::is_empty",
29 default
30 )]
31 tags: std::collections::BTreeMap<String, super::StringConstant>,
32 #[builder(
33 default,
34 custom(
35 type = impl
36 Into<Option<super::TagFilters>>,
37 convert = |v|v.into().map(Box::new)
38 )
39 )]
40 #[serde(rename = "tagFilters", skip_serializing_if = "Option::is_none", default)]
41 tag_filters: Option<Box<super::TagFilters>>,
42 #[builder(default, set(item(type = String, into)))]
43 #[serde(
44 rename = "tagsToGroupBy",
45 skip_serializing_if = "std::collections::BTreeSet::is_empty",
46 default
47 )]
48 tags_to_group_by: std::collections::BTreeSet<String>,
49 #[builder(default, set(item(type = super::StringConstant)))]
50 #[serde(
51 rename = "groupByTags",
52 skip_serializing_if = "std::collections::BTreeSet::is_empty",
53 default
54 )]
55 group_by_tags: std::collections::BTreeSet<super::StringConstant>,
56 #[builder(default, into)]
57 #[serde(rename = "storage", skip_serializing_if = "Option::is_none", default)]
58 storage: Option<super::SeriesStorage>,
59}
60impl DataSourceChannel {
61 #[inline]
63 pub fn new(
64 data_source_rid: super::StringConstant,
65 channel: super::StringConstant,
66 ) -> Self {
67 Self::builder().data_source_rid(data_source_rid).channel(channel).build()
68 }
69 #[inline]
70 pub fn data_source_rid(&self) -> &super::StringConstant {
71 &*self.data_source_rid
72 }
73 #[inline]
74 pub fn channel(&self) -> &super::StringConstant {
75 &*self.channel
76 }
77 #[deprecated(note = "Use tagFilters")]
78 #[inline]
79 pub fn tags(&self) -> &std::collections::BTreeMap<String, super::StringConstant> {
80 &self.tags
81 }
82 #[inline]
85 pub fn tag_filters(&self) -> Option<&super::TagFilters> {
86 self.tag_filters.as_ref().map(|o| &**o)
87 }
88 #[deprecated(
89 note = "Use groupByTags instead. Throws if both tagsToGroupBy and groupByTags are specified.\n"
90 )]
91 #[inline]
92 pub fn tags_to_group_by(&self) -> &std::collections::BTreeSet<String> {
93 &self.tags_to_group_by
94 }
95 #[inline]
98 pub fn group_by_tags(&self) -> &std::collections::BTreeSet<super::StringConstant> {
99 &self.group_by_tags
100 }
101 #[inline]
105 pub fn storage(&self) -> Option<&super::SeriesStorage> {
106 self.storage.as_ref().map(|o| &*o)
107 }
108}