/*
 * 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 MigrationItem {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "job_id")]
    pub job_id: uuid::Uuid,
    #[serde(rename = "source_path")]
    pub source_path: String,
    #[serde(rename = "target_path")]
    pub target_path: String,
    #[serde(rename = "status")]
    pub status: Status,
    #[serde(rename = "size_bytes")]
    pub size_bytes: i32,
    #[serde(rename = "error_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub error_message: Option<Option<String>>,
}

impl MigrationItem {
    pub fn new(id: uuid::Uuid, job_id: uuid::Uuid, source_path: String, target_path: String, status: Status, size_bytes: i32) -> MigrationItem {
        MigrationItem {
            id,
            job_id,
            source_path,
            target_path,
            status,
            size_bytes,
            error_message: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "transferring")]
    Transferring,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "skipped")]
    Skipped,
}

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

