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    #[builder(default, into)]
50    #[serde(rename = "storage", skip_serializing_if = "Option::is_none", default)]
51    storage: Option<super::SeriesStorage>,
52}
53impl SelectSeries {
54    /// Constructs a new instance of the type.
55    #[inline]
56    pub fn new() -> Self {
57        Self::builder().build()
58    }
59    /// The identifying series name to query
60    #[inline]
61    pub fn name(&self) -> Option<&super::StringConstant> {
62        self.name.as_ref().map(|o| &**o)
63    }
64    /// The dataset providing the data to query. May be omitted inside a `WithSeriesDataset` series definition,
65    /// in which case it defaults to that node's wrapping `input`; required everywhere else.
66    #[inline]
67    pub fn dataset(&self) -> Option<&super::Dataset> {
68        self.dataset.as_ref().map(|o| &**o)
69    }
70    /// Raw-series sampling options. Supported for numeric and enum raw series.
71    #[inline]
72    pub fn sampling(&self) -> Option<&super::Sampling> {
73        self.sampling.as_ref().map(|o| &**o)
74    }
75    /// Storage engine to read the selected series from. Only applies to datasets written to both engines; see
76    /// `SeriesStorage`. Defaults to the engine configured for the caller. In general this field should
77    /// not be specified, and will be removed at a later date.
78    #[inline]
79    pub fn storage(&self) -> Option<&super::SeriesStorage> {
80        self.storage.as_ref().map(|o| &*o)
81    }
82}