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

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

/// CSIVolumeListStub omits allocations. 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 CsiVolumeListStub {
    #[serde(rename = "ID")]
    pub id: String,

    #[serde(rename = "AttachmentMode")]
    pub attachment_mode: String,

    #[serde(rename = "CurrentWriters")]
    pub current_writers: i64,

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

    #[serde(rename = "ResourceExhausted")]
    pub resource_exhausted: chrono::DateTime<chrono::Utc>,

    #[serde(rename = "ExternalID")]
    pub external_id: String,

    #[serde(
        rename = "Topologies",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub topologies: Vec<super::CsiTopology>,

    #[serde(rename = "PluginID")]
    pub plugin_id: String,

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

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

    #[serde(rename = "Namespace")]
    pub namespace: String,

    #[serde(rename = "CurrentReaders")]
    pub current_readers: i64,

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

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

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

    #[serde(rename = "AccessMode")]
    pub access_mode: String,

    #[serde(rename = "Schedulable")]
    pub schedulable: bool,

    #[serde(rename = "ControllersExpected")]
    pub controllers_expected: i64,

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

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

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

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