#[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 SearchAssetsRequest {
    #[builder(custom(type = super::AssetSortOptions, convert = Box::new))]
    #[serde(rename = "sort")]
    sort: Box<super::AssetSortOptions>,
    #[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::SearchAssetsQuery, convert = Box::new))]
    #[serde(rename = "query")]
    query: Box<super::SearchAssetsQuery>,
    #[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 SearchAssetsRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(sort: super::AssetSortOptions, query: super::SearchAssetsQuery) -> Self {
        Self::builder().sort(sort).query(query).build()
    }
    #[inline]
    pub fn sort(&self) -> &super::AssetSortOptions {
        &*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::SearchAssetsQuery {
        &*self.query
    }
    /// Default search status is NOT_ARCHIVED if none are provided. Allows for including archived assets in search.
    #[inline]
    pub fn archived_statuses(
        &self,
    ) -> Option<
        &std::collections::BTreeSet<super::super::super::super::api::ArchivedStatus>,
    > {
        self.archived_statuses.as_ref().map(|o| &*o)
    }
}
