/*
 * Artifact Keeper API
 *
 * REST API for Artifact Keeper, an open-source universal artifact registry. Covers user management, repositories, artifacts, search, security scanning, SBOM, dependency tracking, SSO, analytics, monitoring, telemetry, lifecycle policies, plugins, edge nodes, migration, and administration. Format-specific protocol endpoints (npm, PyPI, Maven, Docker/OCI, etc.) are not included; those follow their respective upstream specifications.
 *
 * The version of the OpenAPI document: 1.0.0-a2
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Backup {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "type")]
    pub r#type: Type,
    #[serde(rename = "status")]
    pub status: Status,
    #[serde(rename = "size_bytes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub size_bytes: Option<Option<i32>>,
    #[serde(rename = "include_artifacts")]
    pub include_artifacts: bool,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "completed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub completed_at: Option<Option<String>>,
}

impl Backup {
    pub fn new(id: uuid::Uuid, r#type: Type, status: Status, include_artifacts: bool, created_at: String) -> Backup {
        Backup {
            id,
            r#type,
            status,
            size_bytes: None,
            include_artifacts,
            created_at,
            completed_at: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "full")]
    Full,
    #[serde(rename = "metadata")]
    Metadata,
    #[serde(rename = "incremental")]
    Incremental,
}

impl Default for Type {
    fn default() -> Type {
        Self::Full
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "running")]
    Running,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "failed")]
    Failed,
}

impl Default for Status {
    fn default() -> Status {
        Self::Pending
    }
}

