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

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TickerMessageData {
    /// Market symbol, e.g. BTCUSD, ETHUSD.
    #[serde(rename = "s")]
    pub s: String,
    /// Timestamp in milliseconds for this ticker update.
    #[serde(rename = "t")]
    pub t: i64,
    /// Best bid price.
    #[serde(rename = "bidPx", skip_serializing_if = "Option::is_none")]
    pub bid_px: Option<rust_decimal::Decimal>,
    /// Best ask price.
    #[serde(rename = "askPx", skip_serializing_if = "Option::is_none")]
    pub ask_px: Option<rust_decimal::Decimal>,
    /// Best bid quantity.
    #[serde(rename = "bidAmt", skip_serializing_if = "Option::is_none")]
    pub bid_amt: Option<rust_decimal::Decimal>,
    /// Best ask quantity.
    #[serde(rename = "askAmt", skip_serializing_if = "Option::is_none")]
    pub ask_amt: Option<rust_decimal::Decimal>,
    /// Mark price.
    #[serde(rename = "markPx", skip_serializing_if = "Option::is_none")]
    pub mark_px: Option<rust_decimal::Decimal>,
    /// Mark price 24 hours ago.
    #[serde(rename = "markPx24h", skip_serializing_if = "Option::is_none")]
    pub mark_px24h: Option<rust_decimal::Decimal>,
    /// Open interest.
    #[serde(rename = "oi", skip_serializing_if = "Option::is_none")]
    pub oi: Option<rust_decimal::Decimal>,
    /// Funding rate for 1 hour.
    #[serde(rename = "fr1h", skip_serializing_if = "Option::is_none")]
    pub fr1h: Option<rust_decimal::Decimal>,
    /// 24 hour volume.
    #[serde(rename = "vol24h", skip_serializing_if = "Option::is_none")]
    pub vol24h: Option<rust_decimal::Decimal>,
}

impl TickerMessageData {
    pub fn new(s: String, t: i64) -> TickerMessageData {
        TickerMessageData {
            s,
            t,
            bid_px: None,
            ask_px: None,
            bid_amt: None,
            ask_amt: None,
            mark_px: None,
            mark_px24h: None,
            oi: None,
            fr1h: None,
            vol24h: None,
        }
    }
}
