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
/* 
 * Client Portal Web API
 *
 * Production version of the Client Portal Web API
 *
 * OpenAPI spec version: 1.0.0
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

/// FuturesInner : future contract information

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

#[derive(Debug, Serialize, Deserialize)]
pub struct FuturesInner {
  #[serde(rename = "symbol")]
  symbol: Option<String>,
  /// conid of the future contract
  #[serde(rename = "conid")]
  conid: Option<i32>,
  #[serde(rename = "underlyingConid")]
  underlying_conid: Option<i32>,
  #[serde(rename = "expirationDate")]
  expiration_date: Option<String>,
  /// last trading day
  #[serde(rename = "ltd")]
  ltd: Option<String>
}

impl FuturesInner {
  /// future contract information
  pub fn new() -> FuturesInner {
    FuturesInner {
      symbol: None,
      conid: None,
      underlying_conid: None,
      expiration_date: None,
      ltd: None
    }
  }

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

  pub fn with_symbol(mut self, symbol: String) -> FuturesInner {
    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_conid(&mut self, conid: i32) {
    self.conid = Some(conid);
  }

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

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

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

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

  pub fn with_underlying_conid(mut self, underlying_conid: i32) -> FuturesInner {
    self.underlying_conid = Some(underlying_conid);
    self
  }

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

  pub fn reset_underlying_conid(&mut self) {
    self.underlying_conid = None;
  }

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

  pub fn with_expiration_date(mut self, expiration_date: String) -> FuturesInner {
    self.expiration_date = Some(expiration_date);
    self
  }

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

  pub fn reset_expiration_date(&mut self) {
    self.expiration_date = None;
  }

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

  pub fn with_ltd(mut self, ltd: String) -> FuturesInner {
    self.ltd = Some(ltd);
    self
  }

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

  pub fn reset_ltd(&mut self) {
    self.ltd = None;
  }

}