autogen-stedi 0.3.2

Auto-generated, strongly-typed Rust client for the Stedi APIs
Documentation
/*
 * Stedi Healthcare
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2024-04-01
 * Contact: healthcare@stedi.com
 * Generated by: https://openapi-generator.tech
 */

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

/// MeasurementUnitCode : Code identifying the unit of measurement. Can be set to `F2` - International Unit, `GR` - Gram, `ME` - Milligram, `ML` - Milliliter, or `UN` - Unit.
/// Code identifying the unit of measurement. Can be set to `F2` - International Unit, `GR` - Gram, `ME` - Milligram, `ML` - Milliliter, or `UN` - Unit.
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MeasurementUnitCode {
    #[serde(rename = "F2")]
    F2,
    #[serde(rename = "GR")]
    Gr,
    #[serde(rename = "ME")]
    Me,
    #[serde(rename = "ML")]
    Ml,
    #[serde(rename = "UN")]
    Un,
    /// Any value not defined in the spec (payers may return non-compliant values).
    #[serde(untagged)]
    UnknownValue(String),

}

impl std::fmt::Display for MeasurementUnitCode {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::F2 => write!(f, "F2"),
            Self::Gr => write!(f, "GR"),
            Self::Me => write!(f, "ME"),
            Self::Ml => write!(f, "ML"),
            Self::Un => write!(f, "UN"),
            Self::UnknownValue(s) => write!(f, "{s}"),
        }
    }
}

impl Default for MeasurementUnitCode {
    fn default() -> MeasurementUnitCode {
        Self::F2
    }
}