#[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 SearchChannelsRequest {
    #[builder(into)]
    #[serde(rename = "fuzzySearchText")]
    fuzzy_search_text: String,
    #[builder(default, into)]
    #[serde(rename = "prefix", skip_serializing_if = "Option::is_none", default)]
    prefix: Option<String>,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "exactMatch",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    exact_match: std::collections::BTreeSet<String>,
    #[builder(default, set(item(type = conjure_object::ResourceIdentifier)))]
    #[serde(
        rename = "dataSources",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    data_sources: std::collections::BTreeSet<conjure_object::ResourceIdentifier>,
    #[builder(default, set(item(type = super::super::super::api::SeriesDataType)))]
    #[serde(
        rename = "dataTypes",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    data_types: std::collections::BTreeSet<super::super::super::api::SeriesDataType>,
    #[builder(default, into)]
    #[serde(
        rename = "previouslySelectedChannels",
        skip_serializing_if = "Option::is_none",
        default
    )]
    previously_selected_channels: Option<
        std::collections::BTreeMap<
            conjure_object::ResourceIdentifier,
            std::collections::BTreeSet<String>,
        >,
    >,
    #[builder(default, into)]
    #[serde(rename = "nextPageToken", skip_serializing_if = "Option::is_none", default)]
    next_page_token: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "pageSize", skip_serializing_if = "Option::is_none", default)]
    page_size: Option<i32>,
}
impl SearchChannelsRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(fuzzy_search_text: impl Into<String>) -> Self {
        Self::builder().fuzzy_search_text(fuzzy_search_text).build()
    }
    #[inline]
    pub fn fuzzy_search_text(&self) -> &str {
        &*self.fuzzy_search_text
    }
    #[deprecated(note = "Use `searchHierarchical` instead. Will be ignored.\n")]
    #[inline]
    pub fn prefix(&self) -> Option<&str> {
        self.prefix.as_ref().map(|o| &**o)
    }
    /// Will return only channels that contain all strings specified as exact matches (case insensitive).
    #[inline]
    pub fn exact_match(&self) -> &std::collections::BTreeSet<String> {
        &self.exact_match
    }
    #[inline]
    pub fn data_sources(
        &self,
    ) -> &std::collections::BTreeSet<conjure_object::ResourceIdentifier> {
        &self.data_sources
    }
    /// Filter to only channels with these data types. An empty set means no filtering (all data types included).
    #[inline]
    pub fn data_types(
        &self,
    ) -> &std::collections::BTreeSet<super::super::super::api::SeriesDataType> {
        &self.data_types
    }
    #[deprecated(note = "Will be ignored.\n")]
    #[inline]
    pub fn previously_selected_channels(
        &self,
    ) -> Option<
        &std::collections::BTreeMap<
            conjure_object::ResourceIdentifier,
            std::collections::BTreeSet<String>,
        >,
    > {
        self.previously_selected_channels.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn next_page_token(&self) -> Option<&str> {
        self.next_page_token.as_ref().map(|o| &**o)
    }
    /// Defaults to 1000. Will throw if larger than 1000.
    #[inline]
    pub fn page_size(&self) -> Option<i32> {
        self.page_size.as_ref().map(|o| *o)
    }
}
