#![allow(unused_imports)]
use serde_json::Value;
use bigdecimal::BigDecimal;
use chrono::{NaiveDateTime, DateTime, FixedOffset, Utc};
use crate::models::*;
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct LastTrade {
#[serde(rename = "price")]
price: f32, #[serde(rename = "size")]
size: i64, #[serde(rename = "exchange")]
exchange: i64, #[serde(rename = "cond1")]
cond1: Option<i64>, #[serde(rename = "cond2")]
cond2: Option<i64>, #[serde(rename = "cond3")]
cond3: Option<i64>, #[serde(rename = "cond4")]
cond4: Option<i64>, #[serde(rename = "timestamp")]
timestamp: i64 }
impl LastTrade {
pub fn new(price: f32, size: i64, exchange: i64, timestamp: i64, ) -> LastTrade {
LastTrade {
price: price,
size: size,
exchange: exchange,
cond1: None,
cond2: None,
cond3: None,
cond4: None,
timestamp: timestamp
}
}
pub fn set_price(&mut self, price: f32) {
self.price = price;
}
pub fn with_price(mut self, price: f32) -> LastTrade {
self.price = price;
self
}
pub fn price(&self) -> &f32 {
&self.price
}
pub fn set_size(&mut self, size: i64) {
self.size = size;
}
pub fn with_size(mut self, size: i64) -> LastTrade {
self.size = size;
self
}
pub fn size(&self) -> &i64 {
&self.size
}
pub fn set_exchange(&mut self, exchange: i64) {
self.exchange = exchange;
}
pub fn with_exchange(mut self, exchange: i64) -> LastTrade {
self.exchange = exchange;
self
}
pub fn exchange(&self) -> &i64 {
&self.exchange
}
pub fn set_cond1(&mut self, cond1: i64) {
self.cond1 = Some(cond1);
}
pub fn with_cond1(mut self, cond1: i64) -> LastTrade {
self.cond1 = Some(cond1);
self
}
pub fn cond1(&self) -> Option<&i64> {
self.cond1.as_ref()
}
pub fn reset_cond1(&mut self) {
self.cond1 = None;
}
pub fn set_cond2(&mut self, cond2: i64) {
self.cond2 = Some(cond2);
}
pub fn with_cond2(mut self, cond2: i64) -> LastTrade {
self.cond2 = Some(cond2);
self
}
pub fn cond2(&self) -> Option<&i64> {
self.cond2.as_ref()
}
pub fn reset_cond2(&mut self) {
self.cond2 = None;
}
pub fn set_cond3(&mut self, cond3: i64) {
self.cond3 = Some(cond3);
}
pub fn with_cond3(mut self, cond3: i64) -> LastTrade {
self.cond3 = Some(cond3);
self
}
pub fn cond3(&self) -> Option<&i64> {
self.cond3.as_ref()
}
pub fn reset_cond3(&mut self) {
self.cond3 = None;
}
pub fn set_cond4(&mut self, cond4: i64) {
self.cond4 = Some(cond4);
}
pub fn with_cond4(mut self, cond4: i64) -> LastTrade {
self.cond4 = Some(cond4);
self
}
pub fn cond4(&self) -> Option<&i64> {
self.cond4.as_ref()
}
pub fn reset_cond4(&mut self) {
self.cond4 = None;
}
pub fn set_timestamp(&mut self, timestamp: i64) {
self.timestamp = timestamp;
}
pub fn with_timestamp(mut self, timestamp: i64) -> LastTrade {
self.timestamp = timestamp;
self
}
pub fn timestamp(&self) -> &i64 {
&self.timestamp
}
}