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

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

/// CSIPlugin is used for serialization, see also nomad/structs/csi.go
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct CsiPlugin {
    #[serde(rename = "ControllersExpected")]
    pub controllers_expected: i64,

    #[serde(rename = "NodesExpected")]
    pub nodes_expected: i64,

    /// ModifyTime stored as UnixNano
    #[serde(rename = "ModifyTime")]
    pub modify_time: i64,

    #[serde(rename = "ControllerRequired")]
    pub controller_required: bool,

    #[serde(rename = "ControllersHealthy")]
    pub controllers_healthy: i64,

    /// Map Node.ID to CSIInfo fingerprint results
    #[serde(rename = "Controllers")]
    pub controllers: std::collections::HashMap<String, super::CsiInfo>,

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

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

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

    #[serde(rename = "Provider")]
    pub provider: String,

    #[serde(rename = "NodesHealthy")]
    pub nodes_healthy: i64,

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

    /// CreateTime stored as UnixNano
    #[serde(rename = "CreateTime")]
    pub create_time: i64,

    #[serde(rename = "Version")]
    pub version: String,

    #[serde(
        rename = "Allocations",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub allocations: Vec<super::AllocationListStub>,
}
