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