ib 3.0.0

A Rust client to the Interactive Brokers HTTP REST API
Documentation
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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
/* 
 * Client Portal Web API
 *
 * Client Poral Web API
 *
 * OpenAPI spec version: 1.0.0
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */


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

#[derive(Debug, Serialize, Deserialize)]
pub struct InlineResponse20023Rules {
  #[serde(rename = "algoEligible")]
  algo_eligible: Option<bool>,
  /// Cash currency for the contract
  #[serde(rename = "cashCcy")]
  cash_ccy: Option<String>,
  /// Increment value for cash quantity
  #[serde(rename = "cashQtyIncr")]
  cash_qty_incr: Option<f32>,
  /// cash value
  #[serde(rename = "cashSize")]
  cash_size: Option<i32>,
  #[serde(rename = "cqtTypes")]
  cqt_types: Option<Vec<::models::InlineResponse20023CqtTypes>>,
  /// Default quantity
  #[serde(rename = "defaultSize")]
  default_size: Option<i32>,
  /// Default time in force value
  #[serde(rename = "defaultTIF")]
  default_tif: Option<String>,
  #[serde(rename = "displaySize")]
  display_size: Option<f32>,
  #[serde(rename = "error")]
  error: Option<String>,
  /// decimal places for fractional order size
  #[serde(rename = "fraqInt")]
  fraq_int: Option<f32>,
  #[serde(rename = "fraqTypes")]
  fraq_types: Option<Vec<::models::InlineResponse20023FraqTypes>>,
  #[serde(rename = "ibalgoTypes")]
  ibalgo_types: Option<Vec<::models::InlineResponse20023IbalgoTypes>>,
  /// Price increment value
  #[serde(rename = "increment")]
  increment: Option<f32>,
  /// Number of digits for price increment
  #[serde(rename = "incrementDigits")]
  increment_digits: Option<i32>,
  /// Limit price
  #[serde(rename = "limitPrice")]
  limit_price: Option<f32>,
  /// trading negative price support
  #[serde(rename = "negativeCapable")]
  negative_capable: Option<bool>,
  /// If object returned will provide the defaults based on user settings
  #[serde(rename = "orderDefaults")]
  order_defaults: Option<Vec<::models::InlineResponse20023OrderDefaults>>,
  /// Order origin designation for US securities options and Options Clearing Corporation
  #[serde(rename = "orderOrigination")]
  order_origination: Option<f32>,
  #[serde(rename = "orderTypes")]
  order_types: Option<Vec<::models::InlineResponse20023OrderTypes>>,
  #[serde(rename = "orderTypesOutside")]
  order_types_outside: Option<Vec<::models::InlineResponse20023OrderTypesOutside>>,
  /// order preview required
  #[serde(rename = "preview")]
  preview: Option<bool>,
  /// Price Magnifier
  #[serde(rename = "priceMagnifier")]
  price_magnifier: Option<f32>,
  /// increment quantity value
  #[serde(rename = "sizeIncrement")]
  size_increment: Option<i32>,
  /// Stop price
  #[serde(rename = "stopprice")]
  stopprice: Option<f32>,
  #[serde(rename = "tifTypes")]
  tif_types: Option<Vec<::models::InlineResponse20023TifTypes>>
}

impl InlineResponse20023Rules {
  pub fn new() -> InlineResponse20023Rules {
    InlineResponse20023Rules {
      algo_eligible: None,
      cash_ccy: None,
      cash_qty_incr: None,
      cash_size: None,
      cqt_types: None,
      default_size: None,
      default_tif: None,
      display_size: None,
      error: None,
      fraq_int: None,
      fraq_types: None,
      ibalgo_types: None,
      increment: None,
      increment_digits: None,
      limit_price: None,
      negative_capable: None,
      order_defaults: None,
      order_origination: None,
      order_types: None,
      order_types_outside: None,
      preview: None,
      price_magnifier: None,
      size_increment: None,
      stopprice: None,
      tif_types: None
    }
  }

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

  pub fn with_algo_eligible(mut self, algo_eligible: bool) -> InlineResponse20023Rules {
    self.algo_eligible = Some(algo_eligible);
    self
  }

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

  pub fn reset_algo_eligible(&mut self) {
    self.algo_eligible = None;
  }

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

  pub fn with_cash_ccy(mut self, cash_ccy: String) -> InlineResponse20023Rules {
    self.cash_ccy = Some(cash_ccy);
    self
  }

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

  pub fn reset_cash_ccy(&mut self) {
    self.cash_ccy = None;
  }

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

  pub fn with_cash_qty_incr(mut self, cash_qty_incr: f32) -> InlineResponse20023Rules {
    self.cash_qty_incr = Some(cash_qty_incr);
    self
  }

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

