#[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 SearchTypesRequest {
    #[builder(custom(type = super::TypeSortOptions, convert = Box::new))]
    #[serde(rename = "sort")]
    sort: Box<super::TypeSortOptions>,
    #[builder(default, into)]
    #[serde(rename = "pageSize", skip_serializing_if = "Option::is_none", default)]
    page_size: Option<i32>,
    #[builder(default, into)]
    #[serde(rename = "nextPageToken", skip_serializing_if = "Option::is_none", default)]
    next_page_token: Option<String>,
    #[builder(custom(type = super::SearchTypesQuery, convert = Box::new))]
    #[serde(rename = "query")]
    query: Box<super::SearchTypesQuery>,
    #[builder(default, into)]
    #[serde(
        rename = "archivedStatuses",
        skip_serializing_if = "Option::is_none",
        default
    )]
    archived_statuses: Option<
        std::collections::BTreeSet<super::super::super::super::api::ArchivedStatus>,
    >,
}
impl SearchTypesRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(sort: super::TypeSortOptions, query: super::SearchTypesQuery) -> Self {
        Self::builder().sort(sort).query(query).build()
    }
    #[inline]
    pub fn sort(&self) -> &super::TypeSortOptions {
        &*self.sort
    }
    /// Page sizes greater than 10_000 will be rejected. Default pageSize is 100.
    #[inline]
    pub fn page_size(&self) -> Option<i32> {
        self.page_size.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn next_page_token(&self) -> Option<&str> {
        self.next_page_token.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn query(&self) -> &super::SearchTypesQuery {
        &*self.query
    }
    #[deprecated(
        note = "Use the isArchived search query option instead. If no filter is applied and this field is empty, the \ndefault search status is NOT_ARCHIVED.\n"
    )]
    #[inline]
    pub fn archived_statuses(
        &self,
    ) -> Option<
        &std::collections::BTreeSet<super::super::super::super::api::ArchivedStatus>,
    > {
        self.archived_statuses.as_ref().map(|o| &*o)
    }
}
