/*
 * 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 Repository {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// Unique slug identifier
    #[serde(rename = "key")]
    pub key: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "format")]
    pub format: Format,
    #[serde(rename = "type")]
    pub r#type: Type,
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    #[serde(rename = "is_public")]
    pub is_public: bool,
    #[serde(rename = "quota_bytes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub quota_bytes: Option<Option<i32>>,
    #[serde(rename = "used_bytes")]
    pub used_bytes: i32,
    #[serde(rename = "artifact_count")]
    pub artifact_count: i32,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
}

impl Repository {
    pub fn new(id: uuid::Uuid, key: String, name: String, format: Format, r#type: Type, is_public: bool, used_bytes: i32, artifact_count: i32, created_at: String, updated_at: String) -> Repository {
        Repository {
            id,
            key,
            name,
            format,
            r#type,
            description: None,
            is_public,
            quota_bytes: None,
            used_bytes,
            artifact_count,
            created_at,
            updated_at,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Format {
    #[serde(rename = "maven")]
    Maven,
    #[serde(rename = "npm")]
    Npm,
    #[serde(rename = "pypi")]
    Pypi,
    #[serde(rename = "nuget")]
    Nuget,
    #[serde(rename = "cargo")]
    Cargo,
    #[serde(rename = "go")]
    Go,
    #[serde(rename = "docker")]
    Docker,
    #[serde(rename = "helm")]
    Helm,
    #[serde(rename = "debian")]
    Debian,
    #[serde(rename = "rpm")]
    Rpm,
    #[serde(rename = "rubygems")]
    Rubygems,
    #[serde(rename = "conan")]
    Conan,
    #[serde(rename = "composer")]
    Composer,
    #[serde(rename = "alpine")]
    Alpine,
    #[serde(rename = "conda")]
    Conda,
    #[serde(rename = "terraform")]
    Terraform,
    #[serde(rename = "generic")]
    Generic,
}

impl Default for Format {
    fn default() -> Format {
        Self::Maven
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "local")]
    Local,
    #[serde(rename = "remote")]
    Remote,
    #[serde(rename = "virtual")]
    Virtual,
}

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

