/*
 * 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 GetArtifactStats200Response {
    #[serde(rename = "total_downloads")]
    pub total_downloads: i64,
    #[serde(rename = "downloads_30d")]
    pub downloads_30d: i64,
    #[serde(rename = "last_downloaded_at", deserialize_with = "Option::deserialize")]
    pub last_downloaded_at: Option<String>,
}

impl GetArtifactStats200Response {
    pub fn new(total_downloads: i64, downloads_30d: i64, last_downloaded_at: Option<String>) -> GetArtifactStats200Response {
        GetArtifactStats200Response {
            total_downloads,
            downloads_30d,
            last_downloaded_at,
        }
    }
}

