/*
 * doqium - service-data REST API
 *
 * doqium - service-data REST API
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::doqium_data_client::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NoteMetadata {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "type")]
    pub r#type: Type,
    #[serde(rename = "slug")]
    pub slug: String,
    #[serde(rename = "title")]
    pub title: String,
    #[serde(rename = "labels")]
    pub labels: Vec<String>,
    #[serde(rename = "favorite")]
    pub favorite: bool,
    #[serde(rename = "trashed")]
    pub trashed: bool,
    #[serde(rename = "archived")]
    pub archived: bool,
    #[serde(rename = "public")]
    pub public: bool,
    #[serde(rename = "created")]
    pub created: String,
    #[serde(rename = "modified")]
    pub modified: String,
    #[serde(rename = "revision", skip_serializing_if = "Option::is_none")]
    pub revision: Option<f64>,
}

impl NoteMetadata {
    pub fn new(
        r#type: Type,
        slug: String,
        title: String,
        labels: Vec<String>,
        favorite: bool,
        trashed: bool,
        archived: bool,
        public: bool,
        created: String,
        modified: String,
    ) -> NoteMetadata {
        NoteMetadata {
            id: None,
            r#type,
            slug,
            title,
            labels,
            favorite,
            trashed,
            archived,
            public,
            created,
            modified,
            revision: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "text")]
    Text,
    #[serde(rename = "presentation")]
    Presentation,
    #[serde(rename = "drawing")]
    Drawing,
    #[serde(rename = "file")]
    File,
}

impl Default for Type {
    fn default() -> Type {
        Self::Text
    }
}
