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

/// MessageEnum : Extracted enum for MessageEnum
/// Extracted enum for MessageEnum
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MessageEnum {
    #[serde(rename = "AccountSuspended")]
    AccountSuspended,
    #[serde(rename = "DuplicateClientOrderId")]
    DuplicateClientOrderId,
    #[serde(rename = "ExchangeSuspended")]
    ExchangeSuspended,
    #[serde(rename = "InsufficientBalance")]
    InsufficientBalance,
    #[serde(rename = "InvalidBinaryData")]
    InvalidBinaryData,
    #[serde(rename = "InvalidExpireTime")]
    InvalidExpireTime,
    #[serde(rename = "InvalidGroupContingencyType")]
    InvalidGroupContingencyType,
    #[serde(rename = "InvalidNonceForSigner")]
    InvalidNonceForSigner,
    #[serde(rename = "InvalidSigner")]
    InvalidSigner,
    #[serde(rename = "InvalidSignerAddress")]
    InvalidSignerAddress,
    #[serde(rename = "InvalidTimeInForce")]
    InvalidTimeInForce,
    #[serde(rename = "LiquidationError")]
    LiquidationError,
    #[serde(rename = "MarginAccountBalanceZero")]
    MarginAccountBalanceZero,
    #[serde(rename = "NonceAlreadyUsed")]
    NonceAlreadyUsed,
    #[serde(rename = "PriceAboveMaximum")]
    PriceAboveMaximum,
    #[serde(rename = "PriceBelowMinimum")]
    PriceBelowMinimum,
    #[serde(rename = "RiskLimitExceeded")]
    RiskLimitExceeded,
    #[serde(rename = "TooManyOpenOrders")]
    TooManyOpenOrders,
    #[serde(rename = "TooManyPositions")]
    TooManyPositions,
    #[serde(rename = "TooManyStopOrders")]
    TooManyStopOrders,
    #[serde(rename = "InsuranceFundCannotOpenPositions")]
    InsuranceFundCannotOpenPositions,
    #[serde(rename = "InstrumentOpenValueCapExceeded")]
    InstrumentOpenValueCapExceeded,
    #[serde(rename = "QuantityAboveMaximum")]
    QuantityAboveMaximum,
    #[serde(rename = "QuantityNotMultipleOfLotSize")]
    QuantityNotMultipleOfLotSize,
    #[serde(rename = "OrderWithZeroQuantity")]
    OrderWithZeroQuantity,
}

impl std::fmt::Display for MessageEnum {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::AccountSuspended => write!(f, "AccountSuspended"),
            Self::DuplicateClientOrderId => write!(f, "DuplicateClientOrderId"),
            Self::ExchangeSuspended => write!(f, "ExchangeSuspended"),
            Self::InsufficientBalance => write!(f, "InsufficientBalance"),
            Self::InvalidBinaryData => write!(f, "InvalidBinaryData"),
            Self::InvalidExpireTime => write!(f, "InvalidExpireTime"),
            Self::InvalidGroupContingencyType => write!(f, "InvalidGroupContingencyType"),
            Self::InvalidNonceForSigner => write!(f, "InvalidNonceForSigner"),
            Self::InvalidSigner => write!(f, "InvalidSigner"),
            Self::InvalidSignerAddress => write!(f, "InvalidSignerAddress"),
            Self::InvalidTimeInForce => write!(f, "InvalidTimeInForce"),
            Self::LiquidationError => write!(f, "LiquidationError"),
            Self::MarginAccountBalanceZero => write!(f, "MarginAccountBalanceZero"),
            Self::NonceAlreadyUsed => write!(f, "NonceAlreadyUsed"),
            Self::PriceAboveMaximum => write!(f, "PriceAboveMaximum"),
            Self::PriceBelowMinimum => write!(f, "PriceBelowMinimum"),
            Self::RiskLimitExceeded => write!(f, "RiskLimitExceeded"),
            Self::TooManyOpenOrders => write!(f, "TooManyOpenOrders"),
            Self::TooManyPositions => write!(f, "TooManyPositions"),
            Self::TooManyStopOrders => write!(f, "TooManyStopOrders"),
            Self::InsuranceFundCannotOpenPositions => write!(f, "InsuranceFundCannotOpenPositions"),
            Self::InstrumentOpenValueCapExceeded => write!(f, "InstrumentOpenValueCapExceeded"),
            Self::QuantityAboveMaximum => write!(f, "QuantityAboveMaximum"),
            Self::QuantityNotMultipleOfLotSize => write!(f, "QuantityNotMultipleOfLotSize"),
            Self::OrderWithZeroQuantity => write!(f, "OrderWithZeroQuantity"),
        }
    }
}

impl Default for MessageEnum {
    fn default() -> MessageEnum {
        Self::AccountSuspended
    }
}
