/*
 * Ethereal Exchange API
 *
 * Ethereal HTTP API for real-time trading, order management, and market data access.
 *
 * The version of the OpenAPI document: 0.1.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

/// OrderStatus : Extracted enum for OrderStatus
/// Extracted enum for OrderStatus
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum OrderStatus {
    #[serde(rename = "NEW")]
    New,
    #[serde(rename = "PENDING")]
    Pending,
    #[serde(rename = "FILLED_PARTIAL")]
    FilledPartial,
    #[serde(rename = "FILLED")]
    Filled,
    #[serde(rename = "REJECTED")]
    Rejected,
    #[serde(rename = "CANCELED")]
    Canceled,
    #[serde(rename = "EXPIRED")]
    Expired,
}

impl std::fmt::Display for OrderStatus {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::New => write!(f, "NEW"),
            Self::Pending => write!(f, "PENDING"),
            Self::FilledPartial => write!(f, "FILLED_PARTIAL"),
            Self::Filled => write!(f, "FILLED"),
            Self::Rejected => write!(f, "REJECTED"),
            Self::Canceled => write!(f, "CANCELED"),
            Self::Expired => write!(f, "EXPIRED"),
        }
    }
}

impl Default for OrderStatus {
    fn default() -> OrderStatus {
        Self::New
    }
}
