#[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 SearchChecklistsRequest {
    #[builder(custom(type = super::ChecklistSearchQuery, convert = Box::new))]
    #[serde(rename = "query")]
    query: Box<super::ChecklistSearchQuery>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::SortOptions>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "sortBy", skip_serializing_if = "Option::is_none", default)]
    sort_by: Option<Box<super::SortOptions>>,
    #[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>,
    #[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 SearchChecklistsRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(query: super::ChecklistSearchQuery) -> Self {
        Self::builder().query(query).build()
    }
    #[inline]
    pub fn query(&self) -> &super::ChecklistSearchQuery {
        &*self.query
    }
    /// If not present, will sort by LAST_USED in descending order.
    #[inline]
    pub fn sort_by(&self) -> Option<&super::SortOptions> {
        self.sort_by.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 100. Will throw if larger than 1000.
    #[inline]
    pub fn page_size(&self) -> Option<i32> {
        self.page_size.as_ref().map(|o| *o)
    }
    #[deprecated(
        note = "Use search filters instead. If no archive search filters are provided, the search will default to \nreturning 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)
    }
}
