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)]
/// Split : Symbol split

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 Split {
  #[serde(rename = "ticker")]
  ticker: String,  // AAPL 
  #[serde(rename = "exDate")]
  ex_date: String,  // 1999-03-28 
  #[serde(rename = "paymentDate")]
  payment_date: String,  // 1999-03-28 
  #[serde(rename = "recordDate")]
  record_date: Option<String>,  // 1999-03-28 
  #[serde(rename = "declaredDate")]
  declared_date: Option<String>,  // 1999-03-28 
  #[serde(rename = "ratio")]
  ratio: f32,  // 0.142857 
  #[serde(rename = "tofactor")]
  tofactor: Option<i64>,  // 7 
  #[serde(rename = "forfactor")]
  forfactor: Option<i64>  // 1 
}

impl Split {
  pub fn new(ticker: String, ex_date: String, payment_date: String, ratio: f32, ) -> Split {
    Split {
      ticker: ticker,
      ex_date: ex_date,
      payment_date: payment_date,
      record_date: None,
      declared_date: None,
      ratio: ratio,
      tofactor: None,
      forfactor: None
    }
  }

  pub fn set_ticker(&mut self, ticker: String) {
    self.ticker = ticker;
  }

  pub fn with_ticker(mut self, ticker: String) -> Split {
    self.ticker = ticker;
    self
  }

  pub fn ticker(&self) -> &String {
    &self.ticker
  }


  pub fn set_ex_date(&mut self, ex_date: String) {
    self.ex_date = ex_date;
  }

  pub fn with_ex_date(mut self, ex_date: String) -> Split {
    self.ex_date = ex_date;
    self
  }

  pub fn ex_date(&self) -> &String {
    &self.ex_date
  }


  pub fn set_payment_date(&mut self, payment_date: String) {
    self.payment_date = payment_date;
  }

  pub fn with_payment_date(mut self, payment_date: String) -> Split {
    self.payment_date = payment_date;
    self
  }

  pub fn payment_date(&self) -> &String {
    &self.payment_date
  }


  pub fn set_record_date(&mut self, record_date: String) {
    self.record_date = Some(record_date);
  }

  pub fn with_record_date(mut self, record_date: String) -> Split {
    self.record_date = Some(record_date);
    self
  }

  pub fn record_date(&self) -> Option<&String> {
    self.record_date.as_ref()
  }

  pub fn reset_record_date(&mut self) {
    self.record_date = None;
  }

  pub fn set_declared_date(&mut self, declared_date: String) {
    self.declared_date = Some(declared_date);
  }

  pub fn with_declared_date(mut self, declared_date: String) -> Split {
    self.declared_date = Some(declared_date);
    self
  }

  pub fn declared_date(&self) -> Option<&String> {
    self.declared_date.as_ref()
  }

  pub fn reset_declared_date(&mut self) {
    self.declared_date = None;
  }

  pub fn set_ratio(&mut self, ratio: f32) {
    self.ratio = ratio;
  }

  pub fn with_ratio(mut self, ratio: f32) -> Split {
    self.ratio = ratio;
    self
  }

  pub fn ratio(&self) -> &f32 {
    &self.ratio
  }


  pub fn set_tofactor(&mut self, tofactor: i64) {
    self.tofactor = Some(tofactor);
  }

  pub fn with_tofactor(mut self, tofactor: i64) -> Split {
    self.tofactor = Some(tofactor);
    self
  }

  pub fn tofactor(&self) -> Option<&i64> {
    self.tofactor.as_ref()
  }

  pub fn reset_tofactor(&mut self) {
    self.tofactor = None;
  }

  pub fn set_forfactor(&mut self, forfactor: i64) {
    self.forfactor = Some(forfactor);
  }

  pub fn with_forfactor(mut self, forfactor: i64) -> Split {
    self.forfactor = Some(forfactor);
    self
  }

  pub fn forfactor(&self) -> Option<&i64> {
    self.forfactor.as_ref()
  }

  pub fn reset_forfactor(&mut self) {
    self.forfactor = None;
  }

}