Skip to main content

fixer_fix/fix42/
new_order_single.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/// `NewOrderSingle` is the `fix42` `NewOrderSingle` type, `MsgType` = D.
21pub struct NewOrderSingle {
22    pub message: Message,
23}
24
25impl NewOrderSingle {
26    /// Creates a new `NewOrderSingle` with required fields.
27    pub fn new(cl_ord_id: field::ClOrdIDField, handl_inst: field::HandlInstField, symbol: field::SymbolField, side: field::SideField, transact_time: field::TransactTimeField, ord_type: field::OrdTypeField) -> Self {
28        let mut msg = Message::new();
29        msg.header.set_field(tag::MSG_TYPE, FIXString::from("D".to_string()));
30
31        msg.body.set_field(tag::CL_ORD_ID, cl_ord_id.0);
32
33        msg.body.set_field(tag::HANDL_INST, handl_inst.0);
34
35        msg.body.set_field(tag::SYMBOL, symbol.0);
36
37        msg.body.set_field(tag::SIDE, side.0);
38
39        msg.body.set_field(tag::TRANSACT_TIME, transact_time.0);
40
41        msg.body.set_field(tag::ORD_TYPE, ord_type.0);
42
43        Self { message: msg }
44    }
45
46    /// Creates a `NewOrderSingle` from an existing `Message`.
47    pub fn from_message(msg: Message) -> Self {
48        Self { message: msg }
49    }
50
51    /// Returns the underlying `Message`.
52    pub fn to_message(self) -> Message {
53        self.message
54    }
55
56
57
58
59    /// Sets `Account`, Tag 1.
60    pub fn set_account(&mut self, v: String) {
61        self.message.body.set_field(tag::ACCOUNT, FIXString::from(v));
62    }
63
64    /// Gets `Account`, Tag 1.
65    pub fn get_account(&self) -> Result<String, MessageRejectErrorEnum> {
66        let mut fld = field::AccountField::new(String::new());
67        self.message.body.get_field(tag::ACCOUNT, &mut fld.0)?;
68        Ok(fld.value().to_string())
69    }
70
71
72    /// Returns true if `Account` is present, Tag 1.
73    pub fn has_account(&self) -> bool {
74        self.message.body.has(tag::ACCOUNT)
75    }
76
77
78
79
80    /// Sets `CashOrderQty`, Tag 152.
81    pub fn set_cash_order_qty(&mut self, val: Decimal, scale: i32) {
82        self.message.body.set_field(tag::CASH_ORDER_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
83    }
84
85    /// Gets `CashOrderQty`, Tag 152.
86    pub fn get_cash_order_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
87        let mut fld = field::CashOrderQtyField::new(Decimal::ZERO, 0);
88        self.message.body.get_field(tag::CASH_ORDER_QTY, &mut fld.0)?;
89        Ok(fld.value())
90    }
91
92
93    /// Returns true if `CashOrderQty` is present, Tag 152.
94    pub fn has_cash_order_qty(&self) -> bool {
95        self.message.body.has(tag::CASH_ORDER_QTY)
96    }
97
98
99
100
101    /// Sets `ClOrdID`, Tag 11.
102    pub fn set_cl_ord_id(&mut self, v: String) {
103        self.message.body.set_field(tag::CL_ORD_ID, FIXString::from(v));
104    }
105
106    /// Gets `ClOrdID`, Tag 11.
107    pub fn get_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
108        let mut fld = field::ClOrdIDField::new(String::new());
109        self.message.body.get_field(tag::CL_ORD_ID, &mut fld.0)?;
110        Ok(fld.value().to_string())
111    }
112
113
114    /// Returns true if `ClOrdID` is present, Tag 11.
115    pub fn has_cl_ord_id(&self) -> bool {
116        self.message.body.has(tag::CL_ORD_ID)
117    }
118
119
120
121
122    /// Sets `ClearingAccount`, Tag 440.
123    pub fn set_clearing_account(&mut self, v: String) {
124        self.message.body.set_field(tag::CLEARING_ACCOUNT, FIXString::from(v));
125    }
126
127    /// Gets `ClearingAccount`, Tag 440.
128    pub fn get_clearing_account(&self) -> Result<String, MessageRejectErrorEnum> {
129        let mut fld = field::ClearingAccountField::new(String::new());
130        self.message.body.get_field(tag::CLEARING_ACCOUNT, &mut fld.0)?;
131        Ok(fld.value().to_string())
132    }
133
134
135    /// Returns true if `ClearingAccount` is present, Tag 440.
136    pub fn has_clearing_account(&self) -> bool {
137        self.message.body.has(tag::CLEARING_ACCOUNT)
138    }
139
140
141
142
143    /// Sets `ClearingFirm`, Tag 439.
144    pub fn set_clearing_firm(&mut self, v: String) {
145        self.message.body.set_field(tag::CLEARING_FIRM, FIXString::from(v));
146    }
147
148    /// Gets `ClearingFirm`, Tag 439.
149    pub fn get_clearing_firm(&self) -> Result<String, MessageRejectErrorEnum> {
150        let mut fld = field::ClearingFirmField::new(String::new());
151        self.message.body.get_field(tag::CLEARING_FIRM, &mut fld.0)?;
152        Ok(fld.value().to_string())
153    }
154
155
156    /// Returns true if `ClearingFirm` is present, Tag 439.
157    pub fn has_clearing_firm(&self) -> bool {
158        self.message.body.has(tag::CLEARING_FIRM)
159    }
160
161
162
163
164    /// Sets `ClientID`, Tag 109.
165    pub fn set_client_id(&mut self, v: String) {
166        self.message.body.set_field(tag::CLIENT_ID, FIXString::from(v));
167    }
168
169    /// Gets `ClientID`, Tag 109.
170    pub fn get_client_id(&self) -> Result<String, MessageRejectErrorEnum> {
171        let mut fld = field::ClientIDField::new(String::new());
172        self.message.body.get_field(tag::CLIENT_ID, &mut fld.0)?;
173        Ok(fld.value().to_string())
174    }
175
176
177    /// Returns true if `ClientID` is present, Tag 109.
178    pub fn has_client_id(&self) -> bool {
179        self.message.body.has(tag::CLIENT_ID)
180    }
181
182
183
184
185    /// Sets `CommType`, Tag 13.
186    pub fn set_comm_type(&mut self, v: String) {
187        self.message.body.set_field(tag::COMM_TYPE, FIXString::from(v));
188    }
189
190    /// Gets `CommType`, Tag 13.
191    pub fn get_comm_type(&self) -> Result<String, MessageRejectErrorEnum> {
192        let mut fld = field::CommTypeField::new(String::new());
193        self.message.body.get_field(tag::COMM_TYPE, &mut fld.0)?;
194        Ok(fld.value().to_string())
195    }
196
197
198    /// Returns true if `CommType` is present, Tag 13.
199    pub fn has_comm_type(&self) -> bool {
200        self.message.body.has(tag::COMM_TYPE)
201    }
202
203
204
205
206    /// Sets `Commission`, Tag 12.
207    pub fn set_commission(&mut self, val: Decimal, scale: i32) {
208        self.message.body.set_field(tag::COMMISSION, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
209    }
210
211    /// Gets `Commission`, Tag 12.
212    pub fn get_commission(&self) -> Result<Decimal, MessageRejectErrorEnum> {
213        let mut fld = field::CommissionField::new(Decimal::ZERO, 0);
214        self.message.body.get_field(tag::COMMISSION, &mut fld.0)?;
215        Ok(fld.value())
216    }
217
218
219    /// Returns true if `Commission` is present, Tag 12.
220    pub fn has_commission(&self) -> bool {
221        self.message.body.has(tag::COMMISSION)
222    }
223
224
225
226
227    /// Sets `ComplianceID`, Tag 376.
228    pub fn set_compliance_id(&mut self, v: String) {
229        self.message.body.set_field(tag::COMPLIANCE_ID, FIXString::from(v));
230    }
231
232    /// Gets `ComplianceID`, Tag 376.
233    pub fn get_compliance_id(&self) -> Result<String, MessageRejectErrorEnum> {
234        let mut fld = field::ComplianceIDField::new(String::new());
235        self.message.body.get_field(tag::COMPLIANCE_ID, &mut fld.0)?;
236        Ok(fld.value().to_string())
237    }
238
239
240    /// Returns true if `ComplianceID` is present, Tag 376.
241    pub fn has_compliance_id(&self) -> bool {
242        self.message.body.has(tag::COMPLIANCE_ID)
243    }
244
245
246
247
248    /// Sets `ContractMultiplier`, Tag 231.
249    pub fn set_contract_multiplier(&mut self, val: Decimal, scale: i32) {
250        self.message.body.set_field(tag::CONTRACT_MULTIPLIER, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
251    }
252
253    /// Gets `ContractMultiplier`, Tag 231.
254    pub fn get_contract_multiplier(&self) -> Result<Decimal, MessageRejectErrorEnum> {
255        let mut fld = field::ContractMultiplierField::new(Decimal::ZERO, 0);
256        self.message.body.get_field(tag::CONTRACT_MULTIPLIER, &mut fld.0)?;
257        Ok(fld.value())
258    }
259
260
261    /// Returns true if `ContractMultiplier` is present, Tag 231.
262    pub fn has_contract_multiplier(&self) -> bool {
263        self.message.body.has(tag::CONTRACT_MULTIPLIER)
264    }
265
266
267
268
269    /// Sets `CouponRate`, Tag 223.
270    pub fn set_coupon_rate(&mut self, val: Decimal, scale: i32) {
271        self.message.body.set_field(tag::COUPON_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
272    }
273
274    /// Gets `CouponRate`, Tag 223.
275    pub fn get_coupon_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
276        let mut fld = field::CouponRateField::new(Decimal::ZERO, 0);
277        self.message.body.get_field(tag::COUPON_RATE, &mut fld.0)?;
278        Ok(fld.value())
279    }
280
281
282    /// Returns true if `CouponRate` is present, Tag 223.
283    pub fn has_coupon_rate(&self) -> bool {
284        self.message.body.has(tag::COUPON_RATE)
285    }
286
287
288
289
290    /// Sets `CoveredOrUncovered`, Tag 203.
291    pub fn set_covered_or_uncovered(&mut self, v: isize) {
292        self.message.body.set_field(tag::COVERED_OR_UNCOVERED, fixer::fix_int::FIXInt::from(v));
293    }
294
295    /// Gets `CoveredOrUncovered`, Tag 203.
296    pub fn get_covered_or_uncovered(&self) -> Result<isize, MessageRejectErrorEnum> {
297        let mut fld = field::CoveredOrUncoveredField::new(0);
298        self.message.body.get_field(tag::COVERED_OR_UNCOVERED, &mut fld.0)?;
299        Ok(fld.value())
300    }
301
302
303    /// Returns true if `CoveredOrUncovered` is present, Tag 203.
304    pub fn has_covered_or_uncovered(&self) -> bool {
305        self.message.body.has(tag::COVERED_OR_UNCOVERED)
306    }
307
308
309
310
311    /// Sets `Currency`, Tag 15.
312    pub fn set_currency(&mut self, v: String) {
313        self.message.body.set_field(tag::CURRENCY, FIXString::from(v));
314    }
315
316    /// Gets `Currency`, Tag 15.
317    pub fn get_currency(&self) -> Result<String, MessageRejectErrorEnum> {
318        let mut fld = field::CurrencyField::new(String::new());
319        self.message.body.get_field(tag::CURRENCY, &mut fld.0)?;
320        Ok(fld.value().to_string())
321    }
322
323
324    /// Returns true if `Currency` is present, Tag 15.
325    pub fn has_currency(&self) -> bool {
326        self.message.body.has(tag::CURRENCY)
327    }
328
329
330
331
332    /// Sets `CustomerOrFirm`, Tag 204.
333    pub fn set_customer_or_firm(&mut self, v: isize) {
334        self.message.body.set_field(tag::CUSTOMER_OR_FIRM, fixer::fix_int::FIXInt::from(v));
335    }
336
337    /// Gets `CustomerOrFirm`, Tag 204.
338    pub fn get_customer_or_firm(&self) -> Result<isize, MessageRejectErrorEnum> {
339        let mut fld = field::CustomerOrFirmField::new(0);
340        self.message.body.get_field(tag::CUSTOMER_OR_FIRM, &mut fld.0)?;
341        Ok(fld.value())
342    }
343
344
345    /// Returns true if `CustomerOrFirm` is present, Tag 204.
346    pub fn has_customer_or_firm(&self) -> bool {
347        self.message.body.has(tag::CUSTOMER_OR_FIRM)
348    }
349
350
351
352
353    /// Sets `DiscretionInst`, Tag 388.
354    pub fn set_discretion_inst(&mut self, v: String) {
355        self.message.body.set_field(tag::DISCRETION_INST, FIXString::from(v));
356    }
357
358    /// Gets `DiscretionInst`, Tag 388.
359    pub fn get_discretion_inst(&self) -> Result<String, MessageRejectErrorEnum> {
360        let mut fld = field::DiscretionInstField::new(String::new());
361        self.message.body.get_field(tag::DISCRETION_INST, &mut fld.0)?;
362        Ok(fld.value().to_string())
363    }
364
365
366    /// Returns true if `DiscretionInst` is present, Tag 388.
367    pub fn has_discretion_inst(&self) -> bool {
368        self.message.body.has(tag::DISCRETION_INST)
369    }
370
371
372
373
374    /// Sets `DiscretionOffset`, Tag 389.
375    pub fn set_discretion_offset(&mut self, val: Decimal, scale: i32) {
376        self.message.body.set_field(tag::DISCRETION_OFFSET, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
377    }
378
379    /// Gets `DiscretionOffset`, Tag 389.
380    pub fn get_discretion_offset(&self) -> Result<Decimal, MessageRejectErrorEnum> {
381        let mut fld = field::DiscretionOffsetField::new(Decimal::ZERO, 0);
382        self.message.body.get_field(tag::DISCRETION_OFFSET, &mut fld.0)?;
383        Ok(fld.value())
384    }
385
386
387    /// Returns true if `DiscretionOffset` is present, Tag 389.
388    pub fn has_discretion_offset(&self) -> bool {
389        self.message.body.has(tag::DISCRETION_OFFSET)
390    }
391
392
393
394
395    /// Sets `EffectiveTime`, Tag 168.
396    pub fn set_effective_time(&mut self, v: Timestamp) {
397        self.message.body.set_field(tag::EFFECTIVE_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
398            time: v,
399            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
400        });
401    }
402
403    /// Gets `EffectiveTime`, Tag 168.
404    pub fn get_effective_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
405        let mut fld = field::EffectiveTimeField::new(Timestamp::UNIX_EPOCH);
406        self.message.body.get_field(tag::EFFECTIVE_TIME, &mut fld.0)?;
407        Ok(fld.value())
408    }
409
410
411    /// Returns true if `EffectiveTime` is present, Tag 168.
412    pub fn has_effective_time(&self) -> bool {
413        self.message.body.has(tag::EFFECTIVE_TIME)
414    }
415
416
417
418
419    /// Sets `EncodedIssuer`, Tag 349.
420    pub fn set_encoded_issuer(&mut self, v: String) {
421        self.message.body.set_field(tag::ENCODED_ISSUER, FIXString::from(v));
422    }
423
424    /// Gets `EncodedIssuer`, Tag 349.
425    pub fn get_encoded_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
426        let mut fld = field::EncodedIssuerField::new(String::new());
427        self.message.body.get_field(tag::ENCODED_ISSUER, &mut fld.0)?;
428        Ok(fld.value().to_string())
429    }
430
431
432    /// Returns true if `EncodedIssuer` is present, Tag 349.
433    pub fn has_encoded_issuer(&self) -> bool {
434        self.message.body.has(tag::ENCODED_ISSUER)
435    }
436
437
438
439
440    /// Sets `EncodedIssuerLen`, Tag 348.
441    pub fn set_encoded_issuer_len(&mut self, v: isize) {
442        self.message.body.set_field(tag::ENCODED_ISSUER_LEN, fixer::fix_int::FIXInt::from(v));
443    }
444
445    /// Gets `EncodedIssuerLen`, Tag 348.
446    pub fn get_encoded_issuer_len(&self) -> Result<isize, MessageRejectErrorEnum> {
447        let mut fld = field::EncodedIssuerLenField::new(0);
448        self.message.body.get_field(tag::ENCODED_ISSUER_LEN, &mut fld.0)?;
449        Ok(fld.value())
450    }
451
452
453    /// Returns true if `EncodedIssuerLen` is present, Tag 348.
454    pub fn has_encoded_issuer_len(&self) -> bool {
455        self.message.body.has(tag::ENCODED_ISSUER_LEN)
456    }
457
458
459
460
461    /// Sets `EncodedSecurityDesc`, Tag 351.
462    pub fn set_encoded_security_desc(&mut self, v: String) {
463        self.message.body.set_field(tag::ENCODED_SECURITY_DESC, FIXString::from(v));
464    }
465
466    /// Gets `EncodedSecurityDesc`, Tag 351.
467    pub fn get_encoded_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
468        let mut fld = field::EncodedSecurityDescField::new(String::new());
469        self.message.body.get_field(tag::ENCODED_SECURITY_DESC, &mut fld.0)?;
470        Ok(fld.value().to_string())
471    }
472
473
474    /// Returns true if `EncodedSecurityDesc` is present, Tag 351.
475    pub fn has_encoded_security_desc(&self) -> bool {
476        self.message.body.has(tag::ENCODED_SECURITY_DESC)
477    }
478
479
480
481
482    /// Sets `EncodedSecurityDescLen`, Tag 350.
483    pub fn set_encoded_security_desc_len(&mut self, v: isize) {
484        self.message.body.set_field(tag::ENCODED_SECURITY_DESC_LEN, fixer::fix_int::FIXInt::from(v));
485    }
486
487    /// Gets `EncodedSecurityDescLen`, Tag 350.
488    pub fn get_encoded_security_desc_len(&self) -> Result<isize, MessageRejectErrorEnum> {
489        let mut fld = field::EncodedSecurityDescLenField::new(0);
490        self.message.body.get_field(tag::ENCODED_SECURITY_DESC_LEN, &mut fld.0)?;
491        Ok(fld.value())
492    }
493
494
495    /// Returns true if `EncodedSecurityDescLen` is present, Tag 350.
496    pub fn has_encoded_security_desc_len(&self) -> bool {
497        self.message.body.has(tag::ENCODED_SECURITY_DESC_LEN)
498    }
499
500
501
502
503    /// Sets `EncodedText`, Tag 355.
504    pub fn set_encoded_text(&mut self, v: String) {
505        self.message.body.set_field(tag::ENCODED_TEXT, FIXString::from(v));
506    }
507
508    /// Gets `EncodedText`, Tag 355.
509    pub fn get_encoded_text(&self) -> Result<String, MessageRejectErrorEnum> {
510        let mut fld = field::EncodedTextField::new(String::new());
511        self.message.body.get_field(tag::ENCODED_TEXT, &mut fld.0)?;
512        Ok(fld.value().to_string())
513    }
514
515
516    /// Returns true if `EncodedText` is present, Tag 355.
517    pub fn has_encoded_text(&self) -> bool {
518        self.message.body.has(tag::ENCODED_TEXT)
519    }
520
521
522
523
524    /// Sets `EncodedTextLen`, Tag 354.
525    pub fn set_encoded_text_len(&mut self, v: isize) {
526        self.message.body.set_field(tag::ENCODED_TEXT_LEN, fixer::fix_int::FIXInt::from(v));
527    }
528
529    /// Gets `EncodedTextLen`, Tag 354.
530    pub fn get_encoded_text_len(&self) -> Result<isize, MessageRejectErrorEnum> {
531        let mut fld = field::EncodedTextLenField::new(0);
532        self.message.body.get_field(tag::ENCODED_TEXT_LEN, &mut fld.0)?;
533        Ok(fld.value())
534    }
535
536
537    /// Returns true if `EncodedTextLen` is present, Tag 354.
538    pub fn has_encoded_text_len(&self) -> bool {
539        self.message.body.has(tag::ENCODED_TEXT_LEN)
540    }
541
542
543
544
545    /// Sets `ExDestination`, Tag 100.
546    pub fn set_ex_destination(&mut self, v: String) {
547        self.message.body.set_field(tag::EX_DESTINATION, FIXString::from(v));
548    }
549
550    /// Gets `ExDestination`, Tag 100.
551    pub fn get_ex_destination(&self) -> Result<String, MessageRejectErrorEnum> {
552        let mut fld = field::ExDestinationField::new(String::new());
553        self.message.body.get_field(tag::EX_DESTINATION, &mut fld.0)?;
554        Ok(fld.value().to_string())
555    }
556
557
558    /// Returns true if `ExDestination` is present, Tag 100.
559    pub fn has_ex_destination(&self) -> bool {
560        self.message.body.has(tag::EX_DESTINATION)
561    }
562
563
564
565
566    /// Sets `ExecBroker`, Tag 76.
567    pub fn set_exec_broker(&mut self, v: String) {
568        self.message.body.set_field(tag::EXEC_BROKER, FIXString::from(v));
569    }
570
571    /// Gets `ExecBroker`, Tag 76.
572    pub fn get_exec_broker(&self) -> Result<String, MessageRejectErrorEnum> {
573        let mut fld = field::ExecBrokerField::new(String::new());
574        self.message.body.get_field(tag::EXEC_BROKER, &mut fld.0)?;
575        Ok(fld.value().to_string())
576    }
577
578
579    /// Returns true if `ExecBroker` is present, Tag 76.
580    pub fn has_exec_broker(&self) -> bool {
581        self.message.body.has(tag::EXEC_BROKER)
582    }
583
584
585
586
587    /// Sets `ExecInst`, Tag 18.
588    pub fn set_exec_inst(&mut self, v: String) {
589        self.message.body.set_field(tag::EXEC_INST, FIXString::from(v));
590    }
591
592    /// Gets `ExecInst`, Tag 18.
593    pub fn get_exec_inst(&self) -> Result<String, MessageRejectErrorEnum> {
594        let mut fld = field::ExecInstField::new(String::new());
595        self.message.body.get_field(tag::EXEC_INST, &mut fld.0)?;
596        Ok(fld.value().to_string())
597    }
598
599
600    /// Returns true if `ExecInst` is present, Tag 18.
601    pub fn has_exec_inst(&self) -> bool {
602        self.message.body.has(tag::EXEC_INST)
603    }
604
605
606
607
608    /// Sets `ExpireDate`, Tag 432.
609    pub fn set_expire_date(&mut self, v: String) {
610        self.message.body.set_field(tag::EXPIRE_DATE, FIXString::from(v));
611    }
612
613    /// Gets `ExpireDate`, Tag 432.
614    pub fn get_expire_date(&self) -> Result<String, MessageRejectErrorEnum> {
615        let mut fld = field::ExpireDateField::new(String::new());
616        self.message.body.get_field(tag::EXPIRE_DATE, &mut fld.0)?;
617        Ok(fld.value().to_string())
618    }
619
620
621    /// Returns true if `ExpireDate` is present, Tag 432.
622    pub fn has_expire_date(&self) -> bool {
623        self.message.body.has(tag::EXPIRE_DATE)
624    }
625
626
627
628
629    /// Sets `ExpireTime`, Tag 126.
630    pub fn set_expire_time(&mut self, v: Timestamp) {
631        self.message.body.set_field(tag::EXPIRE_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
632            time: v,
633            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
634        });
635    }
636
637    /// Gets `ExpireTime`, Tag 126.
638    pub fn get_expire_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
639        let mut fld = field::ExpireTimeField::new(Timestamp::UNIX_EPOCH);
640        self.message.body.get_field(tag::EXPIRE_TIME, &mut fld.0)?;
641        Ok(fld.value())
642    }
643
644
645    /// Returns true if `ExpireTime` is present, Tag 126.
646    pub fn has_expire_time(&self) -> bool {
647        self.message.body.has(tag::EXPIRE_TIME)
648    }
649
650
651
652
653    /// Sets `ForexReq`, Tag 121.
654    pub fn set_forex_req(&mut self, v: bool) {
655        self.message.body.set_field(tag::FOREX_REQ, fixer::fix_boolean::FIXBoolean::from(v));
656    }
657
658    /// Gets `ForexReq`, Tag 121.
659    pub fn get_forex_req(&self) -> Result<bool, MessageRejectErrorEnum> {
660        let mut fld = field::ForexReqField::new(false);
661        self.message.body.get_field(tag::FOREX_REQ, &mut fld.0)?;
662        Ok(fld.value())
663    }
664
665
666    /// Returns true if `ForexReq` is present, Tag 121.
667    pub fn has_forex_req(&self) -> bool {
668        self.message.body.has(tag::FOREX_REQ)
669    }
670
671
672
673
674    /// Sets `FutSettDate`, Tag 64.
675    pub fn set_fut_sett_date(&mut self, v: String) {
676        self.message.body.set_field(tag::FUT_SETT_DATE, FIXString::from(v));
677    }
678
679    /// Gets `FutSettDate`, Tag 64.
680    pub fn get_fut_sett_date(&self) -> Result<String, MessageRejectErrorEnum> {
681        let mut fld = field::FutSettDateField::new(String::new());
682        self.message.body.get_field(tag::FUT_SETT_DATE, &mut fld.0)?;
683        Ok(fld.value().to_string())
684    }
685
686
687    /// Returns true if `FutSettDate` is present, Tag 64.
688    pub fn has_fut_sett_date(&self) -> bool {
689        self.message.body.has(tag::FUT_SETT_DATE)
690    }
691
692
693
694
695    /// Sets `FutSettDate2`, Tag 193.
696    pub fn set_fut_sett_date2(&mut self, v: String) {
697        self.message.body.set_field(tag::FUT_SETT_DATE2, FIXString::from(v));
698    }
699
700    /// Gets `FutSettDate2`, Tag 193.
701    pub fn get_fut_sett_date2(&self) -> Result<String, MessageRejectErrorEnum> {
702        let mut fld = field::FutSettDate2Field::new(String::new());
703        self.message.body.get_field(tag::FUT_SETT_DATE2, &mut fld.0)?;
704        Ok(fld.value().to_string())
705    }
706
707
708    /// Returns true if `FutSettDate2` is present, Tag 193.
709    pub fn has_fut_sett_date2(&self) -> bool {
710        self.message.body.has(tag::FUT_SETT_DATE2)
711    }
712
713
714
715
716    /// Sets `GTBookingInst`, Tag 427.
717    pub fn set_gt_booking_inst(&mut self, v: isize) {
718        self.message.body.set_field(tag::GT_BOOKING_INST, fixer::fix_int::FIXInt::from(v));
719    }
720
721    /// Gets `GTBookingInst`, Tag 427.
722    pub fn get_gt_booking_inst(&self) -> Result<isize, MessageRejectErrorEnum> {
723        let mut fld = field::GTBookingInstField::new(0);
724        self.message.body.get_field(tag::GT_BOOKING_INST, &mut fld.0)?;
725        Ok(fld.value())
726    }
727
728
729    /// Returns true if `GTBookingInst` is present, Tag 427.
730    pub fn has_gt_booking_inst(&self) -> bool {
731        self.message.body.has(tag::GT_BOOKING_INST)
732    }
733
734
735
736
737    /// Sets `HandlInst`, Tag 21.
738    pub fn set_handl_inst(&mut self, v: String) {
739        self.message.body.set_field(tag::HANDL_INST, FIXString::from(v));
740    }
741
742    /// Gets `HandlInst`, Tag 21.
743    pub fn get_handl_inst(&self) -> Result<String, MessageRejectErrorEnum> {
744        let mut fld = field::HandlInstField::new(String::new());
745        self.message.body.get_field(tag::HANDL_INST, &mut fld.0)?;
746        Ok(fld.value().to_string())
747    }
748
749
750    /// Returns true if `HandlInst` is present, Tag 21.
751    pub fn has_handl_inst(&self) -> bool {
752        self.message.body.has(tag::HANDL_INST)
753    }
754
755
756
757
758    /// Sets `IDSource`, Tag 22.
759    pub fn set_id_source(&mut self, v: String) {
760        self.message.body.set_field(tag::ID_SOURCE, FIXString::from(v));
761    }
762
763    /// Gets `IDSource`, Tag 22.
764    pub fn get_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
765        let mut fld = field::IDSourceField::new(String::new());
766        self.message.body.get_field(tag::ID_SOURCE, &mut fld.0)?;
767        Ok(fld.value().to_string())
768    }
769
770
771    /// Returns true if `IDSource` is present, Tag 22.
772    pub fn has_id_source(&self) -> bool {
773        self.message.body.has(tag::ID_SOURCE)
774    }
775
776
777
778
779    /// Sets `IOIid`, Tag 23.
780    pub fn set_io_iid(&mut self, v: String) {
781        self.message.body.set_field(tag::IO_IID, FIXString::from(v));
782    }
783
784    /// Gets `IOIid`, Tag 23.
785    pub fn get_io_iid(&self) -> Result<String, MessageRejectErrorEnum> {
786        let mut fld = field::IOIidField::new(String::new());
787        self.message.body.get_field(tag::IO_IID, &mut fld.0)?;
788        Ok(fld.value().to_string())
789    }
790
791
792    /// Returns true if `IOIid` is present, Tag 23.
793    pub fn has_io_iid(&self) -> bool {
794        self.message.body.has(tag::IO_IID)
795    }
796
797
798
799
800    /// Sets `Issuer`, Tag 106.
801    pub fn set_issuer(&mut self, v: String) {
802        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
803    }
804
805    /// Gets `Issuer`, Tag 106.
806    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
807        let mut fld = field::IssuerField::new(String::new());
808        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
809        Ok(fld.value().to_string())
810    }
811
812
813    /// Returns true if `Issuer` is present, Tag 106.
814    pub fn has_issuer(&self) -> bool {
815        self.message.body.has(tag::ISSUER)
816    }
817
818
819
820
821    /// Sets `LocateReqd`, Tag 114.
822    pub fn set_locate_reqd(&mut self, v: bool) {
823        self.message.body.set_field(tag::LOCATE_REQD, fixer::fix_boolean::FIXBoolean::from(v));
824    }
825
826    /// Gets `LocateReqd`, Tag 114.
827    pub fn get_locate_reqd(&self) -> Result<bool, MessageRejectErrorEnum> {
828        let mut fld = field::LocateReqdField::new(false);
829        self.message.body.get_field(tag::LOCATE_REQD, &mut fld.0)?;
830        Ok(fld.value())
831    }
832
833
834    /// Returns true if `LocateReqd` is present, Tag 114.
835    pub fn has_locate_reqd(&self) -> bool {
836        self.message.body.has(tag::LOCATE_REQD)
837    }
838
839
840
841
842    /// Sets `MaturityDay`, Tag 205.
843    pub fn set_maturity_day(&mut self, v: isize) {
844        self.message.body.set_field(tag::MATURITY_DAY, fixer::fix_int::FIXInt::from(v));
845    }
846
847    /// Gets `MaturityDay`, Tag 205.
848    pub fn get_maturity_day(&self) -> Result<isize, MessageRejectErrorEnum> {
849        let mut fld = field::MaturityDayField::new(0);
850        self.message.body.get_field(tag::MATURITY_DAY, &mut fld.0)?;
851        Ok(fld.value())
852    }
853
854
855    /// Returns true if `MaturityDay` is present, Tag 205.
856    pub fn has_maturity_day(&self) -> bool {
857        self.message.body.has(tag::MATURITY_DAY)
858    }
859
860
861
862
863    /// Sets `MaturityMonthYear`, Tag 200.
864    pub fn set_maturity_month_year(&mut self, v: String) {
865        self.message.body.set_field(tag::MATURITY_MONTH_YEAR, FIXString::from(v));
866    }
867
868    /// Gets `MaturityMonthYear`, Tag 200.
869    pub fn get_maturity_month_year(&self) -> Result<String, MessageRejectErrorEnum> {
870        let mut fld = field::MaturityMonthYearField::new(String::new());
871        self.message.body.get_field(tag::MATURITY_MONTH_YEAR, &mut fld.0)?;
872        Ok(fld.value().to_string())
873    }
874
875
876    /// Returns true if `MaturityMonthYear` is present, Tag 200.
877    pub fn has_maturity_month_year(&self) -> bool {
878        self.message.body.has(tag::MATURITY_MONTH_YEAR)
879    }
880
881
882
883
884    /// Sets `MaxFloor`, Tag 111.
885    pub fn set_max_floor(&mut self, val: Decimal, scale: i32) {
886        self.message.body.set_field(tag::MAX_FLOOR, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
887    }
888
889    /// Gets `MaxFloor`, Tag 111.
890    pub fn get_max_floor(&self) -> Result<Decimal, MessageRejectErrorEnum> {
891        let mut fld = field::MaxFloorField::new(Decimal::ZERO, 0);
892        self.message.body.get_field(tag::MAX_FLOOR, &mut fld.0)?;
893        Ok(fld.value())
894    }
895
896
897    /// Returns true if `MaxFloor` is present, Tag 111.
898    pub fn has_max_floor(&self) -> bool {
899        self.message.body.has(tag::MAX_FLOOR)
900    }
901
902
903
904
905    /// Sets `MaxShow`, Tag 210.
906    pub fn set_max_show(&mut self, val: Decimal, scale: i32) {
907        self.message.body.set_field(tag::MAX_SHOW, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
908    }
909
910    /// Gets `MaxShow`, Tag 210.
911    pub fn get_max_show(&self) -> Result<Decimal, MessageRejectErrorEnum> {
912        let mut fld = field::MaxShowField::new(Decimal::ZERO, 0);
913        self.message.body.get_field(tag::MAX_SHOW, &mut fld.0)?;
914        Ok(fld.value())
915    }
916
917
918    /// Returns true if `MaxShow` is present, Tag 210.
919    pub fn has_max_show(&self) -> bool {
920        self.message.body.has(tag::MAX_SHOW)
921    }
922
923
924
925
926    /// Sets `MinQty`, Tag 110.
927    pub fn set_min_qty(&mut self, val: Decimal, scale: i32) {
928        self.message.body.set_field(tag::MIN_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
929    }
930
931    /// Gets `MinQty`, Tag 110.
932    pub fn get_min_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
933        let mut fld = field::MinQtyField::new(Decimal::ZERO, 0);
934        self.message.body.get_field(tag::MIN_QTY, &mut fld.0)?;
935        Ok(fld.value())
936    }
937
938
939    /// Returns true if `MinQty` is present, Tag 110.
940    pub fn has_min_qty(&self) -> bool {
941        self.message.body.has(tag::MIN_QTY)
942    }
943
944
945
946
947    /// Sets `NoAllocs`, Tag 78.
948    pub fn set_no_allocs(&mut self, v: isize) {
949        self.message.body.set_field(tag::NO_ALLOCS, fixer::fix_int::FIXInt::from(v));
950    }
951
952    /// Gets `NoAllocs`, Tag 78.
953    pub fn get_no_allocs(&self) -> Result<isize, MessageRejectErrorEnum> {
954        let mut fld = field::NoAllocsField::new(0);
955        self.message.body.get_field(tag::NO_ALLOCS, &mut fld.0)?;
956        Ok(fld.value())
957    }
958
959
960    /// Returns true if `NoAllocs` is present, Tag 78.
961    pub fn has_no_allocs(&self) -> bool {
962        self.message.body.has(tag::NO_ALLOCS)
963    }
964
965
966
967
968    /// Sets `NoTradingSessions`, Tag 386.
969    pub fn set_no_trading_sessions(&mut self, v: isize) {
970        self.message.body.set_field(tag::NO_TRADING_SESSIONS, fixer::fix_int::FIXInt::from(v));
971    }
972
973    /// Gets `NoTradingSessions`, Tag 386.
974    pub fn get_no_trading_sessions(&self) -> Result<isize, MessageRejectErrorEnum> {
975        let mut fld = field::NoTradingSessionsField::new(0);
976        self.message.body.get_field(tag::NO_TRADING_SESSIONS, &mut fld.0)?;
977        Ok(fld.value())
978    }
979
980
981    /// Returns true if `NoTradingSessions` is present, Tag 386.
982    pub fn has_no_trading_sessions(&self) -> bool {
983        self.message.body.has(tag::NO_TRADING_SESSIONS)
984    }
985
986
987
988
989    /// Sets `OpenClose`, Tag 77.
990    pub fn set_open_close(&mut self, v: String) {
991        self.message.body.set_field(tag::OPEN_CLOSE, FIXString::from(v));
992    }
993
994    /// Gets `OpenClose`, Tag 77.
995    pub fn get_open_close(&self) -> Result<String, MessageRejectErrorEnum> {
996        let mut fld = field::OpenCloseField::new(String::new());
997        self.message.body.get_field(tag::OPEN_CLOSE, &mut fld.0)?;
998        Ok(fld.value().to_string())
999    }
1000
1001
1002    /// Returns true if `OpenClose` is present, Tag 77.
1003    pub fn has_open_close(&self) -> bool {
1004        self.message.body.has(tag::OPEN_CLOSE)
1005    }
1006
1007
1008
1009
1010    /// Sets `OptAttribute`, Tag 206.
1011    pub fn set_opt_attribute(&mut self, v: String) {
1012        self.message.body.set_field(tag::OPT_ATTRIBUTE, FIXString::from(v));
1013    }
1014
1015    /// Gets `OptAttribute`, Tag 206.
1016    pub fn get_opt_attribute(&self) -> Result<String, MessageRejectErrorEnum> {
1017        let mut fld = field::OptAttributeField::new(String::new());
1018        self.message.body.get_field(tag::OPT_ATTRIBUTE, &mut fld.0)?;
1019        Ok(fld.value().to_string())
1020    }
1021
1022
1023    /// Returns true if `OptAttribute` is present, Tag 206.
1024    pub fn has_opt_attribute(&self) -> bool {
1025        self.message.body.has(tag::OPT_ATTRIBUTE)
1026    }
1027
1028
1029
1030
1031    /// Sets `OrdType`, Tag 40.
1032    pub fn set_ord_type(&mut self, v: String) {
1033        self.message.body.set_field(tag::ORD_TYPE, FIXString::from(v));
1034    }
1035
1036    /// Gets `OrdType`, Tag 40.
1037    pub fn get_ord_type(&self) -> Result<String, MessageRejectErrorEnum> {
1038        let mut fld = field::OrdTypeField::new(String::new());
1039        self.message.body.get_field(tag::ORD_TYPE, &mut fld.0)?;
1040        Ok(fld.value().to_string())
1041    }
1042
1043
1044    /// Returns true if `OrdType` is present, Tag 40.
1045    pub fn has_ord_type(&self) -> bool {
1046        self.message.body.has(tag::ORD_TYPE)
1047    }
1048
1049
1050
1051
1052    /// Sets `OrderQty`, Tag 38.
1053    pub fn set_order_qty(&mut self, val: Decimal, scale: i32) {
1054        self.message.body.set_field(tag::ORDER_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1055    }
1056
1057    /// Gets `OrderQty`, Tag 38.
1058    pub fn get_order_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1059        let mut fld = field::OrderQtyField::new(Decimal::ZERO, 0);
1060        self.message.body.get_field(tag::ORDER_QTY, &mut fld.0)?;
1061        Ok(fld.value())
1062    }
1063
1064
1065    /// Returns true if `OrderQty` is present, Tag 38.
1066    pub fn has_order_qty(&self) -> bool {
1067        self.message.body.has(tag::ORDER_QTY)
1068    }
1069
1070
1071
1072
1073    /// Sets `OrderQty2`, Tag 192.
1074    pub fn set_order_qty2(&mut self, val: Decimal, scale: i32) {
1075        self.message.body.set_field(tag::ORDER_QTY2, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1076    }
1077
1078    /// Gets `OrderQty2`, Tag 192.
1079    pub fn get_order_qty2(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1080        let mut fld = field::OrderQty2Field::new(Decimal::ZERO, 0);
1081        self.message.body.get_field(tag::ORDER_QTY2, &mut fld.0)?;
1082        Ok(fld.value())
1083    }
1084
1085
1086    /// Returns true if `OrderQty2` is present, Tag 192.
1087    pub fn has_order_qty2(&self) -> bool {
1088        self.message.body.has(tag::ORDER_QTY2)
1089    }
1090
1091
1092
1093
1094    /// Sets `PegDifference`, Tag 211.
1095    pub fn set_peg_difference(&mut self, val: Decimal, scale: i32) {
1096        self.message.body.set_field(tag::PEG_DIFFERENCE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1097    }
1098
1099    /// Gets `PegDifference`, Tag 211.
1100    pub fn get_peg_difference(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1101        let mut fld = field::PegDifferenceField::new(Decimal::ZERO, 0);
1102        self.message.body.get_field(tag::PEG_DIFFERENCE, &mut fld.0)?;
1103        Ok(fld.value())
1104    }
1105
1106
1107    /// Returns true if `PegDifference` is present, Tag 211.
1108    pub fn has_peg_difference(&self) -> bool {
1109        self.message.body.has(tag::PEG_DIFFERENCE)
1110    }
1111
1112
1113
1114
1115    /// Sets `PrevClosePx`, Tag 140.
1116    pub fn set_prev_close_px(&mut self, val: Decimal, scale: i32) {
1117        self.message.body.set_field(tag::PREV_CLOSE_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1118    }
1119
1120    /// Gets `PrevClosePx`, Tag 140.
1121    pub fn get_prev_close_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1122        let mut fld = field::PrevClosePxField::new(Decimal::ZERO, 0);
1123        self.message.body.get_field(tag::PREV_CLOSE_PX, &mut fld.0)?;
1124        Ok(fld.value())
1125    }
1126
1127
1128    /// Returns true if `PrevClosePx` is present, Tag 140.
1129    pub fn has_prev_close_px(&self) -> bool {
1130        self.message.body.has(tag::PREV_CLOSE_PX)
1131    }
1132
1133
1134
1135
1136    /// Sets `Price`, Tag 44.
1137    pub fn set_price(&mut self, val: Decimal, scale: i32) {
1138        self.message.body.set_field(tag::PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1139    }
1140
1141    /// Gets `Price`, Tag 44.
1142    pub fn get_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1143        let mut fld = field::PriceField::new(Decimal::ZERO, 0);
1144        self.message.body.get_field(tag::PRICE, &mut fld.0)?;
1145        Ok(fld.value())
1146    }
1147
1148
1149    /// Returns true if `Price` is present, Tag 44.
1150    pub fn has_price(&self) -> bool {
1151        self.message.body.has(tag::PRICE)
1152    }
1153
1154
1155
1156
1157    /// Sets `ProcessCode`, Tag 81.
1158    pub fn set_process_code(&mut self, v: String) {
1159        self.message.body.set_field(tag::PROCESS_CODE, FIXString::from(v));
1160    }
1161
1162    /// Gets `ProcessCode`, Tag 81.
1163    pub fn get_process_code(&self) -> Result<String, MessageRejectErrorEnum> {
1164        let mut fld = field::ProcessCodeField::new(String::new());
1165        self.message.body.get_field(tag::PROCESS_CODE, &mut fld.0)?;
1166        Ok(fld.value().to_string())
1167    }
1168
1169
1170    /// Returns true if `ProcessCode` is present, Tag 81.
1171    pub fn has_process_code(&self) -> bool {
1172        self.message.body.has(tag::PROCESS_CODE)
1173    }
1174
1175
1176
1177
1178    /// Sets `PutOrCall`, Tag 201.
1179    pub fn set_put_or_call(&mut self, v: isize) {
1180        self.message.body.set_field(tag::PUT_OR_CALL, fixer::fix_int::FIXInt::from(v));
1181    }
1182
1183    /// Gets `PutOrCall`, Tag 201.
1184    pub fn get_put_or_call(&self) -> Result<isize, MessageRejectErrorEnum> {
1185        let mut fld = field::PutOrCallField::new(0);
1186        self.message.body.get_field(tag::PUT_OR_CALL, &mut fld.0)?;
1187        Ok(fld.value())
1188    }
1189
1190
1191    /// Returns true if `PutOrCall` is present, Tag 201.
1192    pub fn has_put_or_call(&self) -> bool {
1193        self.message.body.has(tag::PUT_OR_CALL)
1194    }
1195
1196
1197
1198
1199    /// Sets `QuoteID`, Tag 117.
1200    pub fn set_quote_id(&mut self, v: String) {
1201        self.message.body.set_field(tag::QUOTE_ID, FIXString::from(v));
1202    }
1203
1204    /// Gets `QuoteID`, Tag 117.
1205    pub fn get_quote_id(&self) -> Result<String, MessageRejectErrorEnum> {
1206        let mut fld = field::QuoteIDField::new(String::new());
1207        self.message.body.get_field(tag::QUOTE_ID, &mut fld.0)?;
1208        Ok(fld.value().to_string())
1209    }
1210
1211
1212    /// Returns true if `QuoteID` is present, Tag 117.
1213    pub fn has_quote_id(&self) -> bool {
1214        self.message.body.has(tag::QUOTE_ID)
1215    }
1216
1217
1218
1219
1220    /// Sets `Rule80A`, Tag 47.
1221    pub fn set_rule80_a(&mut self, v: String) {
1222        self.message.body.set_field(tag::RULE80_A, FIXString::from(v));
1223    }
1224
1225    /// Gets `Rule80A`, Tag 47.
1226    pub fn get_rule80_a(&self) -> Result<String, MessageRejectErrorEnum> {
1227        let mut fld = field::Rule80AField::new(String::new());
1228        self.message.body.get_field(tag::RULE80_A, &mut fld.0)?;
1229        Ok(fld.value().to_string())
1230    }
1231
1232
1233    /// Returns true if `Rule80A` is present, Tag 47.
1234    pub fn has_rule80_a(&self) -> bool {
1235        self.message.body.has(tag::RULE80_A)
1236    }
1237
1238
1239
1240
1241    /// Sets `SecurityDesc`, Tag 107.
1242    pub fn set_security_desc(&mut self, v: String) {
1243        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
1244    }
1245
1246    /// Gets `SecurityDesc`, Tag 107.
1247    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
1248        let mut fld = field::SecurityDescField::new(String::new());
1249        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
1250        Ok(fld.value().to_string())
1251    }
1252
1253
1254    /// Returns true if `SecurityDesc` is present, Tag 107.
1255    pub fn has_security_desc(&self) -> bool {
1256        self.message.body.has(tag::SECURITY_DESC)
1257    }
1258
1259
1260
1261
1262    /// Sets `SecurityExchange`, Tag 207.
1263    pub fn set_security_exchange(&mut self, v: String) {
1264        self.message.body.set_field(tag::SECURITY_EXCHANGE, FIXString::from(v));
1265    }
1266
1267    /// Gets `SecurityExchange`, Tag 207.
1268    pub fn get_security_exchange(&self) -> Result<String, MessageRejectErrorEnum> {
1269        let mut fld = field::SecurityExchangeField::new(String::new());
1270        self.message.body.get_field(tag::SECURITY_EXCHANGE, &mut fld.0)?;
1271        Ok(fld.value().to_string())
1272    }
1273
1274
1275    /// Returns true if `SecurityExchange` is present, Tag 207.
1276    pub fn has_security_exchange(&self) -> bool {
1277        self.message.body.has(tag::SECURITY_EXCHANGE)
1278    }
1279
1280
1281
1282
1283    /// Sets `SecurityID`, Tag 48.
1284    pub fn set_security_id(&mut self, v: String) {
1285        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
1286    }
1287
1288    /// Gets `SecurityID`, Tag 48.
1289    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
1290        let mut fld = field::SecurityIDField::new(String::new());
1291        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
1292        Ok(fld.value().to_string())
1293    }
1294
1295
1296    /// Returns true if `SecurityID` is present, Tag 48.
1297    pub fn has_security_id(&self) -> bool {
1298        self.message.body.has(tag::SECURITY_ID)
1299    }
1300
1301
1302
1303
1304    /// Sets `SecurityType`, Tag 167.
1305    pub fn set_security_type(&mut self, v: String) {
1306        self.message.body.set_field(tag::SECURITY_TYPE, FIXString::from(v));
1307    }
1308
1309    /// Gets `SecurityType`, Tag 167.
1310    pub fn get_security_type(&self) -> Result<String, MessageRejectErrorEnum> {
1311        let mut fld = field::SecurityTypeField::new(String::new());
1312        self.message.body.get_field(tag::SECURITY_TYPE, &mut fld.0)?;
1313        Ok(fld.value().to_string())
1314    }
1315
1316
1317    /// Returns true if `SecurityType` is present, Tag 167.
1318    pub fn has_security_type(&self) -> bool {
1319        self.message.body.has(tag::SECURITY_TYPE)
1320    }
1321
1322
1323
1324
1325    /// Sets `SettlCurrency`, Tag 120.
1326    pub fn set_settl_currency(&mut self, v: String) {
1327        self.message.body.set_field(tag::SETTL_CURRENCY, FIXString::from(v));
1328    }
1329
1330    /// Gets `SettlCurrency`, Tag 120.
1331    pub fn get_settl_currency(&self) -> Result<String, MessageRejectErrorEnum> {
1332        let mut fld = field::SettlCurrencyField::new(String::new());
1333        self.message.body.get_field(tag::SETTL_CURRENCY, &mut fld.0)?;
1334        Ok(fld.value().to_string())
1335    }
1336
1337
1338    /// Returns true if `SettlCurrency` is present, Tag 120.
1339    pub fn has_settl_currency(&self) -> bool {
1340        self.message.body.has(tag::SETTL_CURRENCY)
1341    }
1342
1343
1344
1345
1346    /// Sets `SettlmntTyp`, Tag 63.
1347    pub fn set_settlmnt_typ(&mut self, v: String) {
1348        self.message.body.set_field(tag::SETTLMNT_TYP, FIXString::from(v));
1349    }
1350
1351    /// Gets `SettlmntTyp`, Tag 63.
1352    pub fn get_settlmnt_typ(&self) -> Result<String, MessageRejectErrorEnum> {
1353        let mut fld = field::SettlmntTypField::new(String::new());
1354        self.message.body.get_field(tag::SETTLMNT_TYP, &mut fld.0)?;
1355        Ok(fld.value().to_string())
1356    }
1357
1358
1359    /// Returns true if `SettlmntTyp` is present, Tag 63.
1360    pub fn has_settlmnt_typ(&self) -> bool {
1361        self.message.body.has(tag::SETTLMNT_TYP)
1362    }
1363
1364
1365
1366
1367    /// Sets `Side`, Tag 54.
1368    pub fn set_side(&mut self, v: String) {
1369        self.message.body.set_field(tag::SIDE, FIXString::from(v));
1370    }
1371
1372    /// Gets `Side`, Tag 54.
1373    pub fn get_side(&self) -> Result<String, MessageRejectErrorEnum> {
1374        let mut fld = field::SideField::new(String::new());
1375        self.message.body.get_field(tag::SIDE, &mut fld.0)?;
1376        Ok(fld.value().to_string())
1377    }
1378
1379
1380    /// Returns true if `Side` is present, Tag 54.
1381    pub fn has_side(&self) -> bool {
1382        self.message.body.has(tag::SIDE)
1383    }
1384
1385
1386
1387
1388    /// Sets `SolicitedFlag`, Tag 377.
1389    pub fn set_solicited_flag(&mut self, v: bool) {
1390        self.message.body.set_field(tag::SOLICITED_FLAG, fixer::fix_boolean::FIXBoolean::from(v));
1391    }
1392
1393    /// Gets `SolicitedFlag`, Tag 377.
1394    pub fn get_solicited_flag(&self) -> Result<bool, MessageRejectErrorEnum> {
1395        let mut fld = field::SolicitedFlagField::new(false);
1396        self.message.body.get_field(tag::SOLICITED_FLAG, &mut fld.0)?;
1397        Ok(fld.value())
1398    }
1399
1400
1401    /// Returns true if `SolicitedFlag` is present, Tag 377.
1402    pub fn has_solicited_flag(&self) -> bool {
1403        self.message.body.has(tag::SOLICITED_FLAG)
1404    }
1405
1406
1407
1408
1409    /// Sets `StopPx`, Tag 99.
1410    pub fn set_stop_px(&mut self, val: Decimal, scale: i32) {
1411        self.message.body.set_field(tag::STOP_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1412    }
1413
1414    /// Gets `StopPx`, Tag 99.
1415    pub fn get_stop_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1416        let mut fld = field::StopPxField::new(Decimal::ZERO, 0);
1417        self.message.body.get_field(tag::STOP_PX, &mut fld.0)?;
1418        Ok(fld.value())
1419    }
1420
1421
1422    /// Returns true if `StopPx` is present, Tag 99.
1423    pub fn has_stop_px(&self) -> bool {
1424        self.message.body.has(tag::STOP_PX)
1425    }
1426
1427
1428
1429
1430    /// Sets `StrikePrice`, Tag 202.
1431    pub fn set_strike_price(&mut self, val: Decimal, scale: i32) {
1432        self.message.body.set_field(tag::STRIKE_PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1433    }
1434
1435    /// Gets `StrikePrice`, Tag 202.
1436    pub fn get_strike_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1437        let mut fld = field::StrikePriceField::new(Decimal::ZERO, 0);
1438        self.message.body.get_field(tag::STRIKE_PRICE, &mut fld.0)?;
1439        Ok(fld.value())
1440    }
1441
1442
1443    /// Returns true if `StrikePrice` is present, Tag 202.
1444    pub fn has_strike_price(&self) -> bool {
1445        self.message.body.has(tag::STRIKE_PRICE)
1446    }
1447
1448
1449
1450
1451    /// Sets `Symbol`, Tag 55.
1452    pub fn set_symbol(&mut self, v: String) {
1453        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
1454    }
1455
1456    /// Gets `Symbol`, Tag 55.
1457    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
1458        let mut fld = field::SymbolField::new(String::new());
1459        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
1460        Ok(fld.value().to_string())
1461    }
1462
1463
1464    /// Returns true if `Symbol` is present, Tag 55.
1465    pub fn has_symbol(&self) -> bool {
1466        self.message.body.has(tag::SYMBOL)
1467    }
1468
1469
1470
1471
1472    /// Sets `SymbolSfx`, Tag 65.
1473    pub fn set_symbol_sfx(&mut self, v: String) {
1474        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
1475    }
1476
1477    /// Gets `SymbolSfx`, Tag 65.
1478    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
1479        let mut fld = field::SymbolSfxField::new(String::new());
1480        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
1481        Ok(fld.value().to_string())
1482    }
1483
1484
1485    /// Returns true if `SymbolSfx` is present, Tag 65.
1486    pub fn has_symbol_sfx(&self) -> bool {
1487        self.message.body.has(tag::SYMBOL_SFX)
1488    }
1489
1490
1491
1492
1493    /// Sets `Text`, Tag 58.
1494    pub fn set_text(&mut self, v: String) {
1495        self.message.body.set_field(tag::TEXT, FIXString::from(v));
1496    }
1497
1498    /// Gets `Text`, Tag 58.
1499    pub fn get_text(&self) -> Result<String, MessageRejectErrorEnum> {
1500        let mut fld = field::TextField::new(String::new());
1501        self.message.body.get_field(tag::TEXT, &mut fld.0)?;
1502        Ok(fld.value().to_string())
1503    }
1504
1505
1506    /// Returns true if `Text` is present, Tag 58.
1507    pub fn has_text(&self) -> bool {
1508        self.message.body.has(tag::TEXT)
1509    }
1510
1511
1512
1513
1514    /// Sets `TimeInForce`, Tag 59.
1515    pub fn set_time_in_force(&mut self, v: String) {
1516        self.message.body.set_field(tag::TIME_IN_FORCE, FIXString::from(v));
1517    }
1518
1519    /// Gets `TimeInForce`, Tag 59.
1520    pub fn get_time_in_force(&self) -> Result<String, MessageRejectErrorEnum> {
1521        let mut fld = field::TimeInForceField::new(String::new());
1522        self.message.body.get_field(tag::TIME_IN_FORCE, &mut fld.0)?;
1523        Ok(fld.value().to_string())
1524    }
1525
1526
1527    /// Returns true if `TimeInForce` is present, Tag 59.
1528    pub fn has_time_in_force(&self) -> bool {
1529        self.message.body.has(tag::TIME_IN_FORCE)
1530    }
1531
1532
1533
1534
1535    /// Sets `TransactTime`, Tag 60.
1536    pub fn set_transact_time(&mut self, v: Timestamp) {
1537        self.message.body.set_field(tag::TRANSACT_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
1538            time: v,
1539            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
1540        });
1541    }
1542
1543    /// Gets `TransactTime`, Tag 60.
1544    pub fn get_transact_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
1545        let mut fld = field::TransactTimeField::new(Timestamp::UNIX_EPOCH);
1546        self.message.body.get_field(tag::TRANSACT_TIME, &mut fld.0)?;
1547        Ok(fld.value())
1548    }
1549
1550
1551    /// Returns true if `TransactTime` is present, Tag 60.
1552    pub fn has_transact_time(&self) -> bool {
1553        self.message.body.has(tag::TRANSACT_TIME)
1554    }
1555
1556
1557}
1558
1559/// `RouteOut` is the callback type for routing `NewOrderSingle` messages.
1560pub type RouteOut = fn(msg: NewOrderSingle, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
1561
1562/// Route type returned by the `route` function.
1563pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
1564
1565/// Returns the begin string, message type, and route function for `NewOrderSingle`.
1566pub fn route(router: RouteOut) -> Route {
1567    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
1568        router(NewOrderSingle::from_message(msg.clone()), session_id)
1569    };
1570    ("FIX.4.2", "D", Box::new(r))
1571}