pt 1.0.3

A client for polygon.io, a financial data platform for stocks, forex and crypto.
Documentation
/* 
 * Polygon API
 *
 * The future of fintech.
 *
 * OpenAPI spec version: 1.0.1
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */
#![allow(unused_imports)]

use serde_json::Value;
use bigdecimal::BigDecimal;
use chrono::{NaiveDateTime, DateTime, FixedOffset, Utc};

use crate::models::*;
//use crate::date_serializer;
//use crate::datetime_serializer;

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CryptoTick {
  #[serde(rename = "price")]
  price: f32,  // 9349.44 
  #[serde(rename = "size")]
  size: f32,  // 0.03 
  #[serde(rename = "exchange")]
  exchange: i64,  // 2 
  #[serde(rename = "conditions")]
  conditions: Vec<i64>,  // [2,0] 
  #[serde(rename = "timestamp")]
  timestamp: i64  // 1525930460102 
}

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
  }


}