1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
/* 
 * Client Portal Web API
 *
 * Client Poral Web API
 *
 * OpenAPI spec version: 1.0.0
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

/// SecdefInfo : Contains some basic info of contract

#[allow(unused_imports)]
use serde_json::Value;

#[derive(Debug, Serialize, Deserialize)]
pub struct SecdefInfo {
  #[serde(rename = "conid")]
  conid: Option<f32>,
  /// Annual interest rate paid on a bond
  #[serde(rename = "coupon")]
  coupon: Option<String>,
  /// Currency the contract trades in
  #[serde(rename = "currency")]
  currency: Option<String>,
  /// Committee on Uniform Securities Identification Procedures number
  #[serde(rename = "cusip")]
  cusip: Option<String>,
  /// Formatted symbol
  #[serde(rename = "desc1")]
  desc1: Option<String>,
  /// Formatted expiration, strike and right
  #[serde(rename = "desc2")]
  desc2: Option<String>,
  #[serde(rename = "exchange")]
  exchange: Option<String>,
  #[serde(rename = "listingExchange")]
  listing_exchange: Option<String>,
  /// Format YYYYMMDD, the date on which the underlying transaction settles if the option is exercised
  #[serde(rename = "maturityDate")]
  maturity_date: Option<String>,
  /// total premium paid or received for an option contract
  #[serde(rename = "multiplier")]
  multiplier: Option<String>,
  /// C = Call Option, P = Put Option
  #[serde(rename = "right")]
  right: Option<String>,
  #[serde(rename = "secType")]
  sec_type: Option<String>,
  /// The strike price also known as exercise price
  #[serde(rename = "strike")]
  strike: Option<String>,
  /// Underlying symbol
  #[serde(rename = "symbol")]
  symbol: Option<String>,
  #[serde(rename = "tradingClass")]
  trading_class: Option<String>,
  #[serde(rename = "validExchanges")]
  valid_exchanges: Option<String>
}

impl SecdefInfo {
  /// Contains some basic info of contract
  pub fn new() -> SecdefInfo {
    SecdefInfo {
      conid: None,
      coupon: None,
      currency: None,
      cusip: None,
      desc1: None,
      desc2: None,
      exchange: None,
      listing_exchange: None,
      maturity_date: None,
      multiplier: None,
      right: None,
      sec_type: None,
      strike: None,
      symbol: None,
      trading_class: None,
      valid_exchanges: None
    }
  }

  pub fn set_conid(&mut self, conid: f32) {
    self.conid = Some(conid);
  }

  pub fn with_conid(mut self, conid: f32) -> SecdefInfo {
    self.conid = Some(conid);
    self
  }

  pub fn conid(&self) -> Option<&f32> {
    self.conid.as_ref()
  }

  pub fn reset_conid(&mut self) {
    self.conid = None;
  }

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

  pub fn with_coupon(mut self, coupon: String) -> SecdefInfo {
    self.coupon = Some(coupon);
    self
  }

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

  pub fn reset_coupon(&mut self) {
    self.coupon = None;
  }

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

  pub fn with_currency(mut self, currency: String) -> SecdefInfo {
    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_cusip(&mut self, cusip: String) {
    self.cusip = Some(cusip);
  }

  pub fn with_cusip(mut self, cusip: String) -> SecdefInfo {
    self.cusip = Some(cusip);
    self
  }

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

  pub fn reset_cusip(&mut self) {
    self.cusip = None;
  }

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

  pub fn with_desc1(mut self, desc1: String) -> SecdefInfo {
    self.desc1 = Some(desc1);
    self
  }

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

  pub fn reset_desc1(&mut self) {
    self.desc1 = None;
  }

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

  pub fn with_desc2(mut self, desc2: String) -> SecdefInfo {
    self.desc2 = Some(desc2);
    self
  }

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

  pub fn reset_desc2(&mut self) {
    self.desc2 = None;
  }

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

  pub fn with_exchange(mut self, exchange: String) -> SecdefInfo {
    self.exchange = Some(exchange);
    self
  }

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

  pub fn reset_exchange(&mut self) {
    self.exchange = None;
  }

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

  pub fn with_listing_exchange(mut self, listing_exchange: String) -> SecdefInfo {
    self.listing_exchange = Some(listing_exchange);
    self
  }

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

  pub fn reset_listing_exchange(&mut self) {
    self.listing_exchange = None;
  }

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

  pub fn with_maturity_date(mut self, maturity_date: String) -> SecdefInfo {
    self.maturity_date = Some(maturity_date);
    self
  }

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

  pub fn reset_maturity_date(&mut self) {
    self.maturity_date = None;
  }

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

  pub fn with_multiplier(mut self, multiplier: String) -> SecdefInfo {
    self.multiplier = Some(multiplier);
    self
  }

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

  pub fn reset_multiplier(&mut self) {
    self.multiplier = None;
  }

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

  pub fn with_right(mut self, right: String) -> SecdefInfo {
    self.right = Some(right);
    self
  }

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

  pub fn reset_right(&mut self) {
    self.right = None;
  }

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

  pub fn with_sec_type(mut self, sec_type: String) -> SecdefInfo {
    self.sec_type = Some(sec_type);
    self
  }

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

  pub fn reset_sec_type(&mut self) {
    self.sec_type = None;
  }

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

  pub fn with_strike(mut self, strike: String) -> SecdefInfo {
    self.strike = Some(strike);
    self
  }

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

  pub fn reset_strike(&mut self) {
    self.strike = None;
  }

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

  pub fn with_symbol(mut self, symbol: String) -> SecdefInfo {
    self.symbol = Some(symbol);
    self
  }

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

  pub fn reset_symbol(&mut self) {
    self.symbol = None;
  }

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

  pub fn with_trading_class(mut self, trading_class: String) -> SecdefInfo {
    self.trading_class = Some(trading_class);
    self
  }

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

  pub fn reset_trading_class(&mut self) {
    self.trading_class = None;
  }

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

  pub fn with_valid_exchanges(mut self, valid_exchanges: String) -> SecdefInfo {
    self.valid_exchanges = Some(valid_exchanges);
    self
  }

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

  pub fn reset_valid_exchanges(&mut self) {
    self.valid_exchanges = None;
  }

}