/*
 * 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 PromotionResponse {
    #[serde(rename = "message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub message: Option<Option<String>>,
    #[serde(rename = "policy_violations")]
    pub policy_violations: Vec<models::PolicyViolation>,
    #[serde(rename = "promoted")]
    pub promoted: bool,
    #[serde(rename = "promotion_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub promotion_id: Option<Option<uuid::Uuid>>,
    #[serde(rename = "source")]
    pub source: String,
    #[serde(rename = "target")]
    pub target: String,
}

impl PromotionResponse {
    pub fn new(policy_violations: Vec<models::PolicyViolation>, promoted: bool, source: String, target: String) -> PromotionResponse {
        PromotionResponse {
            message: None,
            policy_violations,
            promoted,
            promotion_id: None,
            source,
            target,
        }
    }
}

