/*
 * 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 CreateBuildRequest {
    #[serde(rename = "agent", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub agent: Option<Option<String>>,
    #[serde(rename = "build_number")]
    pub build_number: i32,
    #[serde(rename = "metadata")]
    pub metadata: serde_json::Value,
    #[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 = "vcs_branch", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub vcs_branch: Option<Option<String>>,
    #[serde(rename = "vcs_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub vcs_message: Option<Option<String>>,
    #[serde(rename = "vcs_revision", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub vcs_revision: Option<Option<String>>,
    #[serde(rename = "vcs_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub vcs_url: Option<Option<String>>,
}

impl CreateBuildRequest {
    pub fn new(build_number: i32, metadata: serde_json::Value, name: String) -> CreateBuildRequest {
        CreateBuildRequest {
            agent: None,
            build_number,
            metadata,
            name,
            started_at: None,
            vcs_branch: None,
            vcs_message: None,
            vcs_revision: None,
            vcs_url: None,
        }
    }
}

