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

/// DtFinding : Vulnerability finding from Dependency-Track
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DtFinding {
    #[serde(rename = "analysis", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub analysis: Option<Option<Box<models::DtAnalysis>>>,
    #[serde(rename = "attribution", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub attribution: Option<Option<Box<models::DtAttribution>>>,
    #[serde(rename = "component")]
    pub component: Box<models::DtComponent>,
    #[serde(rename = "vulnerability")]
    pub vulnerability: Box<models::DtVulnerability>,
}

impl DtFinding {
    /// Vulnerability finding from Dependency-Track
    pub fn new(component: models::DtComponent, vulnerability: models::DtVulnerability) -> DtFinding {
        DtFinding {
            analysis: None,
            attribution: None,
            component: Box::new(component),
            vulnerability: Box::new(vulnerability),
        }
    }
}

