/*
 * OpenAPI
 *
 * OpenAPI
 *
 * The version of the OpenAPI document: 0.0.1
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// TradeFillMessage : Server-to-client TradeFill event message containing recent trades for a symbol.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TradeFillMessage {
    /// Event type.
    #[serde(rename = "e")]
    pub e: E,
    /// System timestamp in milliseconds when this message was emitted.
    #[serde(rename = "t")]
    pub t: i64,
    #[serde(rename = "data")]
    pub data: models::TradeFillMessageData,
}

impl TradeFillMessage {
    /// Server-to-client TradeFill event message containing recent trades for a symbol.
    pub fn new(e: E, t: i64, data: models::TradeFillMessageData) -> TradeFillMessage {
        TradeFillMessage { e, t, data }
    }
}
/// Event type.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum E {
    #[serde(rename = "TradeFill")]
    TradeFill,
}

impl Default for E {
    fn default() -> E {
        Self::TradeFill
    }
}
