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 ArtifactStatsResponse {
    #[serde(rename = "artifact_id")]
    pub artifact_id: uuid::Uuid,
    #[serde(rename = "download_count")]
    pub download_count: i64,
    #[serde(rename = "first_downloaded", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub first_downloaded: Option<Option<String>>,
    #[serde(rename = "last_downloaded", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_downloaded: Option<Option<String>>,
}

impl ArtifactStatsResponse {
    pub fn new(artifact_id: uuid::Uuid, download_count: i64) -> ArtifactStatsResponse {
        ArtifactStatsResponse {
            artifact_id,
            download_count,
            first_downloaded: None,
            last_downloaded: None,
        }
    }
}