/*
 * 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, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SubmitOrderDtoData {
    SubmitOrderMarketDtoData(models::SubmitOrderMarketDtoData),
    SubmitOrderLimitDtoData(models::SubmitOrderLimitDtoData),
}

impl Default for SubmitOrderDtoData {
    fn default() -> Self {
        Self::SubmitOrderMarketDtoData(Default::default())
    }
}
/// Stop type, either 0 (take-profit) or 1 (stop-loss), requires non-zero stopPrice
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StopType {
    #[serde(rename = "0")]
    GAIN,
    #[serde(rename = "1")]
    LOSS,
}

impl Default for StopType {
    fn default() -> StopType {
        Self::GAIN
    }
}
/// Contingency type for order groups: OTO (Order-Triggers-Order) or OCO (One-Cancels-Other)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum GroupContingencyType {
    #[serde(rename = "0")]
    OTO,
    #[serde(rename = "1")]
    OCO,
}

impl Default for GroupContingencyType {
    fn default() -> GroupContingencyType {
        Self::OTO
    }
}
/// How long an order will remain until executed/expired
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TimeInForce {
    #[serde(rename = "GTD")]
    Gtd,
    #[serde(rename = "IOC")]
    Ioc,
    #[serde(rename = "FOK")]
    Fok,
}

impl Default for TimeInForce {
    fn default() -> TimeInForce {
        Self::Gtd
    }
}
