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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ScoreResponse {
    #[serde(rename = "acknowledged_count")]
    pub acknowledged_count: i32,
    #[serde(rename = "calculated_at")]
    pub calculated_at: String,
    #[serde(rename = "critical_count")]
    pub critical_count: i32,
    #[serde(rename = "grade")]
    pub grade: String,
    #[serde(rename = "high_count")]
    pub high_count: i32,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "last_scan_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_scan_at: Option<Option<String>>,
    #[serde(rename = "low_count")]
    pub low_count: i32,
    #[serde(rename = "medium_count")]
    pub medium_count: i32,
    #[serde(rename = "repository_id")]
    pub repository_id: uuid::Uuid,
    #[serde(rename = "score")]
    pub score: i32,
    #[serde(rename = "total_findings")]
    pub total_findings: i32,
}

impl ScoreResponse {
    pub fn new(acknowledged_count: i32, calculated_at: String, critical_count: i32, grade: String, high_count: i32, id: uuid::Uuid, low_count: i32, medium_count: i32, repository_id: uuid::Uuid, score: i32, total_findings: i32) -> ScoreResponse {
        ScoreResponse {
            acknowledged_count,
            calculated_at,
            critical_count,
            grade,
            high_count,
            id,
            last_scan_at: None,
            low_count,
            medium_count,
            repository_id,
            score,
            total_findings,
        }
    }
}

