/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.0.0-rc.3
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RepositoryResponse {
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    #[serde(rename = "format")]
    pub format: String,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "is_public")]
    pub is_public: bool,
    #[serde(rename = "key")]
    pub key: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "quota_bytes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub quota_bytes: Option<Option<i64>>,
    #[serde(rename = "repo_type")]
    pub repo_type: String,
    #[serde(rename = "storage_used_bytes")]
    pub storage_used_bytes: i64,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    #[serde(rename = "upstream_auth_configured")]
    pub upstream_auth_configured: bool,
    #[serde(rename = "upstream_auth_type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub upstream_auth_type: Option<Option<String>>,
    #[serde(rename = "upstream_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub upstream_url: Option<Option<String>>,
}

impl RepositoryResponse {
    pub fn new(created_at: String, format: String, id: uuid::Uuid, is_public: bool, key: String, name: String, repo_type: String, storage_used_bytes: i64, updated_at: String, upstream_auth_configured: bool) -> RepositoryResponse {
        RepositoryResponse {
            created_at,
            description: None,
            format,
            id,
            is_public,
            key,
            name,
            quota_bytes: None,
            repo_type,
            storage_used_bytes,
            updated_at,
            upstream_auth_configured,
            upstream_auth_type: None,
            upstream_url: None,
        }
    }
}

