/*
 * 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 Attachment {
    #[serde(rename = "userId")]
    pub user_id: uuid::Uuid,
    #[serde(rename = "noteId")]
    pub note_id: uuid::Uuid,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "fileName")]
    pub file_name: String,
    #[serde(rename = "contentType")]
    pub content_type: String,
    #[serde(rename = "size")]
    pub size: f64,
    #[serde(rename = "checksum", skip_serializing_if = "Option::is_none")]
    pub checksum: Option<String>,
}

impl Attachment {
    pub fn new(
        user_id: uuid::Uuid,
        note_id: uuid::Uuid,
        id: uuid::Uuid,
        file_name: String,
        content_type: String,
        size: f64,
    ) -> Attachment {
        Attachment {
            user_id,
            note_id,
            id,
            file_name,
            content_type,
            size,
            checksum: None,
        }
    }
}
