/*
 * 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};

/// PositionFillDtoOrderType : Extracted enum for PositionFillDtoOrderType
/// Extracted enum for PositionFillDtoOrderType
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PositionFillDtoOrderType {
    #[serde(rename = "MARKET")]
    Market,
    #[serde(rename = "LIMIT")]
    Limit,
    #[serde(rename = "REALIZED_PNL")]
    RealizedPnl,
    #[serde(rename = "LIQUIDATION")]
    Liquidation,
    #[serde(rename = "REALIZED_FUNDING")]
    RealizedFunding,
}

impl std::fmt::Display for PositionFillDtoOrderType {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Market => write!(f, "MARKET"),
            Self::Limit => write!(f, "LIMIT"),
            Self::RealizedPnl => write!(f, "REALIZED_PNL"),
            Self::Liquidation => write!(f, "LIQUIDATION"),
            Self::RealizedFunding => write!(f, "REALIZED_FUNDING"),
        }
    }
}

impl Default for PositionFillDtoOrderType {
    fn default() -> PositionFillDtoOrderType {
        Self::Market
    }
}
