/*
 * Tribufu API
 *
 * API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.3.0
 * Contact: contact@tribufu.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PackageRelease {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "version", deserialize_with = "Option::deserialize")]
    pub version: Option<String>,
    #[serde(rename = "package_id", skip_serializing_if = "Option::is_none")]
    pub package_id: Option<String>,
    #[serde(rename = "notes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub notes: Option<Option<String>>,
    #[serde(rename = "files", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub files: Option<Option<Vec<models::StorageFile>>>,
    #[serde(rename = "created", skip_serializing_if = "Option::is_none")]
    pub created: Option<String>,
    #[serde(rename = "updated", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub updated: Option<Option<String>>,
}

impl PackageRelease {
    pub fn new(version: Option<String>) -> PackageRelease {
        PackageRelease {
            id: None,
            version,
            package_id: None,
            notes: None,
            files: None,
            created: None,
            updated: None,
        }
    }
}

