Skip to main content

nominal_api/conjure/objects/datasource/api/
get_series_count_request.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct GetSeriesCountRequest {
13    #[serde(rename = "dataSourceRid")]
14    data_source_rid: super::super::super::api::rids::DataSourceRid,
15    #[serde(rename = "channel")]
16    channel: super::super::super::api::Channel,
17    #[builder(custom(type = super::super::super::api::Range, convert = Box::new))]
18    #[serde(rename = "range")]
19    range: Box<super::super::super::api::Range>,
20    #[builder(
21        default,
22        custom(
23            type = impl
24            Into<Option<super::super::super::scout::compute::api::TagFilters>>,
25            convert = |v|v.into().map(Box::new)
26        )
27    )]
28    #[serde(rename = "tagFilters", skip_serializing_if = "Option::is_none", default)]
29    tag_filters: Option<Box<super::super::super::scout::compute::api::TagFilters>>,
30    #[builder(
31        default,
32        custom(
33            type = impl
34            Into<Option<super::super::super::scout::compute::api::Context>>,
35            convert = |v|v.into().map(Box::new)
36        )
37    )]
38    #[serde(rename = "context", skip_serializing_if = "Option::is_none", default)]
39    context: Option<Box<super::super::super::scout::compute::api::Context>>,
40}
41impl GetSeriesCountRequest {
42    /// Constructs a new instance of the type.
43    #[inline]
44    pub fn new(
45        data_source_rid: super::super::super::api::rids::DataSourceRid,
46        channel: super::super::super::api::Channel,
47        range: super::super::super::api::Range,
48    ) -> Self {
49        Self::builder()
50            .data_source_rid(data_source_rid)
51            .channel(channel)
52            .range(range)
53            .build()
54    }
55    #[inline]
56    pub fn data_source_rid(&self) -> &super::super::super::api::rids::DataSourceRid {
57        &self.data_source_rid
58    }
59    #[inline]
60    pub fn channel(&self) -> &super::super::super::api::Channel {
61        &self.channel
62    }
63    #[inline]
64    pub fn range(&self) -> &super::super::super::api::Range {
65        &*self.range
66    }
67    /// Tag filters to apply when counting series. Supports IN/NOT_IN operators and AND composition,
68    /// matching the tag filter semantics used in compute queries.
69    #[inline]
70    pub fn tag_filters(
71        &self,
72    ) -> Option<&super::super::super::scout::compute::api::TagFilters> {
73        self.tag_filters.as_ref().map(|o| &**o)
74    }
75    /// Variable context for resolving variables in tag filters. Same context format used in compute APIs.
76    #[inline]
77    pub fn context(&self) -> Option<&super::super::super::scout::compute::api::Context> {
78        self.context.as_ref().map(|o| &**o)
79    }
80}