/// Filters to use when searching for available tag names and values in paged endpoints.
/// All filters are optional.
#[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 TagSearchFilters {
    #[builder(default, into)]
    #[serde(rename = "channel", skip_serializing_if = "Option::is_none", default)]
    channel: Option<String>,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "tagFilters",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    tag_filters: std::collections::BTreeMap<String, String>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::api::Range>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "range", skip_serializing_if = "Option::is_none", default)]
    range: Option<Box<super::super::super::api::Range>>,
}
impl TagSearchFilters {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    /// Optional, defaults to all channels in datasource.
    #[inline]
    pub fn channel(&self) -> Option<&str> {
        self.channel.as_ref().map(|o| &**o)
    }
    /// Optional, defaults to no tag filter.
    #[inline]
    pub fn tag_filters(&self) -> &std::collections::BTreeMap<String, String> {
        &self.tag_filters
    }
    /// Optional, defaults to no range filter.
    #[inline]
    pub fn range(&self) -> Option<&super::super::super::api::Range> {
        self.range.as_ref().map(|o| &**o)
    }
}
