/*
 * 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 TooManyRequestsDto {
    #[serde(rename = "statusCode")]
    pub status_code: StatusCode,
    #[serde(rename = "message")]
    pub message: String,
    #[serde(rename = "error")]
    pub error: Error,
    /// Specific rate limit type that was exceeded
    #[serde(rename = "type")]
    pub r#type: Type,
}

impl TooManyRequestsDto {
    pub fn new(
        status_code: StatusCode,
        message: String,
        error: Error,
        r#type: Type,
    ) -> TooManyRequestsDto {
        TooManyRequestsDto {
            status_code,
            message,
            error,
            r#type,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StatusCode {
    #[serde(rename = "429")]
    Variant429,
}

impl Default for StatusCode {
    fn default() -> StatusCode {
        Self::Variant429
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Error {
    #[serde(rename = "Too Many Requests")]
    TooManyRequests,
}

impl Default for Error {
    fn default() -> Error {
        Self::TooManyRequests
    }
}
/// Specific rate limit type that was exceeded
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "RATE_LIMIT_IP")]
    RateLimitIp,
    #[serde(rename = "RATE_LIMIT_ACCOUNT")]
    RateLimitAccount,
    #[serde(rename = "RATE_LIMIT_WITHDRAW")]
    RateLimitWithdraw,
    #[serde(rename = "RATE_LIMIT_LINKED_SIGNER")]
    RateLimitLinkedSigner,
}

impl Default for Type {
    fn default() -> Type {
        Self::RateLimitIp
    }
}
