/*
 * This is an auto-generated file.
 * Any manual changes may be overwritten without notice!
 */

use derive_builder::Builder;
use serde::{Deserialize, Serialize};

/// DeploymentState tracks the state of a deployment for a given task group.
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct DeploymentState {
    #[serde(rename = "DesiredCanaries")]
    pub desired_canaries: i64,

    #[serde(rename = "PlacedAllocs")]
    pub placed_allocs: i64,

    #[serde(
        rename = "PlacedCanaries",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub placed_canaries: Vec<String>,

    #[serde(rename = "RequireProgressBy")]
    pub require_progress_by: chrono::DateTime<chrono::Utc>,

    #[serde(rename = "Promoted")]
    pub promoted: bool,

    #[serde(rename = "DesiredTotal")]
    pub desired_total: i64,

    #[serde(rename = "HealthyAllocs")]
    pub healthy_allocs: i64,

    #[serde(rename = "UnhealthyAllocs")]
    pub unhealthy_allocs: i64,

    #[serde(rename = "AutoRevert")]
    pub auto_revert: bool,

    #[serde(
        rename = "ProgressDeadline",
        serialize_with = "crate::serialize_duration",
        deserialize_with = "crate::deserialize_duration"
    )]
    pub progress_deadline: chrono::TimeDelta,
}
