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
#[allow(unused_imports)]
use serde_json::Value;
#[derive(Debug, Serialize, Deserialize)]
pub struct SecdefInner {
#[serde(rename = "conid")]
conid: Option<i32>,
#[serde(rename = "name")]
name: Option<String>,
#[serde(rename = "assetClass")]
asset_class: Option<String>,
#[serde(rename = "expiry")]
expiry: Option<String>,
#[serde(rename = "lastTradingDay")]
last_trading_day: Option<String>,
#[serde(rename = "group")]
group: Option<String>,
#[serde(rename = "putOrCall")]
put_or_call: Option<String>,
#[serde(rename = "sector")]
sector: Option<String>,
#[serde(rename = "sectorGroup")]
sector_group: Option<String>,
#[serde(rename = "strike")]
strike: Option<f32>,
#[serde(rename = "ticker")]
ticker: Option<String>,
#[serde(rename = "undConid")]
und_conid: Option<i32>,
#[serde(rename = "fullName")]
full_name: Option<String>,
#[serde(rename = "pageSize")]
page_size: Option<i32>
}
impl SecdefInner {
pub fn new() -> SecdefInner {
SecdefInner {
conid: None,
name: None,
asset_class: None,
expiry: None,
last_trading_day: None,
group: None,
put_or_call: None,
sector: None,
sector_group: None,
strike: None,
ticker: None,
und_conid: None,
full_name: None,
page_size: None
}
}
pub fn set_conid(&mut self, conid: i32) {
self.conid = Some(conid);
}
pub fn with_conid(mut self, conid: i32) -> SecdefInner {
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_name(&mut self, name: String) {
self.name = Some(name);
}
pub fn with_name(mut self, name: String) -> SecdefInner {
self.name = Some(name);
self
}
pub fn name(&self) -> Option<&String> {
self.name.as_ref()
}
pub fn reset_name(&mut self) {
self.name = None;
}
pub fn set_asset_class(&mut self, asset_class: String) {
self.asset_class = Some(asset_class);
}
pub fn with_asset_class(mut self, asset_class: String) -> SecdefInner {
self.asset_class = Some(asset_class);
self
}
pub fn asset_class(&self) -> Option<&String> {
self.asset_class.as_ref()
}
pub fn reset_asset_class(&mut self) {
self.asset_class = None;
}
pub fn set_expiry(&mut self, expiry: String) {
self.expiry = Some(expiry);
}
pub fn with_expiry(mut self, expiry: String) -> SecdefInner {
self.expiry = Some(expiry);
self
}
pub fn expiry(&self) -> Option<&String> {
self.expiry.as_ref()
}
pub fn reset_expiry(&mut self) {
self.expiry = None;
}
pub fn set_last_trading_day(&mut self, last_trading_day: String) {
self.last_trading_day = Some(last_trading_day);
}
pub fn with_last_trading_day(mut self, last_trading_day: String) -> SecdefInner {
self.last_trading_day = Some(last_trading_day);
self
}
pub fn last_trading_day(&self) -> Option<&String> {
self.last_trading_day.as_ref()
}
pub fn reset_last_trading_day(&mut self) {
self.last_trading_day = None;
}
pub fn set_group(&mut self, group: String) {
self.group = Some(group);
}
pub fn with_group(mut self, group: String) -> SecdefInner {
self.group = Some(group);
self
}
pub fn group(&self) -> Option<&String> {
self.group.as_ref()
}
pub fn reset_group(&mut self) {
self.group = None;
}
pub fn set_put_or_call(&mut self, put_or_call: String) {
self.put_or_call = Some(put_or_call);
}
pub fn with_put_or_call(mut self, put_or_call: String) -> SecdefInner {
self.put_or_call = Some(put_or_call);
self
}
pub fn put_or_call(&self) -> Option<&String> {
self.put_or_call.as_ref()
}
pub fn reset_put_or_call(&mut self) {
self.put_or_call = None;
}
pub fn set_sector(&mut self, sector: String) {
self.sector = Some(sector);
}
pub fn with_sector(mut self, sector: String) -> SecdefInner {
self.sector = Some(sector);
self
}
pub fn sector(&self) -> Option<&String> {
self.sector.as_ref()
}
pub fn reset_sector(&mut self) {
self.sector = None;
}
pub fn set_sector_group(&mut self, sector_group: String) {
self.sector_group = Some(sector_group);
}
pub fn with_sector_group(mut self, sector_group: String) -> SecdefInner {
self.sector_group = Some(sector_group);
self
}
pub fn sector_group(&self) -> Option<&String> {
self.sector_group.as_ref()
}
pub fn reset_sector_group(&mut self) {
self.sector_group = None;
}
pub fn set_strike(&mut self, strike: f32) {
self.strike = Some(strike);
}
pub fn with_strike(mut self, strike: f32) -> SecdefInner {
self.strike = Some(strike);
self
}
pub fn strike(&self) -> Option<&f32> {
self.strike.as_ref()
}
pub fn reset_strike(&mut self) {
self.strike = None;
}
pub fn set_ticker(&mut self, ticker: String) {
self.ticker = Some(ticker);
}
pub fn with_ticker(mut self, ticker: String) -> SecdefInner {
self.ticker = Some(ticker);
self
}
pub fn ticker(&self) -> Option<&String> {
self.ticker.as_ref()
}
pub fn reset_ticker(&mut self) {
self.ticker = None;
}
pub fn set_und_conid(&mut self, und_conid: i32) {
self.und_conid = Some(und_conid);
}
pub fn with_und_conid(mut self, und_conid: i32) -> SecdefInner {
self.und_conid = Some(und_conid);
self
}
pub fn und_conid(&self) -> Option<&i32> {
self.und_conid.as_ref()
}
pub fn reset_und_conid(&mut self) {
self.und_conid = None;
}
pub fn set_full_name(&mut self, full_name: String) {
self.full_name = Some(full_name);
}
pub fn with_full_name(mut self, full_name: String) -> SecdefInner {
self.full_name = Some(full_name);
self
}
pub fn full_name(&self) -> Option<&String> {
self.full_name.as_ref()
}
pub fn reset_full_name(&mut self) {
self.full_name = None;
}
pub fn set_page_size(&mut self, page_size: i32) {
self.page_size = Some(page_size);
}
pub fn with_page_size(mut self, page_size: i32) -> SecdefInner {
self.page_size = Some(page_size);
self
}
pub fn page_size(&self) -> Option<&i32> {
self.page_size.as_ref()
}
pub fn reset_page_size(&mut self) {
self.page_size = None;
}
}