bluefin_api 1.8.0

Bluefin API
Documentation
/*
 * Bluefin API
 *
 * Bluefin API
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// CandlestickUpdate : Represents a candlestick for a specific market and interval.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CandlestickUpdate {
    /// The symbol of the market for this candlestick.
    #[serde(rename = "symbol")]
    pub symbol: String,
    /// The start time of the candlestick in milliseconds since epoch.
    #[serde(rename = "startTime")]
    pub start_time: i64,
    /// The end time of the candlestick in milliseconds since epoch.
    #[serde(rename = "endTime")]
    pub end_time: i64,
    /// The interval of the candlestick (e.g., 1m, 5m, 1h).
    #[serde(rename = "interval")]
    pub interval: String,
    /// The opening price of the candlestick.
    #[serde(rename = "openPriceE9")]
    pub open_price_e9: String,
    /// The closing price of the candlestick.
    #[serde(rename = "closePriceE9")]
    pub close_price_e9: String,
    /// The highest price during the candlestick interval.
    #[serde(rename = "highPriceE9")]
    pub high_price_e9: String,
    /// The lowest price during the candlestick interval.
    #[serde(rename = "lowPriceE9")]
    pub low_price_e9: String,
    /// The total trading volume during the candlestick interval.
    #[serde(rename = "volumeE9")]
    pub volume_e9: String,
    /// The total quote volume traded during the candlestick interval.
    #[serde(rename = "quoteVolumeE9")]
    pub quote_volume_e9: String,
    /// The number of trades that occurred during the candlestick interval.
    #[serde(rename = "numTrades")]
    pub num_trades: i64,
}

impl CandlestickUpdate {
    /// Represents a candlestick for a specific market and interval.
    pub fn new(symbol: String, start_time: i64, end_time: i64, interval: String, open_price_e9: String, close_price_e9: String, high_price_e9: String, low_price_e9: String, volume_e9: String, quote_volume_e9: String, num_trades: i64) -> CandlestickUpdate {
        CandlestickUpdate {
            symbol,
            start_time,
            end_time,
            interval,
            open_price_e9,
            close_price_e9,
            high_price_e9,
            low_price_e9,
            volume_e9,
            quote_volume_e9,
            num_trades,
        }
    }
}