/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.0.0-rc.3
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// CveTrends : CVE trends summary.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CveTrends {
    #[serde(rename = "acknowledged_cves")]
    pub acknowledged_cves: i64,
    #[serde(rename = "avg_days_to_fix", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub avg_days_to_fix: Option<Option<f64>>,
    #[serde(rename = "critical_count")]
    pub critical_count: i64,
    #[serde(rename = "fixed_cves")]
    pub fixed_cves: i64,
    #[serde(rename = "high_count")]
    pub high_count: i64,
    #[serde(rename = "low_count")]
    pub low_count: i64,
    #[serde(rename = "medium_count")]
    pub medium_count: i64,
    #[serde(rename = "open_cves")]
    pub open_cves: i64,
    #[serde(rename = "timeline")]
    pub timeline: Vec<models::CveTimelineEntry>,
    #[serde(rename = "total_cves")]
    pub total_cves: i64,
}

impl CveTrends {
    /// CVE trends summary.
    pub fn new(acknowledged_cves: i64, critical_count: i64, fixed_cves: i64, high_count: i64, low_count: i64, medium_count: i64, open_cves: i64, timeline: Vec<models::CveTimelineEntry>, total_cves: i64) -> CveTrends {
        CveTrends {
            acknowledged_cves,
            avg_days_to_fix: None,
            critical_count,
            fixed_cves,
            high_count,
            low_count,
            medium_count,
            open_cves,
            timeline,
            total_cves,
        }
    }
}

