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

/// Delay : Minimum interval between feeds
/// Minimum interval between feeds
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Delay {
    #[serde(rename = "100ms")]
    Variant100ms,
    #[serde(rename = "200ms")]
    Variant200ms,
    #[serde(rename = "500ms")]
    Variant500ms,
    #[serde(rename = "1000ms")]
    Variant1000ms,
    #[serde(rename = "5000ms")]
    Variant5000ms,
    #[serde(rename = "60000ms")]
    Variant60000ms,
    #[serde(rename = "raw")]
    Raw,
}

impl std::fmt::Display for Delay {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Variant100ms => write!(f, "100ms"),
            Self::Variant200ms => write!(f, "200ms"),
            Self::Variant500ms => write!(f, "500ms"),
            Self::Variant1000ms => write!(f, "1000ms"),
            Self::Variant5000ms => write!(f, "5000ms"),
            Self::Variant60000ms => write!(f, "60000ms"),
            Self::Raw => write!(f, "raw"),
        }
    }
}

impl Default for Delay {
    fn default() -> Delay {
        Self::Variant100ms
    }
}
