#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct AssetChannel {
    #[builder(custom(type = super::StringConstant, convert = Box::new))]
    #[serde(rename = "assetRid")]
    asset_rid: Box<super::StringConstant>,
    #[builder(custom(type = super::StringConstant, convert = Box::new))]
    #[serde(rename = "dataScopeName")]
    data_scope_name: Box<super::StringConstant>,
    #[builder(custom(type = super::StringConstant, convert = Box::new))]
    #[serde(rename = "channel")]
    channel: Box<super::StringConstant>,
    #[builder(
        default,
        map(key(type = String, into), value(type = super::StringConstant))
    )]
    #[serde(
        rename = "additionalTags",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    additional_tags: std::collections::BTreeMap<String, super::StringConstant>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::TagFilters>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "additionalTagFilters",
        skip_serializing_if = "Option::is_none",
        default
    )]
    additional_tag_filters: Option<Box<super::TagFilters>>,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "tagsToGroupBy",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    tags_to_group_by: std::collections::BTreeSet<String>,
    #[builder(default, set(item(type = super::StringConstant)))]
    #[serde(
        rename = "groupByTags",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    group_by_tags: std::collections::BTreeSet<super::StringConstant>,
}
impl AssetChannel {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        asset_rid: super::StringConstant,
        data_scope_name: super::StringConstant,
        channel: super::StringConstant,
    ) -> Self {
        Self::builder()
            .asset_rid(asset_rid)
            .data_scope_name(data_scope_name)
            .channel(channel)
            .build()
    }
    #[inline]
    pub fn asset_rid(&self) -> &super::StringConstant {
        &*self.asset_rid
    }
    /// Used to disambiguate when multiple data scopes within this asset contain channels with the same name.
    #[inline]
    pub fn data_scope_name(&self) -> &super::StringConstant {
        &*self.data_scope_name
    }
    #[inline]
    pub fn channel(&self) -> &super::StringConstant {
        &*self.channel
    }
    #[deprecated(note = "Use additionalTagFilters")]
    #[inline]
    pub fn additional_tags(
        &self,
    ) -> &std::collections::BTreeMap<String, super::StringConstant> {
        &self.additional_tags
    }
    /// Tags to filter the channel by, in addition to tag filters defined for a given Asset data scope. Throws on
    /// collisions with tag keys already defined for the given Asset data scope. Only returns points that match
    /// both sets of tag filters. For log series, include arg filters here in addition to tag filters.
    #[inline]
    pub fn additional_tag_filters(&self) -> Option<&super::TagFilters> {
        self.additional_tag_filters.as_ref().map(|o| &**o)
    }
    #[deprecated(
        note = "Use groupByTags instead. Throws if both tagsToGroupBy and groupByTags are specified.\n"
    )]
    #[inline]
    pub fn tags_to_group_by(&self) -> &std::collections::BTreeSet<String> {
        &self.tags_to_group_by
    }
    /// Tags that the channel should be grouped by. If this is non-empty a grouped result will be returned
    /// with an entry for each grouping. Only one of tagsToGroupBy and groupByTags should be specified.
    #[inline]
    pub fn group_by_tags(&self) -> &std::collections::BTreeSet<super::StringConstant> {
        &self.group_by_tags
    }
}
