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: conjure_object::ResourceIdentifier,
15    #[builder(into)]
16    #[serde(rename = "channel")]
17    channel: String,
18    #[builder(custom(type = super::super::super::api::Range, convert = Box::new))]
19    #[serde(rename = "range")]
20    range: Box<super::super::super::api::Range>,
21    #[builder(
22        default,
23        custom(
24            type = impl
25            Into<Option<super::super::super::scout::compute::api::TagFilters>>,
26            convert = |v|v.into().map(Box::new)
27        )
28    )]
29    #[serde(rename = "tagFilters", skip_serializing_if = "Option::is_none", default)]
30    tag_filters: Option<Box<super::super::super::scout::compute::api::TagFilters>>,
31    #[builder(
32        default,
33        custom(
34            type = impl
35            Into<Option<super::super::super::scout::compute::api::Context>>,
36            convert = |v|v.into().map(Box::new)
37        )
38    )]
39    #[serde(rename = "context", skip_serializing_if = "Option::is_none", default)]
40    context: Option<Box<super::super::super::scout::compute::api::Context>>,
41}
42impl GetSeriesCountRequest {
43    /// Constructs a new instance of the type.
44    #[inline]
45    pub fn new(
46        data_source_rid: conjure_object::ResourceIdentifier,
47        channel: impl Into<String>,
48        range: super::super::super::api::Range,
49    ) -> Self {
50        Self::builder()
51            .data_source_rid(data_source_rid)
52            .channel(channel)
53            .range(range)
54            .build()
55    }
56    #[inline]
57    pub fn data_source_rid(&self) -> &conjure_object::ResourceIdentifier {
58        &self.data_source_rid
59    }
60    #[inline]
61    pub fn channel(&self) -> &str {
62        &*self.channel
63    }
64    #[inline]
65    pub fn range(&self) -> &super::super::super::api::Range {
66        &*self.range
67    }
68    /// Tag filters to apply when counting series. Supports IN/NOT_IN operators and AND composition,
69    /// matching the tag filter semantics used in compute queries.
70    #[inline]
71    pub fn tag_filters(
72        &self,
73    ) -> Option<&super::super::super::scout::compute::api::TagFilters> {
74        self.tag_filters.as_ref().map(|o| &**o)
75    }
76    /// Variable context for resolving variables in tag filters. Same context format used in compute APIs.
77    #[inline]
78    pub fn context(&self) -> Option<&super::super::super::scout::compute::api::Context> {
79        self.context.as_ref().map(|o| &**o)
80    }
81}