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 Ticker {
  #[serde(rename = "ticker")]
  ticker: String,  // AAPL 
  #[serde(rename = "name")]
  name: String,  // Apple Inc 
  #[serde(rename = "market")]
  market: String,  // STOCKS, INDICES, MF 
  #[serde(rename = "locale")]
  locale: String,  // G, US, GB, CA 
  #[serde(rename = "currency")]
  currency: Option<String>,  // USD, EUR, GBP 
  #[serde(rename = "active")]
  active: Option<bool>,  // false 
  #[serde(rename = "primaryExch")]
  primary_exch: Option<String>,  // NYE, FX, NGS 
  #[serde(rename = "codes")]
  codes: Option<TickerCodes>, 
  #[serde(rename = "url")]
  url: Option<String>,  // https://api.polygon.io/v1/meta/symbols/AAPL 
  #[serde(rename = "updated")]
  updated: String 
}

impl Ticker {
  pub fn new(ticker: String, name: String, market: String, locale: String, updated: String, ) -> Ticker {
    Ticker {
      ticker: ticker,
      name: name,
      market: market,
      locale: locale,
      currency: None,
      active: None,
      primary_exch: None,
      codes: None,
      url: None,
      updated: updated
    }
  }

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

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

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


  pub fn set_name(&mut self, name: String) {
    self.name = name;
  }

  pub fn with_name(mut self, name: String) -> Ticker {
    self.name = name;
    self
  }

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


  pub fn set_market(&mut self, market: String) {
    self.market = market;
  }

  pub fn with_market(mut self, market: String) -> Ticker {
    self.market = market;
    self
  }

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


  pub fn set_locale(&mut self, locale: String) {
    self.locale = locale;
  }

  pub fn with_locale(mut self, locale: String) -> Ticker {
    self.locale = locale;
    self
  }

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


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

  pub fn with_currency(mut self, currency: String) -> Ticker {
    self.currency = Some(currency);
    self
  }

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

  pub fn reset_currency(&mut self) {
    self.currency = None;
  }

  pub fn set_active(&mut self, active: bool) {
    self.active = Some(active);
  }

  pub fn with_active(mut self, active: bool) -> Ticker {
    self.active = Some(active);
    self
  }

  pub fn active(&self) -> Option<&bool> {
    self.active.as_ref()
  }

  pub fn reset_active(&mut self) {
    self.active = None;
  }

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

  pub fn with_primary_exch(mut self, primary_exch: String) -> Ticker {
    self.primary_exch = Some(primary_exch);
    self
  }

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

  pub fn reset_primary_exch(&mut self) {
    self.primary_exch = None;
  }

  pub fn set_codes(&mut self, codes: TickerCodes) {
    self.codes = Some(codes);
  }

  pub fn with_codes(mut self, codes: TickerCodes) -> Ticker {
    self.codes = Some(codes);
    self
  }

  pub fn codes(&self) -> Option<&TickerCodes> {
    self.codes.as_ref()
  }

  pub fn reset_codes(&mut self) {
    self.codes = None;
  }

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

  pub fn with_url(mut self, url: String) -> Ticker {
    self.url = Some(url);
    self
  }

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

  pub fn reset_url(&mut self) {
    self.url = None;
  }

  pub fn set_updated(&mut self, updated: String) {
    self.updated = updated;
  }

  pub fn with_updated(mut self, updated: String) -> Ticker {
    self.updated = updated;
    self
  }

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


}