/*
 * Mithril
 *
 * Mithril Compute API
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

///
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum SizeUnit {
    #[serde(rename = "b")]
    #[default]
    B,
    #[serde(rename = "kb")]
    Kb,
    #[serde(rename = "mb")]
    Mb,
    #[serde(rename = "gb")]
    Gb,
    #[serde(rename = "tb")]
    Tb,
    #[serde(rename = "pb")]
    Pb,
    #[serde(rename = "eb")]
    Eb,
    #[serde(rename = "gib")]
    Gib,
    #[serde(rename = "tib")]
    Tib,
}

impl std::fmt::Display for SizeUnit {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::B => write!(f, "b"),
            Self::Kb => write!(f, "kb"),
            Self::Mb => write!(f, "mb"),
            Self::Gb => write!(f, "gb"),
            Self::Tb => write!(f, "tb"),
            Self::Pb => write!(f, "pb"),
            Self::Eb => write!(f, "eb"),
            Self::Gib => write!(f, "gib"),
            Self::Tib => write!(f, "tib"),
        }
    }
}
