Skip to main content

bluefin_api/models/
market_price_update.rs

1/*
2 * Bluefin API
3 *
4 * Bluefin API
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct MarketPriceUpdate {
16    /// The symbol of the market.
17    #[serde(rename = "symbol")]
18    pub symbol: String,
19    /// The price in scientific notation with 9 decimal places of precision.
20    #[serde(rename = "priceE9")]
21    pub price_e9: String,
22    #[serde(rename = "source")]
23    pub source: Source,
24    /// The timestamp of the price update.
25    #[serde(rename = "updatedAtMillis")]
26    pub updated_at_millis: i64,
27}
28
29impl MarketPriceUpdate {
30    pub fn new(symbol: String, price_e9: String, source: Source, updated_at_millis: i64) -> MarketPriceUpdate {
31        MarketPriceUpdate {
32            symbol,
33            price_e9,
34            source,
35            updated_at_millis,
36        }
37    }
38}
39/// 
40#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
41pub enum Source {
42    #[serde(rename = "Market")]
43    Market,
44}
45
46impl Default for Source {
47    fn default() -> Source {
48        Self::Market
49    }
50}
51