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

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

/// TradeStreamMessageDataInner : Single trade object.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TradeStreamMessageDataInner {
    /// Unique identifier of the trade.
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// Trade price as a decimal string.
    #[serde(rename = "price")]
    pub price: String,
    /// Filled quantity as a decimal string.
    #[serde(rename = "filled")]
    pub filled: String,
    #[serde(rename = "takerSide")]
    pub taker_side: models::TakerSideEnum,
    /// Timestamp of when the trade was created (ms since Unix Epoch).
    #[serde(rename = "createdAt")]
    pub created_at: f64,
}

impl TradeStreamMessageDataInner {
    /// Single trade object.
    pub fn new(
        id: uuid::Uuid,
        price: String,
        filled: String,
        taker_side: models::TakerSideEnum,
        created_at: f64,
    ) -> TradeStreamMessageDataInner {
        TradeStreamMessageDataInner {
            id,
            price,
            filled,
            taker_side,
            created_at,
        }
    }
}
