/*
 * 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};

/// GrowthSummary : Aggregate growth metrics comparing the start and end of a time period.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GrowthSummary {
    /// First date of the comparison period.
    #[serde(rename = "period_start")]
    pub period_start: String,
    /// Last date of the comparison period.
    #[serde(rename = "period_end")]
    pub period_end: String,
    /// Storage consumed at the start of the period in bytes.
    #[serde(rename = "storage_bytes_start")]
    pub storage_bytes_start: i64,
    /// Storage consumed at the end of the period in bytes.
    #[serde(rename = "storage_bytes_end")]
    pub storage_bytes_end: i64,
    /// Net change in storage bytes over the period.
    #[serde(rename = "storage_growth_bytes")]
    pub storage_growth_bytes: i64,
    /// Percentage growth in storage over the period.
    #[serde(rename = "storage_growth_percent")]
    pub storage_growth_percent: f64,
    /// Total artifact count at the start of the period.
    #[serde(rename = "artifacts_start")]
    pub artifacts_start: i32,
    /// Total artifact count at the end of the period.
    #[serde(rename = "artifacts_end")]
    pub artifacts_end: i32,
    /// Net number of artifacts added during the period.
    #[serde(rename = "artifacts_added")]
    pub artifacts_added: i32,
    /// Total downloads that occurred within the period.
    #[serde(rename = "downloads_in_period")]
    pub downloads_in_period: i64,
}

impl GrowthSummary {
    /// Aggregate growth metrics comparing the start and end of a time period.
    pub fn new(period_start: String, period_end: String, storage_bytes_start: i64, storage_bytes_end: i64, storage_growth_bytes: i64, storage_growth_percent: f64, artifacts_start: i32, artifacts_end: i32, artifacts_added: i32, downloads_in_period: i64) -> GrowthSummary {
        GrowthSummary {
            period_start,
            period_end,
            storage_bytes_start,
            storage_bytes_end,
            storage_growth_bytes,
            storage_growth_percent,
            artifacts_start,
            artifacts_end,
            artifacts_added,
            downloads_in_period,
        }
    }
}

