/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.  ## Authentication  The JSON management API under `/api/v1/_*` accepts **API tokens only as `Authorization: Bearer <token>`**. This is the canonical scheme for programmatic access; JWTs issued by the login flow also use `Bearer`. HTTP Basic credentials on `/api/v1/_*` are validated *only* as a real `username:password` login — the password half is **not** retried as an API token. A request to `/api/v1/_*` that sends an API token in the password field of Basic auth therefore returns `401 AUTH_ERROR`; switch to `Authorization: Bearer <token>`.  Format (package-manager) endpoints such as `/v2/_*` (OCI), `/incus/_*`, `/debian/_*`, and the language registries are intentionally more permissive for client compatibility: in addition to Bearer, they accept HTTP **Basic** auth with the API token supplied in the *password* field (any username), matching the `pip` netrc / Artifactory-style `token:<api_token>` convention used by package managers that cannot send a Bearer header. This Basic-with-token fallback applies to format endpoints only, never to `/api/v1/_*`.
 *
 * The version of the OpenAPI document: 1.3.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// DtProjectMetrics : Project-level metrics from Dependency-Track
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DtProjectMetrics {
    #[serde(rename = "critical", skip_serializing_if = "Option::is_none")]
    pub critical: Option<i64>,
    #[serde(rename = "findingsAudited", skip_serializing_if = "Option::is_none")]
    pub findings_audited: Option<i64>,
    #[serde(rename = "findingsTotal", skip_serializing_if = "Option::is_none")]
    pub findings_total: Option<i64>,
    #[serde(rename = "findingsUnaudited", skip_serializing_if = "Option::is_none")]
    pub findings_unaudited: Option<i64>,
    #[serde(rename = "firstOccurrence", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub first_occurrence: Option<Option<i64>>,
    #[serde(rename = "high", skip_serializing_if = "Option::is_none")]
    pub high: Option<i64>,
    #[serde(rename = "inheritedRiskScore", skip_serializing_if = "Option::is_none")]
    pub inherited_risk_score: Option<f64>,
    #[serde(rename = "lastOccurrence", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_occurrence: Option<Option<i64>>,
    #[serde(rename = "low", skip_serializing_if = "Option::is_none")]
    pub low: Option<i64>,
    #[serde(rename = "medium", skip_serializing_if = "Option::is_none")]
    pub medium: Option<i64>,
    #[serde(rename = "policyViolationsFail", skip_serializing_if = "Option::is_none")]
    pub policy_violations_fail: Option<i64>,
    #[serde(rename = "policyViolationsInfo", skip_serializing_if = "Option::is_none")]
    pub policy_violations_info: Option<i64>,
    #[serde(rename = "policyViolationsTotal", skip_serializing_if = "Option::is_none")]
    pub policy_violations_total: Option<i64>,
    #[serde(rename = "policyViolationsWarn", skip_serializing_if = "Option::is_none")]
    pub policy_violations_warn: Option<i64>,
    #[serde(rename = "suppressions", skip_serializing_if = "Option::is_none")]
    pub suppressions: Option<i64>,
    #[serde(rename = "unassigned", skip_serializing_if = "Option::is_none")]
    pub unassigned: Option<i64>,
    #[serde(rename = "vulnerabilities", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub vulnerabilities: Option<Option<i64>>,
}

impl DtProjectMetrics {
    /// Project-level metrics from Dependency-Track
    pub fn new() -> DtProjectMetrics {
        DtProjectMetrics {
            critical: None,
            findings_audited: None,
            findings_total: None,
            findings_unaudited: None,
            first_occurrence: None,
            high: None,
            inherited_risk_score: None,
            last_occurrence: None,
            low: None,
            medium: None,
            policy_violations_fail: None,
            policy_violations_info: None,
            policy_violations_total: None,
            policy_violations_warn: None,
            suppressions: None,
            unassigned: None,
            vulnerabilities: None,
        }
    }
}

