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

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

/// CheckRestart describes if and when a task should be restarted based on
/// failing health checks.
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct CheckRestart {
    #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
    pub limit: Option<i64>,

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

    #[serde(rename = "ignore_warnings", skip_serializing_if = "Option::is_none")]
    pub ignore_warnings: Option<bool>,
}
