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

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

/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct Template {
    #[serde(rename = "env", skip_serializing_if = "Option::is_none")]
    pub envvars: Option<bool>,

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

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

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

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

    #[serde(rename = "change_script", skip_serializing_if = "Option::is_none")]
    pub change_script: Option<super::ChangeScript>,

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

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

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

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

    #[serde(rename = "wait", skip_serializing_if = "Option::is_none")]
    pub wait: Option<super::WaitConfig>,

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

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

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

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

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