/*
 * 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, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum Bot {
    Sgsl(models::Sgsl),
    Ocq(models::Ocq),
    Levels(models::Levels),
    Grid(models::Grid),
    DHedge(models::DHedge),
    DFollow(models::DFollow),
}

impl Default for Bot {
    fn default() -> Self {
        Self::Sgsl(Default::default())
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "stopped")]
    Stopped,
}

impl Default for Status {
    fn default() -> Status {
        Self::Active
    }
}
/// The reason why the bot stopped executing.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StopReason {
    #[serde(rename = "client_cancel")]
    ClientCancel,
    #[serde(rename = "client_bulk_cancel")]
    ClientBulkCancel,
    #[serde(rename = "end_time")]
    EndTime,
    #[serde(rename = "instrument_deactivated")]
    InstrumentDeactivated,
    #[serde(rename = "margin_breach")]
    MarginBreach,
    #[serde(rename = "admin_cancel")]
    AdminCancel,
    #[serde(rename = "conflict")]
    Conflict,
    #[serde(rename = "strategy")]
    Strategy,
    #[serde(rename = "self_trade_prevention")]
    SelfTradePrevention,
}

impl Default for StopReason {
    fn default() -> StopReason {
        Self::ClientCancel
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Signal {
    #[serde(rename = "index")]
    Index,
    #[serde(rename = "mark")]
    Mark,
}

impl Default for Signal {
    fn default() -> Signal {
        Self::Index
    }
}