  pub fn reset_cash_qty_incr(&mut self) {
    self.cash_qty_incr = None;
  }

  pub fn set_cash_size(&mut self, cash_size: i32) {
    self.cash_size = Some(cash_size);
  }

  pub fn with_cash_size(mut self, cash_size: i32) -> InlineResponse20023Rules {
    self.cash_size = Some(cash_size);
    self
  }

  pub fn cash_size(&self) -> Option<&i32> {
    self.cash_size.as_ref()
  }

  pub fn reset_cash_size(&mut self) {
    self.cash_size = None;
  }

  pub fn set_cqt_types(&mut self, cqt_types: Vec<::models::InlineResponse20023CqtTypes>) {
    self.cqt_types = Some(cqt_types);
  }

  pub fn with_cqt_types(mut self, cqt_types: Vec<::models::InlineResponse20023CqtTypes>) -> InlineResponse20023Rules {
    self.cqt_types = Some(cqt_types);
    self
  }

  pub fn cqt_types(&self) -> Option<&Vec<::models::InlineResponse20023CqtTypes>> {
    self.cqt_types.as_ref()
  }

  pub fn reset_cqt_types(&mut self) {
    self.cqt_types = None;
  }

  pub fn set_default_size(&mut self, default_size: i32) {
    self.default_size = Some(default_size);
  }

  pub fn with_default_size(mut self, default_size: i32) -> InlineResponse20023Rules {
    self.default_size = Some(default_size);
    self
  }

  pub fn default_size(&self) -> Option<&i32> {
    self.default_size.as_ref()
  }

  pub fn reset_default_size(&mut self) {
    self.default_size = None;
  }

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

  pub fn with_default_tif(mut self, default_tif: String) -> InlineResponse20023Rules {
    self.default_tif = Some(default_tif);
    self
  }

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

  pub fn reset_default_tif(&mut self) {
    self.default_tif = None;
  }

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

  pub fn with_display_size(mut self, display_size: f32) -> InlineResponse20023Rules {
    self.display_size = Some(display_size);
    self
  }

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

  pub fn reset_display_size(&mut self) {
    self.display_size = None;
  }

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

  pub fn with_error(mut self, error: String) -> InlineResponse20023Rules {
    self.error = Some(error);
    self
  }

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

  pub fn reset_error(&mut self) {
    self.error = None;
  }

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

  pub fn with_fraq_int(mut self, fraq_int: f32) -> InlineResponse20023Rules {
    self.fraq_int = Some(fraq_int);
    self
  }

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

  pub fn reset_fraq_int(&mut self) {
    self.fraq_int = None;
  }

  pub fn set_fraq_types(&mut self, fraq_types: Vec<::models::InlineResponse20023FraqTypes>) {
    self.fraq_types = Some(fraq_types);
  }

  pub fn with_fraq_types(mut self, fraq_types: Vec<::models::InlineResponse20023FraqTypes>) -> InlineResponse20023Rules {
    self.fraq_types = Some(fraq_types);
    self
  }

  pub fn fraq_types(&self) -> Option<&Vec<::models::InlineResponse20023FraqTypes>> {
    self.fraq_types.as_ref()
  }

  pub fn reset_fraq_types(&mut self) {
    self.fraq_types = None;
  }

  pub fn set_ibalgo_types(&mut self, ibalgo_types: Vec<::models::InlineResponse20023IbalgoTypes>) {
    self.ibalgo_types = Some(ibalgo_types);
  }

  pub fn with_ibalgo_types(mut self, ibalgo_types: Vec<::models::InlineResponse20023IbalgoTypes>) -> InlineResponse20023Rules {
    self.ibalgo_types = Some(ibalgo_types);
    self
  }

  pub fn ibalgo_types(&self) -> Option<&Vec<::models::InlineResponse20023IbalgoTypes>> {
    self.ibalgo_types.as_ref()
  }

  pub fn reset_ibalgo_types(&mut self) {
    self.ibalgo_types = None;
  }

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

  pub fn with_increment(mut self, increment: f32) -> InlineResponse20023Rules {
    self.increment = Some(increment);
    self
  }

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

  pub fn reset_increment(&mut self) {
    self.increment = None;
  }

  pub fn set_increment_digits(&mut self, increment_digits: i32) {
    self.increment_digits = Some(increment_digits);
  }

  pub fn with_increment_digits(mut self, increment_digits: i32) -> InlineResponse20023Rules {
    self.increment_digits = Some(increment_digits);
    self
  }

  pub fn increment_digits(&self) -> Option<&i32> {
    self.increment_digits.as_ref()
  }

