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

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

/// Resources encapsulates the required resources of
/// a given task or 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 Resources {
    #[serde(
        rename = "Networks",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub networks: Vec<super::NetworkResource>,

    #[serde(
        rename = "Devices",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub devices: Vec<super::RequestedDevice>,

    #[serde(rename = "NUMA", skip_serializing_if = "Option::is_none")]
    pub numa: Option<super::NUMAResource>,

    /// COMPAT(0.10)
    /// XXX Deprecated. Please do not use. The field will be removed in Nomad
    /// 0.10 and is only being kept to allow any references to be removed before
    /// then.
    #[serde(rename = "IOPS", skip_serializing_if = "Option::is_none")]
    pub iops: Option<i64>,

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

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

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

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

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

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