Skip to main content

nominal_api_conjure/conjure/objects/scout/compute/api/
select_series.rs

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