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,
}
}
}