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

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FindingResponse {
    #[serde(rename = "acknowledged_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub acknowledged_at: Option<Option<String>>,
    #[serde(rename = "acknowledged_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub acknowledged_by: Option<Option<uuid::Uuid>>,
    #[serde(rename = "acknowledged_reason", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub acknowledged_reason: Option<Option<String>>,
    #[serde(rename = "affected_component", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub affected_component: Option<Option<String>>,
    #[serde(rename = "affected_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub affected_version: Option<Option<String>>,
    #[serde(rename = "artifact_id")]
    pub artifact_id: uuid::Uuid,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "cve_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cve_id: Option<Option<String>>,
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    #[serde(rename = "fixed_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub fixed_version: Option<Option<String>>,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "is_acknowledged")]
    pub is_acknowledged: bool,
    #[serde(rename = "scan_result_id")]
    pub scan_result_id: uuid::Uuid,
    #[serde(rename = "severity")]
    pub severity: String,
    #[serde(rename = "source", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub source: Option<Option<String>>,
    #[serde(rename = "source_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub source_url: Option<Option<String>>,
    #[serde(rename = "title")]
    pub title: String,
}

impl FindingResponse {
    pub fn new(artifact_id: uuid::Uuid, created_at: String, id: uuid::Uuid, is_acknowledged: bool, scan_result_id: uuid::Uuid, severity: String, title: String) -> FindingResponse {
        FindingResponse {
            acknowledged_at: None,
            acknowledged_by: None,
            acknowledged_reason: None,
            affected_component: None,
            affected_version: None,
            artifact_id,
            created_at,
            cve_id: None,
            description: None,
            fixed_version: None,
            id,
            is_acknowledged,
            scan_result_id,
            severity,
            source: None,
            source_url: None,
            title,
        }
    }
}

