#[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 = super::super::super::api::rids::DataSourceRid)))]
#[serde(
rename = "dataSources",
skip_serializing_if = "std::collections::BTreeSet::is_empty",
default
)]
data_sources: std::collections::BTreeSet<
super::super::super::api::rids::DataSourceRid,
>,
#[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<
super::super::super::api::rids::DataSourceRid,
std::collections::BTreeSet<super::super::super::api::Channel>,
>,
>,
#[builder(default, into)]
#[serde(rename = "nextPageToken", skip_serializing_if = "Option::is_none", default)]
next_page_token: Option<super::super::super::api::Token>,
#[builder(default, into)]
#[serde(rename = "pageSize", skip_serializing_if = "Option::is_none", default)]
page_size: Option<i32>,
}
impl SearchChannelsRequest {
#[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)
}
#[inline]
pub fn exact_match(&self) -> &std::collections::BTreeSet<String> {
&self.exact_match
}
#[inline]
pub fn data_sources(
&self,
) -> &std::collections::BTreeSet<super::super::super::api::rids::DataSourceRid> {
&self.data_sources
}
#[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<
super::super::super::api::rids::DataSourceRid,
std::collections::BTreeSet<super::super::super::api::Channel>,
>,
> {
self.previously_selected_channels.as_ref().map(|o| &*o)
}
#[inline]
pub fn next_page_token(&self) -> Option<&super::super::super::api::Token> {
self.next_page_token.as_ref().map(|o| &*o)
}
#[inline]
pub fn page_size(&self) -> Option<i32> {
self.page_size.as_ref().map(|o| *o)
}
}