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

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

/// ScalingPolicy is the user-specified API object for an autoscaling policy
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct ScalingPolicy {
    #[serde(rename = "Namespace")]
    pub namespace: String,

    #[serde(rename = "Target")]
    pub target: std::collections::HashMap<String, String>,

    #[serde(rename = "CreateIndex")]
    pub create_index: u64,

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

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

    #[serde(rename = "Policy")]
    pub policy: std::collections::HashMap<String, serde_json::Value>,

    #[serde(rename = "Type")]
    pub r#type: String,

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

    #[serde(rename = "ID")]
    pub id: String,

    #[serde(rename = "ModifyIndex")]
    pub modify_index: u64,
}
