#[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 AggregateEventsRequest {
    #[builder(custom(type = super::SearchQuery, convert = Box::new))]
    #[serde(rename = "query")]
    query: Box<super::SearchQuery>,
    #[builder(default, set(item(type = super::AggregateType)))]
    #[serde(
        rename = "aggregateTypes",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    aggregate_types: std::collections::BTreeSet<super::AggregateType>,
}
impl AggregateEventsRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(query: super::SearchQuery) -> Self {
        Self::builder().query(query).build()
    }
    #[inline]
    pub fn query(&self) -> &super::SearchQuery {
        &*self.query
    }
    #[inline]
    pub fn aggregate_types(&self) -> &std::collections::BTreeSet<super::AggregateType> {
        &self.aggregate_types
    }
}
