Skip to main content

binance_sdk/alpha/rest_api/models/
ticker_response_data.rs

1/*
2 * Alpha Trading REST API
3 *
4 * APIs for Binance Alpha Trading.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 *
8 *
9 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10 * https://openapi-generator.tech
11 * Do not edit the class manually.
12 */
13
14#![allow(unused_imports)]
15use crate::alpha::rest_api::models;
16use serde::{Deserialize, Serialize};
17
18/// `TickerResponseData` : 24-hour rolling window ticker statistics.
19#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
20pub struct TickerResponseData {
21    /// Trading pair symbol.
22    #[serde(rename = "symbol", skip_serializing_if = "Option::is_none")]
23    pub symbol: Option<String>,
24    /// Absolute price change in the 24h window.
25    #[serde(rename = "priceChange", skip_serializing_if = "Option::is_none")]
26    pub price_change: Option<String>,
27    /// Percentage price change in the 24h window.
28    #[serde(rename = "priceChangePercent", skip_serializing_if = "Option::is_none")]
29    pub price_change_percent: Option<String>,
30    /// Weighted average price in the 24h window.
31    #[serde(rename = "weightedAvgPrice", skip_serializing_if = "Option::is_none")]
32    pub weighted_avg_price: Option<String>,
33    /// Latest traded price.
34    #[serde(rename = "lastPrice", skip_serializing_if = "Option::is_none")]
35    pub last_price: Option<String>,
36    /// Quantity of the latest trade.
37    #[serde(rename = "lastQty", skip_serializing_if = "Option::is_none")]
38    pub last_qty: Option<String>,
39    /// Opening price of the 24h window.
40    #[serde(rename = "openPrice", skip_serializing_if = "Option::is_none")]
41    pub open_price: Option<String>,
42    /// Highest price in the 24h window.
43    #[serde(rename = "highPrice", skip_serializing_if = "Option::is_none")]
44    pub high_price: Option<String>,
45    /// Lowest price in the 24h window.
46    #[serde(rename = "lowPrice", skip_serializing_if = "Option::is_none")]
47    pub low_price: Option<String>,
48    /// Base asset volume in the 24h window.
49    #[serde(rename = "volume", skip_serializing_if = "Option::is_none")]
50    pub volume: Option<String>,
51    /// Quote asset volume in the 24h window.
52    #[serde(rename = "quoteVolume", skip_serializing_if = "Option::is_none")]
53    pub quote_volume: Option<String>,
54    /// Start time of the 24h window (milliseconds).
55    #[serde(rename = "openTime", skip_serializing_if = "Option::is_none")]
56    pub open_time: Option<i64>,
57    /// End time of the 24h window (milliseconds).
58    #[serde(rename = "closeTime", skip_serializing_if = "Option::is_none")]
59    pub close_time: Option<i64>,
60    /// First trade ID in the 24h window.
61    #[serde(rename = "firstId", skip_serializing_if = "Option::is_none")]
62    pub first_id: Option<i64>,
63    /// Last trade ID in the 24h window.
64    #[serde(rename = "lastId", skip_serializing_if = "Option::is_none")]
65    pub last_id: Option<i64>,
66    /// Total number of trades in the 24h window.
67    #[serde(rename = "count", skip_serializing_if = "Option::is_none")]
68    pub count: Option<i64>,
69}
70
71impl TickerResponseData {
72    /// 24-hour rolling window ticker statistics.
73    #[must_use]
74    pub fn new() -> TickerResponseData {
75        TickerResponseData {
76            symbol: None,
77            price_change: None,
78            price_change_percent: None,
79            weighted_avg_price: None,
80            last_price: None,
81            last_qty: None,
82            open_price: None,
83            high_price: None,
84            low_price: None,
85            volume: None,
86            quote_volume: None,
87            open_time: None,
88            close_time: None,
89            first_id: None,
90            last_id: None,
91            count: None,
92        }
93    }
94}