/*
 * 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 DtPortfolioMetrics {
    /// Number of critical severity vulnerabilities
    #[serde(rename = "critical")]
    pub critical: i32,
    /// Number of high severity vulnerabilities
    #[serde(rename = "high")]
    pub high: i32,
    /// Number of medium severity vulnerabilities
    #[serde(rename = "medium")]
    pub medium: i32,
    /// Number of low severity vulnerabilities
    #[serde(rename = "low")]
    pub low: i32,
    /// Number of unassigned severity vulnerabilities
    #[serde(rename = "unassigned")]
    pub unassigned: i32,
    /// Total number of unique vulnerabilities
    #[serde(rename = "vulnerabilities", skip_serializing_if = "Option::is_none")]
    pub vulnerabilities: Option<i32>,
    /// Total number of findings
    #[serde(rename = "findings_total")]
    pub findings_total: i32,
    /// Number of audited findings
    #[serde(rename = "findings_audited")]
    pub findings_audited: i32,
    /// Number of unaudited findings
    #[serde(rename = "findings_unaudited")]
    pub findings_unaudited: i32,
    /// Number of suppressed findings
    #[serde(rename = "suppressions")]
    pub suppressions: i32,
    /// Calculated inherited risk score
    #[serde(rename = "inherited_risk_score")]
    pub inherited_risk_score: f64,
    /// Number of policy violations with fail state
    #[serde(rename = "policy_violations_fail")]
    pub policy_violations_fail: i32,
    /// Number of policy violations with warn state
    #[serde(rename = "policy_violations_warn")]
    pub policy_violations_warn: i32,
    /// Number of policy violations with info state
    #[serde(rename = "policy_violations_info")]
    pub policy_violations_info: i32,
    /// Total number of policy violations
    #[serde(rename = "policy_violations_total")]
    pub policy_violations_total: i32,
    /// Unix timestamp of the earliest metric occurrence
    #[serde(rename = "first_occurrence", skip_serializing_if = "Option::is_none")]
    pub first_occurrence: Option<i32>,
    /// Unix timestamp of the most recent metric occurrence
    #[serde(rename = "last_occurrence", skip_serializing_if = "Option::is_none")]
    pub last_occurrence: Option<i32>,
    /// Total number of projects in the portfolio
    #[serde(rename = "projects")]
    pub projects: i32,
}

impl DtPortfolioMetrics {
    pub fn new(critical: i32, high: i32, medium: i32, low: i32, unassigned: i32, findings_total: i32, findings_audited: i32, findings_unaudited: i32, suppressions: i32, inherited_risk_score: f64, policy_violations_fail: i32, policy_violations_warn: i32, policy_violations_info: i32, policy_violations_total: i32, projects: i32) -> DtPortfolioMetrics {
        DtPortfolioMetrics {
            critical,
            high,
            medium,
            low,
            unassigned,
            vulnerabilities: None,
            findings_total,
            findings_audited,
            findings_unaudited,
            suppressions,
            inherited_risk_score,
            policy_violations_fail,
            policy_violations_warn,
            policy_violations_info,
            policy_violations_total,
            first_occurrence: None,
            last_occurrence: None,
            projects,
        }
    }
}

