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

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

/// MigrateStrategy describes how allocations for a task group should be
/// migrated between nodes (eg when draining).
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct MigrateStrategy {
    #[serde(rename = "max_parallel", skip_serializing_if = "Option::is_none")]
    pub max_parallel: Option<i64>,

    #[serde(rename = "health_check", skip_serializing_if = "Option::is_none")]
    pub health_check: Option<String>,

    #[serde(
        rename = "min_healthy_time",
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::serialize_duration_option",
        deserialize_with = "crate::deserialize_duration_option",
        default
    )]
    pub min_healthy_time: Option<chrono::TimeDelta>,

    #[serde(
        rename = "healthy_deadline",
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::serialize_duration_option",
        deserialize_with = "crate::deserialize_duration_option",
        default
    )]
    pub healthy_deadline: Option<chrono::TimeDelta>,
}
