/*
 * Websocket Subscription Schemas
 *
 * Schema definitions Websocket API subscriptions for Thalex exchange.
 *
 * 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)]
pub enum OrderHistoryDeleteReasonEnum {
    #[serde(rename = "client_cancel")]
    ClientCancel,
    #[serde(rename = "client_bulk_cancel")]
    ClientBulkCancel,
    #[serde(rename = "session_end")]
    SessionEnd,
    #[serde(rename = "instrument_deactivated")]
    InstrumentDeactivated,
    #[serde(rename = "mm_protection")]
    MmProtection,
    #[serde(rename = "failover")]
    Failover,
    #[serde(rename = "margin_breach")]
    MarginBreach,
    #[serde(rename = "filled")]
    Filled,
    #[serde(rename = "immediate_cancel")]
    ImmediateCancel,
    #[serde(rename = "admin_cancel")]
    AdminCancel,
    #[serde(rename = "replaced")]
    Replaced,
    #[serde(rename = "self_trade_prevention")]
    SelfTradePrevention,
}

impl std::fmt::Display for OrderHistoryDeleteReasonEnum {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::ClientCancel => write!(f, "client_cancel"),
            Self::ClientBulkCancel => write!(f, "client_bulk_cancel"),
            Self::SessionEnd => write!(f, "session_end"),
            Self::InstrumentDeactivated => write!(f, "instrument_deactivated"),
            Self::MmProtection => write!(f, "mm_protection"),
            Self::Failover => write!(f, "failover"),
            Self::MarginBreach => write!(f, "margin_breach"),
            Self::Filled => write!(f, "filled"),
            Self::ImmediateCancel => write!(f, "immediate_cancel"),
            Self::AdminCancel => write!(f, "admin_cancel"),
            Self::Replaced => write!(f, "replaced"),
            Self::SelfTradePrevention => write!(f, "self_trade_prevention"),
        }
    }
}

impl Default for OrderHistoryDeleteReasonEnum {
    fn default() -> OrderHistoryDeleteReasonEnum {
        Self::ClientCancel
    }
}
