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

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

/// Node is used to deserialize a node entry.
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct Node {
    #[serde(rename = "Attributes")]
    pub attributes: std::collections::HashMap<String, String>,

    #[serde(rename = "Drain")]
    pub drain: bool,

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

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

    #[serde(rename = "Reserved", skip_serializing_if = "Option::is_none")]
    pub reserved: Option<super::Resources>,

    #[serde(rename = "ReservedResources", skip_serializing_if = "Option::is_none")]
    pub reserved_resources: Option<super::NodeReservedResources>,

    #[serde(rename = "NodeClass")]
    pub node_class: String,

    #[serde(rename = "NodePool")]
    pub node_pool: String,

    #[serde(rename = "CgroupParent")]
    pub cgroup_parent: String,

    #[serde(rename = "SchedulingEligibility")]
    pub scheduling_eligibility: String,

    #[serde(rename = "Status")]
    pub status: String,

    #[serde(
        rename = "Events",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub events: Vec<super::NodeEvent>,

    #[serde(rename = "HostNetworks")]
    pub host_networks: std::collections::HashMap<String, super::HostNetworkInfo>,

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

    #[serde(rename = "HTTPAddr")]
    pub http_addr: String,

    #[serde(rename = "TLSEnabled")]
    pub tls_enabled: bool,

    #[serde(rename = "Drivers")]
    pub drivers: std::collections::HashMap<String, super::DriverInfo>,

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

    #[serde(rename = "HostVolumes")]
    pub host_volumes: std::collections::HashMap<String, super::HostVolumeInfo>,

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

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

    #[serde(rename = "StatusDescription")]
    pub status_description: String,

    #[serde(rename = "StatusUpdatedAt")]
    pub status_updated_at: i64,

    #[serde(rename = "CSINodePlugins")]
    pub csi_node_plugins: std::collections::HashMap<String, super::CsiInfo>,

    #[serde(rename = "LastDrain", skip_serializing_if = "Option::is_none")]
    pub last_drain: Option<super::DrainMetadata>,

    #[serde(rename = "Name")]
    pub name: String,

    #[serde(rename = "CSIControllerPlugins")]
    pub csi_controller_plugins: std::collections::HashMap<String, super::CsiInfo>,

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

    #[serde(rename = "Datacenter")]
    pub datacenter: String,

    #[serde(rename = "Meta")]
    pub meta: std::collections::HashMap<String, String>,
}
