pt/models/
last_quote.rs

1/* 
2 * Polygon API
3 *
4 * The future of fintech.
5 *
6 * OpenAPI spec version: 1.0.1
7 * 
8 * Generated by: https://github.com/swagger-api/swagger-codegen.git
9 */
10#![allow(unused_imports)]
11
12use serde_json::Value;
13use bigdecimal::BigDecimal;
14use chrono::{NaiveDateTime, DateTime, FixedOffset, Utc};
15
16use crate::models::*;
17//use crate::date_serializer;
18//use crate::datetime_serializer;
19
20#[derive(Debug, Serialize, Deserialize, Clone)]
21pub struct LastQuote {
22  #[serde(rename = "askprice")]
23  askprice: f32,  // 159.59 
24  #[serde(rename = "asksize")]
25  asksize: i64,  // 2 
26  #[serde(rename = "askexchange")]
27  askexchange: i64,  // 11 
28  #[serde(rename = "bidprice")]
29  bidprice: f32,  // 159.45 
30  #[serde(rename = "bidsize")]
31  bidsize: i64,  // 20 
32  #[serde(rename = "bidexchange")]
33  bidexchange: i64,  // 12 
34  #[serde(rename = "timestamp")]
35  timestamp: i64  // 1518086601843 
36}
37
38impl LastQuote {
39  pub fn new(askprice: f32, asksize: i64, askexchange: i64, bidprice: f32, bidsize: i64, bidexchange: i64, timestamp: i64, ) -> LastQuote {
40    LastQuote {
41      askprice: askprice,
42      asksize: asksize,
43      askexchange: askexchange,
44      bidprice: bidprice,
45      bidsize: bidsize,
46      bidexchange: bidexchange,
47      timestamp: timestamp
48    }
49  }
50
51  pub fn set_askprice(&mut self, askprice: f32) {
52    self.askprice = askprice;
53  }
54
55  pub fn with_askprice(mut self, askprice: f32) -> LastQuote {
56    self.askprice = askprice;
57    self
58  }
59
60  pub fn askprice(&self) -> &f32 {
61    &self.askprice
62  }
63
64
65  pub fn set_asksize(&mut self, asksize: i64) {
66    self.asksize = asksize;
67  }
68
69  pub fn with_asksize(mut self, asksize: i64) -> LastQuote {
70    self.asksize = asksize;
71    self
72  }
73
74  pub fn asksize(&self) -> &i64 {
75    &self.asksize
76  }
77
78
79  pub fn set_askexchange(&mut self, askexchange: i64) {
80    self.askexchange = askexchange;
81  }
82
83  pub fn with_askexchange(mut self, askexchange: i64) -> LastQuote {
84    self.askexchange = askexchange;
85    self
86  }
87
88  pub fn askexchange(&self) -> &i64 {
89    &self.askexchange
90  }
91
92
93  pub fn set_bidprice(&mut self, bidprice: f32) {
94    self.bidprice = bidprice;
95  }
96
97  pub fn with_bidprice(mut self, bidprice: f32) -> LastQuote {
98    self.bidprice = bidprice;
99    self
100  }
101
102  pub fn bidprice(&self) -> &f32 {
103    &self.bidprice
104  }
105
106
107  pub fn set_bidsize(&mut self, bidsize: i64) {
108    self.bidsize = bidsize;
109  }
110
111  pub fn with_bidsize(mut self, bidsize: i64) -> LastQuote {
112    self.bidsize = bidsize;
113    self
114  }
115
116  pub fn bidsize(&self) -> &i64 {
117    &self.bidsize
118  }
119
120
121  pub fn set_bidexchange(&mut self, bidexchange: i64) {
122    self.bidexchange = bidexchange;
123  }
124
125  pub fn with_bidexchange(mut self, bidexchange: i64) -> LastQuote {
126    self.bidexchange = bidexchange;
127    self
128  }
129
130  pub fn bidexchange(&self) -> &i64 {
131    &self.bidexchange
132  }
133
134
135  pub fn set_timestamp(&mut self, timestamp: i64) {
136    self.timestamp = timestamp;
137  }
138
139  pub fn with_timestamp(mut self, timestamp: i64) -> LastQuote {
140    self.timestamp = timestamp;
141    self
142  }
143
144  pub fn timestamp(&self) -> &i64 {
145    &self.timestamp
146  }
147
148
149}
150
151