#[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 SearchNotebooksRequest {
    #[builder(custom(type = super::SearchNotebooksQuery, convert = Box::new))]
    #[serde(rename = "query")]
    query: Box<super::SearchNotebooksQuery>,
    #[serde(rename = "showDrafts")]
    show_drafts: bool,
    #[builder(default, into)]
    #[serde(rename = "showArchived", skip_serializing_if = "Option::is_none", default)]
    show_archived: Option<bool>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::SortBy>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "sortBy", skip_serializing_if = "Option::is_none", default)]
    sort_by: Option<Box<super::SortBy>>,
    #[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>,
}
impl SearchNotebooksRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(query: super::SearchNotebooksQuery, show_drafts: bool) -> Self {
        Self::builder().query(query).show_drafts(show_drafts).build()
    }
    #[inline]
    pub fn query(&self) -> &super::SearchNotebooksQuery {
        &*self.query
    }
    /// Soon to be deprecated. Compose a draftState filter within SearchNotebooksQuery instead
    #[inline]
    pub fn show_drafts(&self) -> bool {
        self.show_drafts
    }
    /// Soon to be deprecated. Compose an archived filter within SearchNotebooksQuery instead
    #[inline]
    pub fn show_archived(&self) -> Option<bool> {
        self.show_archived.as_ref().map(|o| *o)
    }
    /// UPDATED_AT descending by default
    #[inline]
    pub fn sort_by(&self) -> Option<&super::SortBy> {
        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)
    }
}
