Skip to main content

fixer_fix/fix42/
security_status.rs

1// Code generated by fixer-gen. DO NOT EDIT.
2#![allow(clippy::new_without_default)]
3#![allow(clippy::needless_pass_by_value)]
4#![allow(clippy::too_many_arguments)]
5#![allow(unused_imports)]
6
7use fixer::message::Message;
8use fixer::fix_string::FIXString;
9use fixer::errors::MessageRejectErrorEnum;
10use fixer::session::session_id::SessionID;
11
12use rust_decimal::Decimal;
13
14
15use jiff::Timestamp;
16
17use crate::field;
18use crate::tag;
19
20/// `SecurityStatus` is the `fix42` `SecurityStatus` type, `MsgType` = f.
21pub struct SecurityStatus {
22    pub message: Message,
23}
24
25impl SecurityStatus {
26    /// Creates a new `SecurityStatus` with required fields.
27    pub fn new(symbol: field::SymbolField) -> Self {
28        let mut msg = Message::new();
29        msg.header.set_field(tag::MSG_TYPE, FIXString::from("f".to_string()));
30
31        msg.body.set_field(tag::SYMBOL, symbol.0);
32
33        Self { message: msg }
34    }
35
36    /// Creates a `SecurityStatus` from an existing `Message`.
37    pub fn from_message(msg: Message) -> Self {
38        Self { message: msg }
39    }
40
41    /// Returns the underlying `Message`.
42    pub fn to_message(self) -> Message {
43        self.message
44    }
45
46
47
48
49    /// Sets `Adjustment`, Tag 334.
50    pub fn set_adjustment(&mut self, v: isize) {
51        self.message.body.set_field(tag::ADJUSTMENT, fixer::fix_int::FIXInt::from(v));
52    }
53
54    /// Gets `Adjustment`, Tag 334.
55    pub fn get_adjustment(&self) -> Result<isize, MessageRejectErrorEnum> {
56        let mut fld = field::AdjustmentField::new(0);
57        self.message.body.get_field(tag::ADJUSTMENT, &mut fld.0)?;
58        Ok(fld.value())
59    }
60
61
62    /// Returns true if `Adjustment` is present, Tag 334.
63    pub fn has_adjustment(&self) -> bool {
64        self.message.body.has(tag::ADJUSTMENT)
65    }
66
67
68
69
70    /// Sets `BuyVolume`, Tag 330.
71    pub fn set_buy_volume(&mut self, val: Decimal, scale: i32) {
72        self.message.body.set_field(tag::BUY_VOLUME, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
73    }
74
75    /// Gets `BuyVolume`, Tag 330.
76    pub fn get_buy_volume(&self) -> Result<Decimal, MessageRejectErrorEnum> {
77        let mut fld = field::BuyVolumeField::new(Decimal::ZERO, 0);
78        self.message.body.get_field(tag::BUY_VOLUME, &mut fld.0)?;
79        Ok(fld.value())
80    }
81
82
83    /// Returns true if `BuyVolume` is present, Tag 330.
84    pub fn has_buy_volume(&self) -> bool {
85        self.message.body.has(tag::BUY_VOLUME)
86    }
87
88
89
90
91    /// Sets `ContractMultiplier`, Tag 231.
92    pub fn set_contract_multiplier(&mut self, val: Decimal, scale: i32) {
93        self.message.body.set_field(tag::CONTRACT_MULTIPLIER, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
94    }
95
96    /// Gets `ContractMultiplier`, Tag 231.
97    pub fn get_contract_multiplier(&self) -> Result<Decimal, MessageRejectErrorEnum> {
98        let mut fld = field::ContractMultiplierField::new(Decimal::ZERO, 0);
99        self.message.body.get_field(tag::CONTRACT_MULTIPLIER, &mut fld.0)?;
100        Ok(fld.value())
101    }
102
103
104    /// Returns true if `ContractMultiplier` is present, Tag 231.
105    pub fn has_contract_multiplier(&self) -> bool {
106        self.message.body.has(tag::CONTRACT_MULTIPLIER)
107    }
108
109
110
111
112    /// Sets `CorporateAction`, Tag 292.
113    pub fn set_corporate_action(&mut self, v: String) {
114        self.message.body.set_field(tag::CORPORATE_ACTION, FIXString::from(v));
115    }
116
117    /// Gets `CorporateAction`, Tag 292.
118    pub fn get_corporate_action(&self) -> Result<String, MessageRejectErrorEnum> {
119        let mut fld = field::CorporateActionField::new(String::new());
120        self.message.body.get_field(tag::CORPORATE_ACTION, &mut fld.0)?;
121        Ok(fld.value().to_string())
122    }
123
124
125    /// Returns true if `CorporateAction` is present, Tag 292.
126    pub fn has_corporate_action(&self) -> bool {
127        self.message.body.has(tag::CORPORATE_ACTION)
128    }
129
130
131
132
133    /// Sets `CouponRate`, Tag 223.
134    pub fn set_coupon_rate(&mut self, val: Decimal, scale: i32) {
135        self.message.body.set_field(tag::COUPON_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
136    }
137
138    /// Gets `CouponRate`, Tag 223.
139    pub fn get_coupon_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
140        let mut fld = field::CouponRateField::new(Decimal::ZERO, 0);
141        self.message.body.get_field(tag::COUPON_RATE, &mut fld.0)?;
142        Ok(fld.value())
143    }
144
145
146    /// Returns true if `CouponRate` is present, Tag 223.
147    pub fn has_coupon_rate(&self) -> bool {
148        self.message.body.has(tag::COUPON_RATE)
149    }
150
151
152
153
154    /// Sets `Currency`, Tag 15.
155    pub fn set_currency(&mut self, v: String) {
156        self.message.body.set_field(tag::CURRENCY, FIXString::from(v));
157    }
158
159    /// Gets `Currency`, Tag 15.
160    pub fn get_currency(&self) -> Result<String, MessageRejectErrorEnum> {
161        let mut fld = field::CurrencyField::new(String::new());
162        self.message.body.get_field(tag::CURRENCY, &mut fld.0)?;
163        Ok(fld.value().to_string())
164    }
165
166
167    /// Returns true if `Currency` is present, Tag 15.
168    pub fn has_currency(&self) -> bool {
169        self.message.body.has(tag::CURRENCY)
170    }
171
172
173
174
175    /// Sets `DueToRelated`, Tag 329.
176    pub fn set_due_to_related(&mut self, v: bool) {
177        self.message.body.set_field(tag::DUE_TO_RELATED, fixer::fix_boolean::FIXBoolean::from(v));
178    }
179
180    /// Gets `DueToRelated`, Tag 329.
181    pub fn get_due_to_related(&self) -> Result<bool, MessageRejectErrorEnum> {
182        let mut fld = field::DueToRelatedField::new(false);
183        self.message.body.get_field(tag::DUE_TO_RELATED, &mut fld.0)?;
184        Ok(fld.value())
185    }
186
187
188    /// Returns true if `DueToRelated` is present, Tag 329.
189    pub fn has_due_to_related(&self) -> bool {
190        self.message.body.has(tag::DUE_TO_RELATED)
191    }
192
193
194
195
196    /// Sets `EncodedIssuer`, Tag 349.
197    pub fn set_encoded_issuer(&mut self, v: String) {
198        self.message.body.set_field(tag::ENCODED_ISSUER, FIXString::from(v));
199    }
200
201    /// Gets `EncodedIssuer`, Tag 349.
202    pub fn get_encoded_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
203        let mut fld = field::EncodedIssuerField::new(String::new());
204        self.message.body.get_field(tag::ENCODED_ISSUER, &mut fld.0)?;
205        Ok(fld.value().to_string())
206    }
207
208
209    /// Returns true if `EncodedIssuer` is present, Tag 349.
210    pub fn has_encoded_issuer(&self) -> bool {
211        self.message.body.has(tag::ENCODED_ISSUER)
212    }
213
214
215
216
217    /// Sets `EncodedIssuerLen`, Tag 348.
218    pub fn set_encoded_issuer_len(&mut self, v: isize) {
219        self.message.body.set_field(tag::ENCODED_ISSUER_LEN, fixer::fix_int::FIXInt::from(v));
220    }
221
222    /// Gets `EncodedIssuerLen`, Tag 348.
223    pub fn get_encoded_issuer_len(&self) -> Result<isize, MessageRejectErrorEnum> {
224        let mut fld = field::EncodedIssuerLenField::new(0);
225        self.message.body.get_field(tag::ENCODED_ISSUER_LEN, &mut fld.0)?;
226        Ok(fld.value())
227    }
228
229
230    /// Returns true if `EncodedIssuerLen` is present, Tag 348.
231    pub fn has_encoded_issuer_len(&self) -> bool {
232        self.message.body.has(tag::ENCODED_ISSUER_LEN)
233    }
234
235
236
237
238    /// Sets `EncodedSecurityDesc`, Tag 351.
239    pub fn set_encoded_security_desc(&mut self, v: String) {
240        self.message.body.set_field(tag::ENCODED_SECURITY_DESC, FIXString::from(v));
241    }
242
243    /// Gets `EncodedSecurityDesc`, Tag 351.
244    pub fn get_encoded_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
245        let mut fld = field::EncodedSecurityDescField::new(String::new());
246        self.message.body.get_field(tag::ENCODED_SECURITY_DESC, &mut fld.0)?;
247        Ok(fld.value().to_string())
248    }
249
250
251    /// Returns true if `EncodedSecurityDesc` is present, Tag 351.
252    pub fn has_encoded_security_desc(&self) -> bool {
253        self.message.body.has(tag::ENCODED_SECURITY_DESC)
254    }
255
256
257
258
259    /// Sets `EncodedSecurityDescLen`, Tag 350.
260    pub fn set_encoded_security_desc_len(&mut self, v: isize) {
261        self.message.body.set_field(tag::ENCODED_SECURITY_DESC_LEN, fixer::fix_int::FIXInt::from(v));
262    }
263
264    /// Gets `EncodedSecurityDescLen`, Tag 350.
265    pub fn get_encoded_security_desc_len(&self) -> Result<isize, MessageRejectErrorEnum> {
266        let mut fld = field::EncodedSecurityDescLenField::new(0);
267        self.message.body.get_field(tag::ENCODED_SECURITY_DESC_LEN, &mut fld.0)?;
268        Ok(fld.value())
269    }
270
271
272    /// Returns true if `EncodedSecurityDescLen` is present, Tag 350.
273    pub fn has_encoded_security_desc_len(&self) -> bool {
274        self.message.body.has(tag::ENCODED_SECURITY_DESC_LEN)
275    }
276
277
278
279
280    /// Sets `FinancialStatus`, Tag 291.
281    pub fn set_financial_status(&mut self, v: String) {
282        self.message.body.set_field(tag::FINANCIAL_STATUS, FIXString::from(v));
283    }
284
285    /// Gets `FinancialStatus`, Tag 291.
286    pub fn get_financial_status(&self) -> Result<String, MessageRejectErrorEnum> {
287        let mut fld = field::FinancialStatusField::new(String::new());
288        self.message.body.get_field(tag::FINANCIAL_STATUS, &mut fld.0)?;
289        Ok(fld.value().to_string())
290    }
291
292
293    /// Returns true if `FinancialStatus` is present, Tag 291.
294    pub fn has_financial_status(&self) -> bool {
295        self.message.body.has(tag::FINANCIAL_STATUS)
296    }
297
298
299
300
301    /// Sets `HaltReasonChar`, Tag 327.
302    pub fn set_halt_reason_char(&mut self, v: String) {
303        self.message.body.set_field(tag::HALT_REASON_CHAR, FIXString::from(v));
304    }
305
306    /// Gets `HaltReasonChar`, Tag 327.
307    pub fn get_halt_reason_char(&self) -> Result<String, MessageRejectErrorEnum> {
308        let mut fld = field::HaltReasonCharField::new(String::new());
309        self.message.body.get_field(tag::HALT_REASON_CHAR, &mut fld.0)?;
310        Ok(fld.value().to_string())
311    }
312
313
314    /// Returns true if `HaltReasonChar` is present, Tag 327.
315    pub fn has_halt_reason_char(&self) -> bool {
316        self.message.body.has(tag::HALT_REASON_CHAR)
317    }
318
319
320
321
322    /// Sets `HighPx`, Tag 332.
323    pub fn set_high_px(&mut self, val: Decimal, scale: i32) {
324        self.message.body.set_field(tag::HIGH_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
325    }
326
327    /// Gets `HighPx`, Tag 332.
328    pub fn get_high_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
329        let mut fld = field::HighPxField::new(Decimal::ZERO, 0);
330        self.message.body.get_field(tag::HIGH_PX, &mut fld.0)?;
331        Ok(fld.value())
332    }
333
334
335    /// Returns true if `HighPx` is present, Tag 332.
336    pub fn has_high_px(&self) -> bool {
337        self.message.body.has(tag::HIGH_PX)
338    }
339
340
341
342
343    /// Sets `IDSource`, Tag 22.
344    pub fn set_id_source(&mut self, v: String) {
345        self.message.body.set_field(tag::ID_SOURCE, FIXString::from(v));
346    }
347
348    /// Gets `IDSource`, Tag 22.
349    pub fn get_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
350        let mut fld = field::IDSourceField::new(String::new());
351        self.message.body.get_field(tag::ID_SOURCE, &mut fld.0)?;
352        Ok(fld.value().to_string())
353    }
354
355
356    /// Returns true if `IDSource` is present, Tag 22.
357    pub fn has_id_source(&self) -> bool {
358        self.message.body.has(tag::ID_SOURCE)
359    }
360
361
362
363
364    /// Sets `InViewOfCommon`, Tag 328.
365    pub fn set_in_view_of_common(&mut self, v: bool) {
366        self.message.body.set_field(tag::IN_VIEW_OF_COMMON, fixer::fix_boolean::FIXBoolean::from(v));
367    }
368
369    /// Gets `InViewOfCommon`, Tag 328.
370    pub fn get_in_view_of_common(&self) -> Result<bool, MessageRejectErrorEnum> {
371        let mut fld = field::InViewOfCommonField::new(false);
372        self.message.body.get_field(tag::IN_VIEW_OF_COMMON, &mut fld.0)?;
373        Ok(fld.value())
374    }
375
376
377    /// Returns true if `InViewOfCommon` is present, Tag 328.
378    pub fn has_in_view_of_common(&self) -> bool {
379        self.message.body.has(tag::IN_VIEW_OF_COMMON)
380    }
381
382
383
384
385    /// Sets `Issuer`, Tag 106.
386    pub fn set_issuer(&mut self, v: String) {
387        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
388    }
389
390    /// Gets `Issuer`, Tag 106.
391    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
392        let mut fld = field::IssuerField::new(String::new());
393        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
394        Ok(fld.value().to_string())
395    }
396
397
398    /// Returns true if `Issuer` is present, Tag 106.
399    pub fn has_issuer(&self) -> bool {
400        self.message.body.has(tag::ISSUER)
401    }
402
403
404
405
406    /// Sets `LastPx`, Tag 31.
407    pub fn set_last_px(&mut self, val: Decimal, scale: i32) {
408        self.message.body.set_field(tag::LAST_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
409    }
410
411    /// Gets `LastPx`, Tag 31.
412    pub fn get_last_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
413        let mut fld = field::LastPxField::new(Decimal::ZERO, 0);
414        self.message.body.get_field(tag::LAST_PX, &mut fld.0)?;
415        Ok(fld.value())
416    }
417
418
419    /// Returns true if `LastPx` is present, Tag 31.
420    pub fn has_last_px(&self) -> bool {
421        self.message.body.has(tag::LAST_PX)
422    }
423
424
425
426
427    /// Sets `LowPx`, Tag 333.
428    pub fn set_low_px(&mut self, val: Decimal, scale: i32) {
429        self.message.body.set_field(tag::LOW_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
430    }
431
432    /// Gets `LowPx`, Tag 333.
433    pub fn get_low_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
434        let mut fld = field::LowPxField::new(Decimal::ZERO, 0);
435        self.message.body.get_field(tag::LOW_PX, &mut fld.0)?;
436        Ok(fld.value())
437    }
438
439
440    /// Returns true if `LowPx` is present, Tag 333.
441    pub fn has_low_px(&self) -> bool {
442        self.message.body.has(tag::LOW_PX)
443    }
444
445
446
447
448    /// Sets `MaturityDay`, Tag 205.
449    pub fn set_maturity_day(&mut self, v: isize) {
450        self.message.body.set_field(tag::MATURITY_DAY, fixer::fix_int::FIXInt::from(v));
451    }
452
453    /// Gets `MaturityDay`, Tag 205.
454    pub fn get_maturity_day(&self) -> Result<isize, MessageRejectErrorEnum> {
455        let mut fld = field::MaturityDayField::new(0);
456        self.message.body.get_field(tag::MATURITY_DAY, &mut fld.0)?;
457        Ok(fld.value())
458    }
459
460
461    /// Returns true if `MaturityDay` is present, Tag 205.
462    pub fn has_maturity_day(&self) -> bool {
463        self.message.body.has(tag::MATURITY_DAY)
464    }
465
466
467
468
469    /// Sets `MaturityMonthYear`, Tag 200.
470    pub fn set_maturity_month_year(&mut self, v: String) {
471        self.message.body.set_field(tag::MATURITY_MONTH_YEAR, FIXString::from(v));
472    }
473
474    /// Gets `MaturityMonthYear`, Tag 200.
475    pub fn get_maturity_month_year(&self) -> Result<String, MessageRejectErrorEnum> {
476        let mut fld = field::MaturityMonthYearField::new(String::new());
477        self.message.body.get_field(tag::MATURITY_MONTH_YEAR, &mut fld.0)?;
478        Ok(fld.value().to_string())
479    }
480
481
482    /// Returns true if `MaturityMonthYear` is present, Tag 200.
483    pub fn has_maturity_month_year(&self) -> bool {
484        self.message.body.has(tag::MATURITY_MONTH_YEAR)
485    }
486
487
488
489
490    /// Sets `OptAttribute`, Tag 206.
491    pub fn set_opt_attribute(&mut self, v: String) {
492        self.message.body.set_field(tag::OPT_ATTRIBUTE, FIXString::from(v));
493    }
494
495    /// Gets `OptAttribute`, Tag 206.
496    pub fn get_opt_attribute(&self) -> Result<String, MessageRejectErrorEnum> {
497        let mut fld = field::OptAttributeField::new(String::new());
498        self.message.body.get_field(tag::OPT_ATTRIBUTE, &mut fld.0)?;
499        Ok(fld.value().to_string())
500    }
501
502
503    /// Returns true if `OptAttribute` is present, Tag 206.
504    pub fn has_opt_attribute(&self) -> bool {
505        self.message.body.has(tag::OPT_ATTRIBUTE)
506    }
507
508
509
510
511    /// Sets `PutOrCall`, Tag 201.
512    pub fn set_put_or_call(&mut self, v: isize) {
513        self.message.body.set_field(tag::PUT_OR_CALL, fixer::fix_int::FIXInt::from(v));
514    }
515
516    /// Gets `PutOrCall`, Tag 201.
517    pub fn get_put_or_call(&self) -> Result<isize, MessageRejectErrorEnum> {
518        let mut fld = field::PutOrCallField::new(0);
519        self.message.body.get_field(tag::PUT_OR_CALL, &mut fld.0)?;
520        Ok(fld.value())
521    }
522
523
524    /// Returns true if `PutOrCall` is present, Tag 201.
525    pub fn has_put_or_call(&self) -> bool {
526        self.message.body.has(tag::PUT_OR_CALL)
527    }
528
529
530
531
532    /// Sets `SecurityDesc`, Tag 107.
533    pub fn set_security_desc(&mut self, v: String) {
534        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
535    }
536
537    /// Gets `SecurityDesc`, Tag 107.
538    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
539        let mut fld = field::SecurityDescField::new(String::new());
540        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
541        Ok(fld.value().to_string())
542    }
543
544
545    /// Returns true if `SecurityDesc` is present, Tag 107.
546    pub fn has_security_desc(&self) -> bool {
547        self.message.body.has(tag::SECURITY_DESC)
548    }
549
550
551
552
553    /// Sets `SecurityExchange`, Tag 207.
554    pub fn set_security_exchange(&mut self, v: String) {
555        self.message.body.set_field(tag::SECURITY_EXCHANGE, FIXString::from(v));
556    }
557
558    /// Gets `SecurityExchange`, Tag 207.
559    pub fn get_security_exchange(&self) -> Result<String, MessageRejectErrorEnum> {
560        let mut fld = field::SecurityExchangeField::new(String::new());
561        self.message.body.get_field(tag::SECURITY_EXCHANGE, &mut fld.0)?;
562        Ok(fld.value().to_string())
563    }
564
565
566    /// Returns true if `SecurityExchange` is present, Tag 207.
567    pub fn has_security_exchange(&self) -> bool {
568        self.message.body.has(tag::SECURITY_EXCHANGE)
569    }
570
571
572
573
574    /// Sets `SecurityID`, Tag 48.
575    pub fn set_security_id(&mut self, v: String) {
576        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
577    }
578
579    /// Gets `SecurityID`, Tag 48.
580    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
581        let mut fld = field::SecurityIDField::new(String::new());
582        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
583        Ok(fld.value().to_string())
584    }
585
586
587    /// Returns true if `SecurityID` is present, Tag 48.
588    pub fn has_security_id(&self) -> bool {
589        self.message.body.has(tag::SECURITY_ID)
590    }
591
592
593
594
595    /// Sets `SecurityStatusReqID`, Tag 324.
596    pub fn set_security_status_req_id(&mut self, v: String) {
597        self.message.body.set_field(tag::SECURITY_STATUS_REQ_ID, FIXString::from(v));
598    }
599
600    /// Gets `SecurityStatusReqID`, Tag 324.
601    pub fn get_security_status_req_id(&self) -> Result<String, MessageRejectErrorEnum> {
602        let mut fld = field::SecurityStatusReqIDField::new(String::new());
603        self.message.body.get_field(tag::SECURITY_STATUS_REQ_ID, &mut fld.0)?;
604        Ok(fld.value().to_string())
605    }
606
607
608    /// Returns true if `SecurityStatusReqID` is present, Tag 324.
609    pub fn has_security_status_req_id(&self) -> bool {
610        self.message.body.has(tag::SECURITY_STATUS_REQ_ID)
611    }
612
613
614
615
616    /// Sets `SecurityTradingStatus`, Tag 326.
617    pub fn set_security_trading_status(&mut self, v: isize) {
618        self.message.body.set_field(tag::SECURITY_TRADING_STATUS, fixer::fix_int::FIXInt::from(v));
619    }
620
621    /// Gets `SecurityTradingStatus`, Tag 326.
622    pub fn get_security_trading_status(&self) -> Result<isize, MessageRejectErrorEnum> {
623        let mut fld = field::SecurityTradingStatusField::new(0);
624        self.message.body.get_field(tag::SECURITY_TRADING_STATUS, &mut fld.0)?;
625        Ok(fld.value())
626    }
627
628
629    /// Returns true if `SecurityTradingStatus` is present, Tag 326.
630    pub fn has_security_trading_status(&self) -> bool {
631        self.message.body.has(tag::SECURITY_TRADING_STATUS)
632    }
633
634
635
636
637    /// Sets `SecurityType`, Tag 167.
638    pub fn set_security_type(&mut self, v: String) {
639        self.message.body.set_field(tag::SECURITY_TYPE, FIXString::from(v));
640    }
641
642    /// Gets `SecurityType`, Tag 167.
643    pub fn get_security_type(&self) -> Result<String, MessageRejectErrorEnum> {
644        let mut fld = field::SecurityTypeField::new(String::new());
645        self.message.body.get_field(tag::SECURITY_TYPE, &mut fld.0)?;
646        Ok(fld.value().to_string())
647    }
648
649
650    /// Returns true if `SecurityType` is present, Tag 167.
651    pub fn has_security_type(&self) -> bool {
652        self.message.body.has(tag::SECURITY_TYPE)
653    }
654
655
656
657
658    /// Sets `SellVolume`, Tag 331.
659    pub fn set_sell_volume(&mut self, val: Decimal, scale: i32) {
660        self.message.body.set_field(tag::SELL_VOLUME, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
661    }
662
663    /// Gets `SellVolume`, Tag 331.
664    pub fn get_sell_volume(&self) -> Result<Decimal, MessageRejectErrorEnum> {
665        let mut fld = field::SellVolumeField::new(Decimal::ZERO, 0);
666        self.message.body.get_field(tag::SELL_VOLUME, &mut fld.0)?;
667        Ok(fld.value())
668    }
669
670
671    /// Returns true if `SellVolume` is present, Tag 331.
672    pub fn has_sell_volume(&self) -> bool {
673        self.message.body.has(tag::SELL_VOLUME)
674    }
675
676
677
678
679    /// Sets `StrikePrice`, Tag 202.
680    pub fn set_strike_price(&mut self, val: Decimal, scale: i32) {
681        self.message.body.set_field(tag::STRIKE_PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
682    }
683
684    /// Gets `StrikePrice`, Tag 202.
685    pub fn get_strike_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
686        let mut fld = field::StrikePriceField::new(Decimal::ZERO, 0);
687        self.message.body.get_field(tag::STRIKE_PRICE, &mut fld.0)?;
688        Ok(fld.value())
689    }
690
691
692    /// Returns true if `StrikePrice` is present, Tag 202.
693    pub fn has_strike_price(&self) -> bool {
694        self.message.body.has(tag::STRIKE_PRICE)
695    }
696
697
698
699
700    /// Sets `Symbol`, Tag 55.
701    pub fn set_symbol(&mut self, v: String) {
702        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
703    }
704
705    /// Gets `Symbol`, Tag 55.
706    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
707        let mut fld = field::SymbolField::new(String::new());
708        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
709        Ok(fld.value().to_string())
710    }
711
712
713    /// Returns true if `Symbol` is present, Tag 55.
714    pub fn has_symbol(&self) -> bool {
715        self.message.body.has(tag::SYMBOL)
716    }
717
718
719
720
721    /// Sets `SymbolSfx`, Tag 65.
722    pub fn set_symbol_sfx(&mut self, v: String) {
723        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
724    }
725
726    /// Gets `SymbolSfx`, Tag 65.
727    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
728        let mut fld = field::SymbolSfxField::new(String::new());
729        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
730        Ok(fld.value().to_string())
731    }
732
733
734    /// Returns true if `SymbolSfx` is present, Tag 65.
735    pub fn has_symbol_sfx(&self) -> bool {
736        self.message.body.has(tag::SYMBOL_SFX)
737    }
738
739
740
741
742    /// Sets `TradingSessionID`, Tag 336.
743    pub fn set_trading_session_id(&mut self, v: String) {
744        self.message.body.set_field(tag::TRADING_SESSION_ID, FIXString::from(v));
745    }
746
747    /// Gets `TradingSessionID`, Tag 336.
748    pub fn get_trading_session_id(&self) -> Result<String, MessageRejectErrorEnum> {
749        let mut fld = field::TradingSessionIDField::new(String::new());
750        self.message.body.get_field(tag::TRADING_SESSION_ID, &mut fld.0)?;
751        Ok(fld.value().to_string())
752    }
753
754
755    /// Returns true if `TradingSessionID` is present, Tag 336.
756    pub fn has_trading_session_id(&self) -> bool {
757        self.message.body.has(tag::TRADING_SESSION_ID)
758    }
759
760
761
762
763    /// Sets `TransactTime`, Tag 60.
764    pub fn set_transact_time(&mut self, v: Timestamp) {
765        self.message.body.set_field(tag::TRANSACT_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
766            time: v,
767            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
768        });
769    }
770
771    /// Gets `TransactTime`, Tag 60.
772    pub fn get_transact_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
773        let mut fld = field::TransactTimeField::new(Timestamp::UNIX_EPOCH);
774        self.message.body.get_field(tag::TRANSACT_TIME, &mut fld.0)?;
775        Ok(fld.value())
776    }
777
778
779    /// Returns true if `TransactTime` is present, Tag 60.
780    pub fn has_transact_time(&self) -> bool {
781        self.message.body.has(tag::TRANSACT_TIME)
782    }
783
784
785
786
787    /// Sets `UnsolicitedIndicator`, Tag 325.
788    pub fn set_unsolicited_indicator(&mut self, v: bool) {
789        self.message.body.set_field(tag::UNSOLICITED_INDICATOR, fixer::fix_boolean::FIXBoolean::from(v));
790    }
791
792    /// Gets `UnsolicitedIndicator`, Tag 325.
793    pub fn get_unsolicited_indicator(&self) -> Result<bool, MessageRejectErrorEnum> {
794        let mut fld = field::UnsolicitedIndicatorField::new(false);
795        self.message.body.get_field(tag::UNSOLICITED_INDICATOR, &mut fld.0)?;
796        Ok(fld.value())
797    }
798
799
800    /// Returns true if `UnsolicitedIndicator` is present, Tag 325.
801    pub fn has_unsolicited_indicator(&self) -> bool {
802        self.message.body.has(tag::UNSOLICITED_INDICATOR)
803    }
804
805
806}
807
808/// `RouteOut` is the callback type for routing `SecurityStatus` messages.
809pub type RouteOut = fn(msg: SecurityStatus, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
810
811/// Route type returned by the `route` function.
812pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
813
814/// Returns the begin string, message type, and route function for `SecurityStatus`.
815pub fn route(router: RouteOut) -> Route {
816    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
817        router(SecurityStatus::from_message(msg.clone()), session_id)
818    };
819    ("FIX.4.2", "f", Box::new(r))
820}