artifact-keeper-client 1.2.1

Rust client for the Artifact Keeper REST API
Documentation
/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.2.1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ArtifactResponse {
    /// When the proxy cache entry for this artifact was last written. Only populated for Remote (proxy) repositories whose proxy service is configured AND that have a cache-metadata blob for this path. None for Local / Virtual / Staging repos and for Remote repos whose cache hasn't been populated yet (e.g. an artifact that exists as a DB row from a direct upload but has never been fetched through the proxy). (#1541)
    #[serde(rename = "cache_cached_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cache_cached_at: Option<Option<String>>,
    /// When the proxy cache entry for this artifact will expire and be re-validated against upstream. Same gating as `cache_cached_at`. (#1541)
    #[serde(rename = "cache_expires_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cache_expires_at: Option<Option<String>>,
    #[serde(rename = "checksum_sha256")]
    pub checksum_sha256: String,
    #[serde(rename = "content_type")]
    pub content_type: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "download_count")]
    pub download_count: i64,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<Option<serde_json::Value>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "repository_key")]
    pub repository_key: String,
    #[serde(rename = "size_bytes")]
    pub size_bytes: i64,
    #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub version: Option<Option<String>>,
}

impl ArtifactResponse {
    pub fn new(checksum_sha256: String, content_type: String, created_at: String, download_count: i64, id: uuid::Uuid, name: String, path: String, repository_key: String, size_bytes: i64) -> ArtifactResponse {
        ArtifactResponse {
            cache_cached_at: None,
            cache_expires_at: None,
            checksum_sha256,
            content_type,
            created_at,
            download_count,
            id,
            metadata: None,
            name,
            path,
            repository_key,
            size_bytes,
            version: None,
        }
    }
}