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

/// DtVulnerability : Vulnerability details
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DtVulnerability {
    #[serde(rename = "cvssV3BaseScore", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cvss_v3_base_score: Option<Option<f64>>,
    #[serde(rename = "cwe", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cwe: Option<Option<Box<models::DtCwe>>>,
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    #[serde(rename = "severity")]
    pub severity: String,
    #[serde(rename = "source")]
    pub source: String,
    #[serde(rename = "title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub title: Option<Option<String>>,
    #[serde(rename = "uuid")]
    pub uuid: String,
    #[serde(rename = "vulnId")]
    pub vuln_id: String,
}

impl DtVulnerability {
    /// Vulnerability details
    pub fn new(severity: String, source: String, uuid: String, vuln_id: String) -> DtVulnerability {
        DtVulnerability {
            cvss_v3_base_score: None,
            cwe: None,
            description: None,
            severity,
            source,
            title: None,
            uuid,
            vuln_id,
        }
    }
}

