#[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 GetSeriesCountRequest {
    #[serde(rename = "dataSourceRid")]
    data_source_rid: conjure_object::ResourceIdentifier,
    #[builder(into)]
    #[serde(rename = "channel")]
    channel: String,
    #[builder(custom(type = super::super::super::api::Range, convert = Box::new))]
    #[serde(rename = "range")]
    range: Box<super::super::super::api::Range>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::scout::compute::api::TagFilters>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "tagFilters", skip_serializing_if = "Option::is_none", default)]
    tag_filters: Option<Box<super::super::super::scout::compute::api::TagFilters>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::scout::compute::api::Context>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "context", skip_serializing_if = "Option::is_none", default)]
    context: Option<Box<super::super::super::scout::compute::api::Context>>,
}
impl GetSeriesCountRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        data_source_rid: conjure_object::ResourceIdentifier,
        channel: impl Into<String>,
        range: super::super::super::api::Range,
    ) -> Self {
        Self::builder()
            .data_source_rid(data_source_rid)
            .channel(channel)
            .range(range)
            .build()
    }
    #[inline]
    pub fn data_source_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.data_source_rid
    }
    #[inline]
    pub fn channel(&self) -> &str {
        &*self.channel
    }
    #[inline]
    pub fn range(&self) -> &super::super::super::api::Range {
        &*self.range
    }
    /// Tag filters to apply when counting series. Supports IN/NOT_IN operators and AND composition,
    /// matching the tag filter semantics used in compute queries.
    #[inline]
    pub fn tag_filters(
        &self,
    ) -> Option<&super::super::super::scout::compute::api::TagFilters> {
        self.tag_filters.as_ref().map(|o| &**o)
    }
    /// Variable context for resolving variables in tag filters. Same context format used in compute APIs.
    #[inline]
    pub fn context(&self) -> Option<&super::super::super::scout::compute::api::Context> {
        self.context.as_ref().map(|o| &**o)
    }
}
