/*
 * 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 GetCveTrends200Response {
    /// Number of days covered by the trend window.
    #[serde(rename = "period_days")]
    pub period_days: i32,
    /// Total open CVEs at the end of the period.
    #[serde(rename = "total_cves")]
    pub total_cves: i32,
    /// CVEs first detected during the period.
    #[serde(rename = "new_cves")]
    pub new_cves: i32,
    /// CVEs resolved during the period.
    #[serde(rename = "resolved_cves")]
    pub resolved_cves: i32,
    /// Counts keyed by severity level (critical, high, medium, low).
    #[serde(rename = "by_severity")]
    pub by_severity: std::collections::HashMap<String, i32>,
    /// Per-day breakdown of CVE counts.
    #[serde(rename = "daily")]
    pub daily: Vec<models::GetCveTrends200ResponseDailyInner>,
}

impl GetCveTrends200Response {
    pub fn new(period_days: i32, total_cves: i32, new_cves: i32, resolved_cves: i32, by_severity: std::collections::HashMap<String, i32>, daily: Vec<models::GetCveTrends200ResponseDailyInner>) -> GetCveTrends200Response {
        GetCveTrends200Response {
            period_days,
            total_cves,
            new_cves,
            resolved_cves,
            by_severity,
            daily,
        }
    }
}

