//! Generated by grok, from [MSDN](https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-physicaldisk)

use serde_repr::{Deserialize_repr, Serialize_repr};

/// Bus type of the physical disk.
///
/// The storage bus type of the physical disk.
#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    Serialize_repr,
    Deserialize_repr,
)]
#[repr(u16)]
pub enum BusType {
    /// The bus type is unknown.
    Unknown = 0,
    /// SCSI
    SCSI = 1,
    /// ATAPI
    ATAPI = 2,
    /// ATA
    ATA = 3,
    /// IEEE 1394
    Ieee1394 = 4,
    /// SSA
    SSA = 5,
    /// Fibre Channel
    FibreChannel = 6,
    /// USB
    USB = 7,
    /// RAID
    RAID = 8,
    /// iSCSI
    ISCSI = 9,
    /// Serial Attached SCSI (SAS)
    SAS = 10,
    /// Serial ATA (SATA)
    SATA = 11,
    /// Secure Digital (SD)
    SD = 12,
    /// Multimedia Card (MMC)
    MMC = 13,
    /// This value is reserved for system use.
    Max = 14,
    /// File-Backed Virtual
    FileBackedVirtual = 15,
    /// Storage Spaces
    StorageSpaces = 16,
    /// NVMe
    NVMe = 17,
    // 18.. are Microsoft-reserved
}

/// Media type of the physical disk.
#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    Serialize_repr,
    Deserialize_repr,
)]
#[repr(u16)]
pub enum MediaType {
    /// Unspecified media type.
    Unspecified = 0,
    /// Hard Disk Drive
    HDD = 3,
    /// Solid-State Drive
    SSD = 4,
    /// Storage Class Memory (e.g., Intel Optane)
    SCM = 5,
}

/// High-level health indication of the device.
#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    Serialize_repr,
    Deserialize_repr,
)]
#[repr(u16)]
pub enum HealthStatus {
    /// The disk is healthy.
    Healthy = 0,
    /// The disk has a warning condition.
    Warning = 1,
    /// The disk is unhealthy.
    Unhealthy = 2,
    /// Health status is unknown.
    Unknown = 5,
}

/// Intended usage of the physical disk within a concrete pool.
///
/// Storage pools are required to follow the assigned policy for a physical disk.
#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    Serialize_repr,
    Deserialize_repr,
)]
#[repr(u16)]
pub enum Usage {
    /// The intended usage is not specified.
    Unknown = 0,
    /// This physical disk should only be used for data storage.
    AutoSelect = 1,
    /// This physical disk should only be used if manually selected by an administrator
    /// at the time of virtual disk creation (via `PhysicalDisksToUse`).
    ManualSelect = 2,
    /// This physical disk should be used as a hot spare.
    HotSpare = 3,
    /// This physical disk should be retired from use.
    /// At a minimum, no new allocations should go to this disk.
    Retired = 4,
    /// This physical disk should be used as a cache (journal) for other devices
    /// comprising a virtual disk. It will back a virtual disk's write-back cache,
    /// if configured.
    Journal = 5,
}