artifact-keeper-client 1.1.0

Rust client for the Artifact Keeper REST API
Documentation
/*
 * 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 CheckResponse {
    #[serde(rename = "artifact_id")]
    pub artifact_id: uuid::Uuid,
    #[serde(rename = "check_type")]
    pub check_type: String,
    #[serde(rename = "checker_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub checker_version: Option<Option<String>>,
    #[serde(rename = "completed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub completed_at: Option<Option<String>>,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "critical_count")]
    pub critical_count: i32,
    #[serde(rename = "details", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub details: Option<Option<serde_json::Value>>,
    #[serde(rename = "error_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub error_message: Option<Option<String>>,
    #[serde(rename = "high_count")]
    pub high_count: i32,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "info_count")]
    pub info_count: i32,
    #[serde(rename = "issues_count")]
    pub issues_count: i32,
    #[serde(rename = "low_count")]
    pub low_count: i32,
    #[serde(rename = "medium_count")]
    pub medium_count: i32,
    #[serde(rename = "passed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub passed: Option<Option<bool>>,
    #[serde(rename = "repository_id")]
    pub repository_id: uuid::Uuid,
    #[serde(rename = "score", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub score: Option<Option<i32>>,
    #[serde(rename = "started_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub started_at: Option<Option<String>>,
    #[serde(rename = "status")]
    pub status: String,
}

impl CheckResponse {
    pub fn new(artifact_id: uuid::Uuid, check_type: String, created_at: String, critical_count: i32, high_count: i32, id: uuid::Uuid, info_count: i32, issues_count: i32, low_count: i32, medium_count: i32, repository_id: uuid::Uuid, status: String) -> CheckResponse {
        CheckResponse {
            artifact_id,
            check_type,
            checker_version: None,
            completed_at: None,
            created_at,
            critical_count,
            details: None,
            error_message: None,
            high_count,
            id,
            info_count,
            issues_count,
            low_count,
            medium_count,
            passed: None,
            repository_id,
            score: None,
            started_at: None,
            status,
        }
    }
}