/*
 * 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 BuildRow {
    #[serde(rename = "agent", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub agent: Option<Option<String>>,
    #[serde(rename = "artifact_count", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub artifact_count: Option<Option<i32>>,
    #[serde(rename = "build_number")]
    pub build_number: i32,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "duration_ms", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub duration_ms: Option<Option<i64>>,
    #[serde(rename = "finished_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub finished_at: Option<Option<String>>,
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "name")]
    pub name: String,
    #[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,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
}

impl BuildRow {
    pub fn new(build_number: i32, created_at: String, id: uuid::Uuid, name: String, status: String, updated_at: String) -> BuildRow {
        BuildRow {
            agent: None,
            artifact_count: None,
            build_number,
            created_at,
            duration_ms: None,
            finished_at: None,
            id,
            name,
            started_at: None,
            status,
            updated_at,
        }
    }
}

