1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/// Selects series from a dataset (might contain multiple tag groupings). When `name` is provided, selects
/// that single channel. When `name` is omitted, selection starts from all channels in the dataset scope;
/// callers narrow the selection with a `filterByTag` predicate on the reserved `NOMINAL_CHANNEL` tag key
/// and preserve per-channel identity in the response with `selectTags`. Providing both `name` and a
/// `NOMINAL_CHANNEL` filter is rejected as an invalid request. Raw and derived channels can both be selected
/// through the reserved tag filter.
#[derive(
Debug,
Clone,
conjure_object::serde::Serialize,
conjure_object::serde::Deserialize,
conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct SelectSeries {
#[builder(
default,
custom(
type = impl
Into<Option<super::StringConstant>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "name", skip_serializing_if = "Option::is_none", default)]
name: Option<Box<super::StringConstant>>,
#[builder(
default,
custom(
type = impl
Into<Option<super::Dataset>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "dataset", skip_serializing_if = "Option::is_none", default)]
dataset: Option<Box<super::Dataset>>,
#[builder(
default,
custom(
type = impl
Into<Option<super::Sampling>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "sampling", skip_serializing_if = "Option::is_none", default)]
sampling: Option<Box<super::Sampling>>,
}
impl SelectSeries {
/// Constructs a new instance of the type.
#[inline]
pub fn new() -> Self {
Self::builder().build()
}
/// The identifying series name to query
#[inline]
pub fn name(&self) -> Option<&super::StringConstant> {
self.name.as_ref().map(|o| &**o)
}
/// The dataset providing the data to query. May be omitted inside a `WithSeriesDataset` series definition,
/// in which case it defaults to that node's wrapping `input`; required everywhere else.
#[inline]
pub fn dataset(&self) -> Option<&super::Dataset> {
self.dataset.as_ref().map(|o| &**o)
}
/// Raw-series sampling options. Currently supported only for numeric raw series.
#[inline]
pub fn sampling(&self) -> Option<&super::Sampling> {
self.sampling.as_ref().map(|o| &**o)
}
}