use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderbookPartialDepthUpdate {
#[serde(rename = "updatedAtMillis")]
pub updated_at_millis: i64,
#[serde(rename = "symbol")]
pub symbol: String,
#[serde(rename = "bidsE9")]
pub bids_e9: Vec<Vec<String>>,
#[serde(rename = "asksE9")]
pub asks_e9: Vec<Vec<String>>,
#[serde(rename = "orderbookUpdateId")]
pub orderbook_update_id: i64,
#[serde(rename = "depthLevel")]
pub depth_level: DepthLevel,
}
impl OrderbookPartialDepthUpdate {
pub fn new(updated_at_millis: i64, symbol: String, bids_e9: Vec<Vec<String>>, asks_e9: Vec<Vec<String>>, orderbook_update_id: i64, depth_level: DepthLevel) -> OrderbookPartialDepthUpdate {
OrderbookPartialDepthUpdate {
updated_at_millis,
symbol,
bids_e9,
asks_e9,
orderbook_update_id,
depth_level,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DepthLevel {
#[serde(rename = "5")]
Variant5,
#[serde(rename = "10")]
Variant10,
#[serde(rename = "20")]
Variant20,
}
impl Default for DepthLevel {
fn default() -> DepthLevel {
Self::Variant5
}
}