/// Batched form of `searchChannels`. The map key of `requests` can be an arbitrary string
/// identifier. It will be returned in the response as part of `BatchedLocator`.
#[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 BatchSearchChannelsRequest {
    #[builder(
        default,
        map(key(type = String, into), value(type = super::BatchSearchChannelsEntry))
    )]
    #[serde(
        rename = "requests",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    requests: std::collections::BTreeMap<String, super::BatchSearchChannelsEntry>,
    #[builder(custom(type = super::ChannelSearchQuery, convert = Box::new))]
    #[serde(rename = "query")]
    query: Box<super::ChannelSearchQuery>,
    #[builder(custom(type = super::super::super::super::api::Range, convert = Box::new))]
    #[serde(rename = "timeRange")]
    time_range: Box<super::super::super::super::api::Range>,
    #[builder(default, into)]
    #[serde(
        rename = "maxResultChannels",
        skip_serializing_if = "Option::is_none",
        default
    )]
    max_result_channels: Option<i32>,
}
impl BatchSearchChannelsRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        query: super::ChannelSearchQuery,
        time_range: super::super::super::super::api::Range,
    ) -> Self {
        Self::builder().query(query).time_range(time_range).build()
    }
    #[inline]
    pub fn requests(
        &self,
    ) -> &std::collections::BTreeMap<String, super::BatchSearchChannelsEntry> {
        &self.requests
    }
    #[inline]
    pub fn query(&self) -> &super::ChannelSearchQuery {
        &*self.query
    }
    /// Time filter applied to the search. Only channels with data within this time range will be returned.
    /// A shorter time range will improve performance!
    #[inline]
    pub fn time_range(&self) -> &super::super::super::super::api::Range {
        &*self.time_range
    }
    /// Global cap on the merged channel result list. Defaults to 1000. Capped at 1000.
    #[inline]
    pub fn max_result_channels(&self) -> Option<i32> {
        self.max_result_channels.as_ref().map(|o| *o)
    }
}
