#[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 NotebookMetadata {
    #[builder(default, into)]
    #[serde(rename = "runRid", skip_serializing_if = "Option::is_none", default)]
    run_rid: Option<super::super::super::run::api::RunRid>,
    #[builder(custom(type = super::NotebookDataScope, convert = Box::new))]
    #[serde(rename = "dataScope")]
    data_scope: Box<super::NotebookDataScope>,
    #[serde(rename = "notebookType")]
    notebook_type: super::NotebookType,
    #[builder(into)]
    #[serde(rename = "title")]
    title: String,
    #[builder(into)]
    #[serde(rename = "description")]
    description: String,
    #[serde(rename = "isDraft")]
    is_draft: bool,
    #[serde(rename = "isArchived")]
    is_archived: bool,
    #[builder(custom(type = super::Lock, convert = Box::new))]
    #[serde(rename = "lock")]
    lock: Box<super::Lock>,
    #[serde(rename = "createdByRid")]
    created_by_rid: super::super::super::rids::api::UserRid,
    #[serde(rename = "createdAt")]
    created_at: conjure_object::DateTime<conjure_object::Utc>,
    #[builder(default, into)]
    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none", default)]
    updated_at: Option<conjure_object::DateTime<conjure_object::Utc>>,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "properties",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    properties: std::collections::BTreeMap<String, String>,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "labels",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    labels: std::collections::BTreeSet<String>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::super::api::ThemeAwareImage>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "previewImage", skip_serializing_if = "Option::is_none", default)]
    preview_image: Option<Box<super::super::super::super::api::ThemeAwareImage>>,
}
impl NotebookMetadata {
    /// deprecated. Use dataScope instead
    #[inline]
    pub fn run_rid(&self) -> Option<&super::super::super::run::api::RunRid> {
        self.run_rid.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn data_scope(&self) -> &super::NotebookDataScope {
        &*self.data_scope
    }
    #[inline]
    pub fn notebook_type(&self) -> &super::NotebookType {
        &self.notebook_type
    }
    #[inline]
    pub fn title(&self) -> &str {
        &*self.title
    }
    #[inline]
    pub fn description(&self) -> &str {
        &*self.description
    }
    #[inline]
    pub fn is_draft(&self) -> bool {
        self.is_draft
    }
    #[inline]
    pub fn is_archived(&self) -> bool {
        self.is_archived
    }
    #[inline]
    pub fn lock(&self) -> &super::Lock {
        &*self.lock
    }
    #[inline]
    pub fn created_by_rid(&self) -> &super::super::super::rids::api::UserRid {
        &self.created_by_rid
    }
    #[inline]
    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
        self.created_at
    }
    /// The timestamp when the workbook was last updated
    #[inline]
    pub fn updated_at(&self) -> Option<conjure_object::DateTime<conjure_object::Utc>> {
        self.updated_at.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
        &self.properties
    }
    #[inline]
    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
        &self.labels
    }
    #[inline]
    pub fn preview_image(
        &self,
    ) -> Option<&super::super::super::super::api::ThemeAwareImage> {
        self.preview_image.as_ref().map(|o| &**o)
    }
}