  pub fn reset_increment_digits(&mut self) {
    self.increment_digits = None;
  }

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

  pub fn with_limit_price(mut self, limit_price: f32) -> InlineResponse20023Rules {
    self.limit_price = Some(limit_price);
    self
  }

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

  pub fn reset_limit_price(&mut self) {
    self.limit_price = None;
  }

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

  pub fn with_negative_capable(mut self, negative_capable: bool) -> InlineResponse20023Rules {
    self.negative_capable = Some(negative_capable);
    self
  }

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

  pub fn reset_negative_capable(&mut self) {
    self.negative_capable = None;
  }

  pub fn set_order_defaults(&mut self, order_defaults: Vec<::models::InlineResponse20023OrderDefaults>) {
    self.order_defaults = Some(order_defaults);
  }

  pub fn with_order_defaults(mut self, order_defaults: Vec<::models::InlineResponse20023OrderDefaults>) -> InlineResponse20023Rules {
    self.order_defaults = Some(order_defaults);
    self
  }

  pub fn order_defaults(&self) -> Option<&Vec<::models::InlineResponse20023OrderDefaults>> {
    self.order_defaults.as_ref()
  }

  pub fn reset_order_defaults(&mut self) {
    self.order_defaults = None;
  }

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

  pub fn with_order_origination(mut self, order_origination: f32) -> InlineResponse20023Rules {
    self.order_origination = Some(order_origination);
    self
  }

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

  pub fn reset_order_origination(&mut self) {
    self.order_origination = None;
  }

  pub fn set_order_types(&mut self, order_types: Vec<::models::InlineResponse20023OrderTypes>) {
    self.order_types = Some(order_types);
  }

  pub fn with_order_types(mut self, order_types: Vec<::models::InlineResponse20023OrderTypes>) -> InlineResponse20023Rules {
    self.order_types = Some(order_types);
    self
  }

  pub fn order_types(&self) -> Option<&Vec<::models::InlineResponse20023OrderTypes>> {
    self.order_types.as_ref()
  }

  pub fn reset_order_types(&mut self) {
    self.order_types = None;
  }

  pub fn set_order_types_outside(&mut self, order_types_outside: Vec<::models::InlineResponse20023OrderTypesOutside>) {
    self.order_types_outside = Some(order_types_outside);
  }

  pub fn with_order_types_outside(mut self, order_types_outside: Vec<::models::InlineResponse20023OrderTypesOutside>) -> InlineResponse20023Rules {
    self.order_types_outside = Some(order_types_outside);
    self
  }

  pub fn order_types_outside(&self) -> Option<&Vec<::models::InlineResponse20023OrderTypesOutside>> {
    self.order_types_outside.as_ref()
  }

  pub fn reset_order_types_outside(&mut self) {
    self.order_types_outside = None;
  }

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

  pub fn with_preview(mut self, preview: bool) -> InlineResponse20023Rules {
    self.preview = Some(preview);
    self
  }

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

  pub fn reset_preview(&mut self) {
    self.preview = None;
  }

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

  pub fn with_price_magnifier(mut self, price_magnifier: f32) -> InlineResponse20023Rules {
    self.price_magnifier = Some(price_magnifier);
    self
  }

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

  pub fn reset_price_magnifier(&mut self) {
    self.price_magnifier = None;
  }

  pub fn set_size_increment(&mut self, size_increment: i32) {
    self.size_increment = Some(size_increment);
  }

  pub fn with_size_increment(mut self, size_increment: i32) -> InlineResponse20023Rules {
    self.size_increment = Some(size_increment);
    self
  }

  pub fn size_increment(&self) -> Option<&i32> {
    self.size_increment.as_ref()
  }

  pub fn reset_size_increment(&mut self) {
    self.size_increment = None;
  }

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

  pub fn with_stopprice(mut self, stopprice: f32) -> InlineResponse20023Rules {
    self.stopprice = Some(stopprice);
    self
  }

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

  pub fn reset_stopprice(&mut self) {
    self.stopprice = None;
  }

  pub fn set_tif_types(&mut self, tif_types: Vec<::models::InlineResponse20023TifTypes>) {
    self.tif_types = Some(tif_types);
  }

  pub fn with_tif_types(mut self, tif_types: Vec<::models::InlineResponse20023TifTypes>) -> InlineResponse20023Rules {
    self.tif_types = Some(tif_types);
    self
  }

  pub fn tif_types(&self) -> Option<&Vec<::models::InlineResponse20023TifTypes>> {
    self.tif_types.as_ref()
  }

  pub fn reset_tif_types(&mut self) {
    self.tif_types = None;
  }

}