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 LastTrade {
  #[serde(rename = "price")]
  price: f32,  // 159.59 
  #[serde(rename = "size")]
  size: i64,  // 20 
  #[serde(rename = "exchange")]
  exchange: i64,  // 11 
  #[serde(rename = "cond1")]
  cond1: Option<i64>,  // 14 
  #[serde(rename = "cond2")]
  cond2: Option<i64>,  // 16 
  #[serde(rename = "cond3")]
  cond3: Option<i64>,  // 0 
  #[serde(rename = "cond4")]
  cond4: Option<i64>,  // 0 
  #[serde(rename = "timestamp")]
  timestamp: i64  // 1518086464720 
}

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
  }


}