#![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 CryptoTick {
#[serde(rename = "price")]
price: f32, #[serde(rename = "size")]
size: f32, #[serde(rename = "exchange")]
exchange: i64, #[serde(rename = "conditions")]
conditions: Vec<i64>, #[serde(rename = "timestamp")]
timestamp: i64 }
impl CryptoTick {
pub fn new(price: f32, size: f32, exchange: i64, conditions: Vec<i64>, timestamp: i64, ) -> CryptoTick {
CryptoTick {
price: price,
size: size,
exchange: exchange,
conditions: conditions,
timestamp: timestamp
}
}
pub fn set_price(&mut self, price: f32) {
self.price = price;
}
pub fn with_price(mut self, price: f32) -> CryptoTick {
self.price = price;
self
}
pub fn price(&self) -> &f32 {
&self.price
}
pub fn set_size(&mut self, size: f32) {
self.size = size;
}
pub fn with_size(mut self, size: f32) -> CryptoTick {
self.size = size;
self
}
pub fn size(&self) -> &f32 {
&self.size
}
pub fn set_exchange(&mut self, exchange: i64) {
self.exchange = exchange;
}
pub fn with_exchange(mut self, exchange: i64) -> CryptoTick {
self.exchange = exchange;
self
}
pub fn exchange(&self) -> &i64 {
&self.exchange
}
pub fn set_conditions(&mut self, conditions: Vec<i64>) {
self.conditions = conditions;
}
pub fn with_conditions(mut self, conditions: Vec<i64>) -> CryptoTick {
self.conditions = conditions;
self
}
pub fn conditions(&self) -> &Vec<i64> {
&self.conditions
}
pub fn set_timestamp(&mut self, timestamp: i64) {
self.timestamp = timestamp;
}
pub fn with_timestamp(mut self, timestamp: i64) -> CryptoTick {
self.timestamp = timestamp;
self
}
pub fn timestamp(&self) -> &i64 {
&self.timestamp
}
}