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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DryRunOrderFailedUnprocessableEntityDto {
    #[serde(rename = "statusCode")]
    pub status_code: StatusCode,
    /// Code indicating the reason for failure
    #[serde(rename = "message")]
    pub message: Message,
    #[serde(rename = "error")]
    pub error: Error,
    /// Details of the failed dry run
    #[serde(rename = "data")]
    pub data: models::DryRunOrderFailedDto,
}

impl DryRunOrderFailedUnprocessableEntityDto {
    pub fn new(
        status_code: StatusCode,
        message: Message,
        error: Error,
        data: models::DryRunOrderFailedDto,
    ) -> DryRunOrderFailedUnprocessableEntityDto {
        DryRunOrderFailedUnprocessableEntityDto {
            status_code,
            message,
            error,
            data,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StatusCode {
    #[serde(rename = "422")]
    Variant422,
}

impl Default for StatusCode {
    fn default() -> StatusCode {
        Self::Variant422
    }
}
/// Code indicating the reason for failure
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Message {
    #[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,
}

impl Default for Message {
    fn default() -> Message {
        Self::AccountSuspended
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Error {
    #[serde(rename = "Unprocessable Entity")]
    UnprocessableEntity,
}

impl Default for Error {
    fn default() -> Error {
        Self::UnprocessableEntity
    }
}
