Skip to main content

fixer_fix/fix40/
execution_report.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/// `ExecutionReport` is the `fix40` `ExecutionReport` type, `MsgType` = 8.
21pub struct ExecutionReport {
22    pub message: Message,
23}
24
25impl ExecutionReport {
26    /// Creates a new `ExecutionReport` with required fields.
27    pub fn new(order_id: field::OrderIDField, exec_id: field::ExecIDField, exec_trans_type: field::ExecTransTypeField, ord_status: field::OrdStatusField, symbol: field::SymbolField, side: field::SideField, order_qty: field::OrderQtyField, last_shares: field::LastSharesField, last_px: field::LastPxField, cum_qty: field::CumQtyField, avg_px: field::AvgPxField) -> Self {
28        let mut msg = Message::new();
29        msg.header.set_field(tag::MSG_TYPE, FIXString::from("8".to_string()));
30
31        msg.body.set_field(tag::ORDER_ID, order_id.0);
32
33        msg.body.set_field(tag::EXEC_ID, exec_id.0);
34
35        msg.body.set_field(tag::EXEC_TRANS_TYPE, exec_trans_type.0);
36
37        msg.body.set_field(tag::ORD_STATUS, ord_status.0);
38
39        msg.body.set_field(tag::SYMBOL, symbol.0);
40
41        msg.body.set_field(tag::SIDE, side.0);
42
43        msg.body.set_field(tag::ORDER_QTY, order_qty.0);
44
45        msg.body.set_field(tag::LAST_SHARES, last_shares.0);
46
47        msg.body.set_field(tag::LAST_PX, last_px.0);
48
49        msg.body.set_field(tag::CUM_QTY, cum_qty.0);
50
51        msg.body.set_field(tag::AVG_PX, avg_px.0);
52
53        Self { message: msg }
54    }
55
56    /// Creates a `ExecutionReport` from an existing `Message`.
57    pub fn from_message(msg: Message) -> Self {
58        Self { message: msg }
59    }
60
61    /// Returns the underlying `Message`.
62    pub fn to_message(self) -> Message {
63        self.message
64    }
65
66
67
68
69    /// Sets `Account`, Tag 1.
70    pub fn set_account(&mut self, v: String) {
71        self.message.body.set_field(tag::ACCOUNT, FIXString::from(v));
72    }
73
74    /// Gets `Account`, Tag 1.
75    pub fn get_account(&self) -> Result<String, MessageRejectErrorEnum> {
76        let mut fld = field::AccountField::new(String::new());
77        self.message.body.get_field(tag::ACCOUNT, &mut fld.0)?;
78        Ok(fld.value().to_string())
79    }
80
81
82    /// Returns true if `Account` is present, Tag 1.
83    pub fn has_account(&self) -> bool {
84        self.message.body.has(tag::ACCOUNT)
85    }
86
87
88
89
90    /// Sets `AvgPx`, Tag 6.
91    pub fn set_avg_px(&mut self, val: Decimal, scale: i32) {
92        self.message.body.set_field(tag::AVG_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
93    }
94
95    /// Gets `AvgPx`, Tag 6.
96    pub fn get_avg_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
97        let mut fld = field::AvgPxField::new(Decimal::ZERO, 0);
98        self.message.body.get_field(tag::AVG_PX, &mut fld.0)?;
99        Ok(fld.value())
100    }
101
102
103    /// Returns true if `AvgPx` is present, Tag 6.
104    pub fn has_avg_px(&self) -> bool {
105        self.message.body.has(tag::AVG_PX)
106    }
107
108
109
110
111    /// Sets `ClOrdID`, Tag 11.
112    pub fn set_cl_ord_id(&mut self, v: String) {
113        self.message.body.set_field(tag::CL_ORD_ID, FIXString::from(v));
114    }
115
116    /// Gets `ClOrdID`, Tag 11.
117    pub fn get_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
118        let mut fld = field::ClOrdIDField::new(String::new());
119        self.message.body.get_field(tag::CL_ORD_ID, &mut fld.0)?;
120        Ok(fld.value().to_string())
121    }
122
123
124    /// Returns true if `ClOrdID` is present, Tag 11.
125    pub fn has_cl_ord_id(&self) -> bool {
126        self.message.body.has(tag::CL_ORD_ID)
127    }
128
129
130
131
132    /// Sets `ClientID`, Tag 109.
133    pub fn set_client_id(&mut self, v: String) {
134        self.message.body.set_field(tag::CLIENT_ID, FIXString::from(v));
135    }
136
137    /// Gets `ClientID`, Tag 109.
138    pub fn get_client_id(&self) -> Result<String, MessageRejectErrorEnum> {
139        let mut fld = field::ClientIDField::new(String::new());
140        self.message.body.get_field(tag::CLIENT_ID, &mut fld.0)?;
141        Ok(fld.value().to_string())
142    }
143
144
145    /// Returns true if `ClientID` is present, Tag 109.
146    pub fn has_client_id(&self) -> bool {
147        self.message.body.has(tag::CLIENT_ID)
148    }
149
150
151
152
153    /// Sets `CommType`, Tag 13.
154    pub fn set_comm_type(&mut self, v: String) {
155        self.message.body.set_field(tag::COMM_TYPE, FIXString::from(v));
156    }
157
158    /// Gets `CommType`, Tag 13.
159    pub fn get_comm_type(&self) -> Result<String, MessageRejectErrorEnum> {
160        let mut fld = field::CommTypeField::new(String::new());
161        self.message.body.get_field(tag::COMM_TYPE, &mut fld.0)?;
162        Ok(fld.value().to_string())
163    }
164
165
166    /// Returns true if `CommType` is present, Tag 13.
167    pub fn has_comm_type(&self) -> bool {
168        self.message.body.has(tag::COMM_TYPE)
169    }
170
171
172
173
174    /// Sets `Commission`, Tag 12.
175    pub fn set_commission(&mut self, val: Decimal, scale: i32) {
176        self.message.body.set_field(tag::COMMISSION, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
177    }
178
179    /// Gets `Commission`, Tag 12.
180    pub fn get_commission(&self) -> Result<Decimal, MessageRejectErrorEnum> {
181        let mut fld = field::CommissionField::new(Decimal::ZERO, 0);
182        self.message.body.get_field(tag::COMMISSION, &mut fld.0)?;
183        Ok(fld.value())
184    }
185
186
187    /// Returns true if `Commission` is present, Tag 12.
188    pub fn has_commission(&self) -> bool {
189        self.message.body.has(tag::COMMISSION)
190    }
191
192
193
194
195    /// Sets `CumQty`, Tag 14.
196    pub fn set_cum_qty(&mut self, val: Decimal, scale: i32) {
197        self.message.body.set_field(tag::CUM_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
198    }
199
200    /// Gets `CumQty`, Tag 14.
201    pub fn get_cum_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
202        let mut fld = field::CumQtyField::new(Decimal::ZERO, 0);
203        self.message.body.get_field(tag::CUM_QTY, &mut fld.0)?;
204        Ok(fld.value())
205    }
206
207
208    /// Returns true if `CumQty` is present, Tag 14.
209    pub fn has_cum_qty(&self) -> bool {
210        self.message.body.has(tag::CUM_QTY)
211    }
212
213
214
215
216    /// Sets `Currency`, Tag 15.
217    pub fn set_currency(&mut self, v: String) {
218        self.message.body.set_field(tag::CURRENCY, FIXString::from(v));
219    }
220
221    /// Gets `Currency`, Tag 15.
222    pub fn get_currency(&self) -> Result<String, MessageRejectErrorEnum> {
223        let mut fld = field::CurrencyField::new(String::new());
224        self.message.body.get_field(tag::CURRENCY, &mut fld.0)?;
225        Ok(fld.value().to_string())
226    }
227
228
229    /// Returns true if `Currency` is present, Tag 15.
230    pub fn has_currency(&self) -> bool {
231        self.message.body.has(tag::CURRENCY)
232    }
233
234
235
236
237    /// Sets `ExecBroker`, Tag 76.
238    pub fn set_exec_broker(&mut self, v: String) {
239        self.message.body.set_field(tag::EXEC_BROKER, FIXString::from(v));
240    }
241
242    /// Gets `ExecBroker`, Tag 76.
243    pub fn get_exec_broker(&self) -> Result<String, MessageRejectErrorEnum> {
244        let mut fld = field::ExecBrokerField::new(String::new());
245        self.message.body.get_field(tag::EXEC_BROKER, &mut fld.0)?;
246        Ok(fld.value().to_string())
247    }
248
249
250    /// Returns true if `ExecBroker` is present, Tag 76.
251    pub fn has_exec_broker(&self) -> bool {
252        self.message.body.has(tag::EXEC_BROKER)
253    }
254
255
256
257
258    /// Sets `ExecID`, Tag 17.
259    pub fn set_exec_id(&mut self, v: String) {
260        self.message.body.set_field(tag::EXEC_ID, FIXString::from(v));
261    }
262
263    /// Gets `ExecID`, Tag 17.
264    pub fn get_exec_id(&self) -> Result<String, MessageRejectErrorEnum> {
265        let mut fld = field::ExecIDField::new(String::new());
266        self.message.body.get_field(tag::EXEC_ID, &mut fld.0)?;
267        Ok(fld.value().to_string())
268    }
269
270
271    /// Returns true if `ExecID` is present, Tag 17.
272    pub fn has_exec_id(&self) -> bool {
273        self.message.body.has(tag::EXEC_ID)
274    }
275
276
277
278
279    /// Sets `ExecInst`, Tag 18.
280    pub fn set_exec_inst(&mut self, v: String) {
281        self.message.body.set_field(tag::EXEC_INST, FIXString::from(v));
282    }
283
284    /// Gets `ExecInst`, Tag 18.
285    pub fn get_exec_inst(&self) -> Result<String, MessageRejectErrorEnum> {
286        let mut fld = field::ExecInstField::new(String::new());
287        self.message.body.get_field(tag::EXEC_INST, &mut fld.0)?;
288        Ok(fld.value().to_string())
289    }
290
291
292    /// Returns true if `ExecInst` is present, Tag 18.
293    pub fn has_exec_inst(&self) -> bool {
294        self.message.body.has(tag::EXEC_INST)
295    }
296
297
298
299
300    /// Sets `ExecRefID`, Tag 19.
301    pub fn set_exec_ref_id(&mut self, v: String) {
302        self.message.body.set_field(tag::EXEC_REF_ID, FIXString::from(v));
303    }
304
305    /// Gets `ExecRefID`, Tag 19.
306    pub fn get_exec_ref_id(&self) -> Result<String, MessageRejectErrorEnum> {
307        let mut fld = field::ExecRefIDField::new(String::new());
308        self.message.body.get_field(tag::EXEC_REF_ID, &mut fld.0)?;
309        Ok(fld.value().to_string())
310    }
311
312
313    /// Returns true if `ExecRefID` is present, Tag 19.
314    pub fn has_exec_ref_id(&self) -> bool {
315        self.message.body.has(tag::EXEC_REF_ID)
316    }
317
318
319
320
321    /// Sets `ExecTransType`, Tag 20.
322    pub fn set_exec_trans_type(&mut self, v: String) {
323        self.message.body.set_field(tag::EXEC_TRANS_TYPE, FIXString::from(v));
324    }
325
326    /// Gets `ExecTransType`, Tag 20.
327    pub fn get_exec_trans_type(&self) -> Result<String, MessageRejectErrorEnum> {
328        let mut fld = field::ExecTransTypeField::new(String::new());
329        self.message.body.get_field(tag::EXEC_TRANS_TYPE, &mut fld.0)?;
330        Ok(fld.value().to_string())
331    }
332
333
334    /// Returns true if `ExecTransType` is present, Tag 20.
335    pub fn has_exec_trans_type(&self) -> bool {
336        self.message.body.has(tag::EXEC_TRANS_TYPE)
337    }
338
339
340
341
342    /// Sets `ExpireTime`, Tag 126.
343    pub fn set_expire_time(&mut self, v: Timestamp) {
344        self.message.body.set_field(tag::EXPIRE_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
345            time: v,
346            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
347        });
348    }
349
350    /// Gets `ExpireTime`, Tag 126.
351    pub fn get_expire_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
352        let mut fld = field::ExpireTimeField::new(Timestamp::UNIX_EPOCH);
353        self.message.body.get_field(tag::EXPIRE_TIME, &mut fld.0)?;
354        Ok(fld.value())
355    }
356
357
358    /// Returns true if `ExpireTime` is present, Tag 126.
359    pub fn has_expire_time(&self) -> bool {
360        self.message.body.has(tag::EXPIRE_TIME)
361    }
362
363
364
365
366    /// Sets `FutSettDate`, Tag 64.
367    pub fn set_fut_sett_date(&mut self, v: String) {
368        self.message.body.set_field(tag::FUT_SETT_DATE, FIXString::from(v));
369    }
370
371    /// Gets `FutSettDate`, Tag 64.
372    pub fn get_fut_sett_date(&self) -> Result<String, MessageRejectErrorEnum> {
373        let mut fld = field::FutSettDateField::new(String::new());
374        self.message.body.get_field(tag::FUT_SETT_DATE, &mut fld.0)?;
375        Ok(fld.value().to_string())
376    }
377
378
379    /// Returns true if `FutSettDate` is present, Tag 64.
380    pub fn has_fut_sett_date(&self) -> bool {
381        self.message.body.has(tag::FUT_SETT_DATE)
382    }
383
384
385
386
387    /// Sets `IDSource`, Tag 22.
388    pub fn set_id_source(&mut self, v: String) {
389        self.message.body.set_field(tag::ID_SOURCE, FIXString::from(v));
390    }
391
392    /// Gets `IDSource`, Tag 22.
393    pub fn get_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
394        let mut fld = field::IDSourceField::new(String::new());
395        self.message.body.get_field(tag::ID_SOURCE, &mut fld.0)?;
396        Ok(fld.value().to_string())
397    }
398
399
400    /// Returns true if `IDSource` is present, Tag 22.
401    pub fn has_id_source(&self) -> bool {
402        self.message.body.has(tag::ID_SOURCE)
403    }
404
405
406
407
408    /// Sets `Issuer`, Tag 106.
409    pub fn set_issuer(&mut self, v: String) {
410        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
411    }
412
413    /// Gets `Issuer`, Tag 106.
414    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
415        let mut fld = field::IssuerField::new(String::new());
416        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
417        Ok(fld.value().to_string())
418    }
419
420
421    /// Returns true if `Issuer` is present, Tag 106.
422    pub fn has_issuer(&self) -> bool {
423        self.message.body.has(tag::ISSUER)
424    }
425
426
427
428
429    /// Sets `LastCapacity`, Tag 29.
430    pub fn set_last_capacity(&mut self, v: String) {
431        self.message.body.set_field(tag::LAST_CAPACITY, FIXString::from(v));
432    }
433
434    /// Gets `LastCapacity`, Tag 29.
435    pub fn get_last_capacity(&self) -> Result<String, MessageRejectErrorEnum> {
436        let mut fld = field::LastCapacityField::new(String::new());
437        self.message.body.get_field(tag::LAST_CAPACITY, &mut fld.0)?;
438        Ok(fld.value().to_string())
439    }
440
441
442    /// Returns true if `LastCapacity` is present, Tag 29.
443    pub fn has_last_capacity(&self) -> bool {
444        self.message.body.has(tag::LAST_CAPACITY)
445    }
446
447
448
449
450    /// Sets `LastMkt`, Tag 30.
451    pub fn set_last_mkt(&mut self, v: String) {
452        self.message.body.set_field(tag::LAST_MKT, FIXString::from(v));
453    }
454
455    /// Gets `LastMkt`, Tag 30.
456    pub fn get_last_mkt(&self) -> Result<String, MessageRejectErrorEnum> {
457        let mut fld = field::LastMktField::new(String::new());
458        self.message.body.get_field(tag::LAST_MKT, &mut fld.0)?;
459        Ok(fld.value().to_string())
460    }
461
462
463    /// Returns true if `LastMkt` is present, Tag 30.
464    pub fn has_last_mkt(&self) -> bool {
465        self.message.body.has(tag::LAST_MKT)
466    }
467
468
469
470
471    /// Sets `LastPx`, Tag 31.
472    pub fn set_last_px(&mut self, val: Decimal, scale: i32) {
473        self.message.body.set_field(tag::LAST_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
474    }
475
476    /// Gets `LastPx`, Tag 31.
477    pub fn get_last_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
478        let mut fld = field::LastPxField::new(Decimal::ZERO, 0);
479        self.message.body.get_field(tag::LAST_PX, &mut fld.0)?;
480        Ok(fld.value())
481    }
482
483
484    /// Returns true if `LastPx` is present, Tag 31.
485    pub fn has_last_px(&self) -> bool {
486        self.message.body.has(tag::LAST_PX)
487    }
488
489
490
491
492    /// Sets `LastShares`, Tag 32.
493    pub fn set_last_shares(&mut self, val: Decimal, scale: i32) {
494        self.message.body.set_field(tag::LAST_SHARES, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
495    }
496
497    /// Gets `LastShares`, Tag 32.
498    pub fn get_last_shares(&self) -> Result<Decimal, MessageRejectErrorEnum> {
499        let mut fld = field::LastSharesField::new(Decimal::ZERO, 0);
500        self.message.body.get_field(tag::LAST_SHARES, &mut fld.0)?;
501        Ok(fld.value())
502    }
503
504
505    /// Returns true if `LastShares` is present, Tag 32.
506    pub fn has_last_shares(&self) -> bool {
507        self.message.body.has(tag::LAST_SHARES)
508    }
509
510
511
512
513    /// Sets `ListID`, Tag 66.
514    pub fn set_list_id(&mut self, v: String) {
515        self.message.body.set_field(tag::LIST_ID, FIXString::from(v));
516    }
517
518    /// Gets `ListID`, Tag 66.
519    pub fn get_list_id(&self) -> Result<String, MessageRejectErrorEnum> {
520        let mut fld = field::ListIDField::new(String::new());
521        self.message.body.get_field(tag::LIST_ID, &mut fld.0)?;
522        Ok(fld.value().to_string())
523    }
524
525
526    /// Returns true if `ListID` is present, Tag 66.
527    pub fn has_list_id(&self) -> bool {
528        self.message.body.has(tag::LIST_ID)
529    }
530
531
532
533
534    /// Sets `NetMoney`, Tag 118.
535    pub fn set_net_money(&mut self, val: Decimal, scale: i32) {
536        self.message.body.set_field(tag::NET_MONEY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
537    }
538
539    /// Gets `NetMoney`, Tag 118.
540    pub fn get_net_money(&self) -> Result<Decimal, MessageRejectErrorEnum> {
541        let mut fld = field::NetMoneyField::new(Decimal::ZERO, 0);
542        self.message.body.get_field(tag::NET_MONEY, &mut fld.0)?;
543        Ok(fld.value())
544    }
545
546
547    /// Returns true if `NetMoney` is present, Tag 118.
548    pub fn has_net_money(&self) -> bool {
549        self.message.body.has(tag::NET_MONEY)
550    }
551
552
553
554
555    /// Sets `NoMiscFees`, Tag 136.
556    pub fn set_no_misc_fees(&mut self, v: isize) {
557        self.message.body.set_field(tag::NO_MISC_FEES, fixer::fix_int::FIXInt::from(v));
558    }
559
560    /// Gets `NoMiscFees`, Tag 136.
561    pub fn get_no_misc_fees(&self) -> Result<isize, MessageRejectErrorEnum> {
562        let mut fld = field::NoMiscFeesField::new(0);
563        self.message.body.get_field(tag::NO_MISC_FEES, &mut fld.0)?;
564        Ok(fld.value())
565    }
566
567
568    /// Returns true if `NoMiscFees` is present, Tag 136.
569    pub fn has_no_misc_fees(&self) -> bool {
570        self.message.body.has(tag::NO_MISC_FEES)
571    }
572
573
574
575
576    /// Sets `OrdRejReason`, Tag 103.
577    pub fn set_ord_rej_reason(&mut self, v: isize) {
578        self.message.body.set_field(tag::ORD_REJ_REASON, fixer::fix_int::FIXInt::from(v));
579    }
580
581    /// Gets `OrdRejReason`, Tag 103.
582    pub fn get_ord_rej_reason(&self) -> Result<isize, MessageRejectErrorEnum> {
583        let mut fld = field::OrdRejReasonField::new(0);
584        self.message.body.get_field(tag::ORD_REJ_REASON, &mut fld.0)?;
585        Ok(fld.value())
586    }
587
588
589    /// Returns true if `OrdRejReason` is present, Tag 103.
590    pub fn has_ord_rej_reason(&self) -> bool {
591        self.message.body.has(tag::ORD_REJ_REASON)
592    }
593
594
595
596
597    /// Sets `OrdStatus`, Tag 39.
598    pub fn set_ord_status(&mut self, v: String) {
599        self.message.body.set_field(tag::ORD_STATUS, FIXString::from(v));
600    }
601
602    /// Gets `OrdStatus`, Tag 39.
603    pub fn get_ord_status(&self) -> Result<String, MessageRejectErrorEnum> {
604        let mut fld = field::OrdStatusField::new(String::new());
605        self.message.body.get_field(tag::ORD_STATUS, &mut fld.0)?;
606        Ok(fld.value().to_string())
607    }
608
609
610    /// Returns true if `OrdStatus` is present, Tag 39.
611    pub fn has_ord_status(&self) -> bool {
612        self.message.body.has(tag::ORD_STATUS)
613    }
614
615
616
617
618    /// Sets `OrdType`, Tag 40.
619    pub fn set_ord_type(&mut self, v: String) {
620        self.message.body.set_field(tag::ORD_TYPE, FIXString::from(v));
621    }
622
623    /// Gets `OrdType`, Tag 40.
624    pub fn get_ord_type(&self) -> Result<String, MessageRejectErrorEnum> {
625        let mut fld = field::OrdTypeField::new(String::new());
626        self.message.body.get_field(tag::ORD_TYPE, &mut fld.0)?;
627        Ok(fld.value().to_string())
628    }
629
630
631    /// Returns true if `OrdType` is present, Tag 40.
632    pub fn has_ord_type(&self) -> bool {
633        self.message.body.has(tag::ORD_TYPE)
634    }
635
636
637
638
639    /// Sets `OrderID`, Tag 37.
640    pub fn set_order_id(&mut self, v: String) {
641        self.message.body.set_field(tag::ORDER_ID, FIXString::from(v));
642    }
643
644    /// Gets `OrderID`, Tag 37.
645    pub fn get_order_id(&self) -> Result<String, MessageRejectErrorEnum> {
646        let mut fld = field::OrderIDField::new(String::new());
647        self.message.body.get_field(tag::ORDER_ID, &mut fld.0)?;
648        Ok(fld.value().to_string())
649    }
650
651
652    /// Returns true if `OrderID` is present, Tag 37.
653    pub fn has_order_id(&self) -> bool {
654        self.message.body.has(tag::ORDER_ID)
655    }
656
657
658
659
660    /// Sets `OrderQty`, Tag 38.
661    pub fn set_order_qty(&mut self, val: Decimal, scale: i32) {
662        self.message.body.set_field(tag::ORDER_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
663    }
664
665    /// Gets `OrderQty`, Tag 38.
666    pub fn get_order_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
667        let mut fld = field::OrderQtyField::new(Decimal::ZERO, 0);
668        self.message.body.get_field(tag::ORDER_QTY, &mut fld.0)?;
669        Ok(fld.value())
670    }
671
672
673    /// Returns true if `OrderQty` is present, Tag 38.
674    pub fn has_order_qty(&self) -> bool {
675        self.message.body.has(tag::ORDER_QTY)
676    }
677
678
679
680
681    /// Sets `Price`, Tag 44.
682    pub fn set_price(&mut self, val: Decimal, scale: i32) {
683        self.message.body.set_field(tag::PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
684    }
685
686    /// Gets `Price`, Tag 44.
687    pub fn get_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
688        let mut fld = field::PriceField::new(Decimal::ZERO, 0);
689        self.message.body.get_field(tag::PRICE, &mut fld.0)?;
690        Ok(fld.value())
691    }
692
693
694    /// Returns true if `Price` is present, Tag 44.
695    pub fn has_price(&self) -> bool {
696        self.message.body.has(tag::PRICE)
697    }
698
699
700
701
702    /// Sets `ReportToExch`, Tag 113.
703    pub fn set_report_to_exch(&mut self, v: bool) {
704        self.message.body.set_field(tag::REPORT_TO_EXCH, fixer::fix_boolean::FIXBoolean::from(v));
705    }
706
707    /// Gets `ReportToExch`, Tag 113.
708    pub fn get_report_to_exch(&self) -> Result<bool, MessageRejectErrorEnum> {
709        let mut fld = field::ReportToExchField::new(false);
710        self.message.body.get_field(tag::REPORT_TO_EXCH, &mut fld.0)?;
711        Ok(fld.value())
712    }
713
714
715    /// Returns true if `ReportToExch` is present, Tag 113.
716    pub fn has_report_to_exch(&self) -> bool {
717        self.message.body.has(tag::REPORT_TO_EXCH)
718    }
719
720
721
722
723    /// Sets `Rule80A`, Tag 47.
724    pub fn set_rule80_a(&mut self, v: String) {
725        self.message.body.set_field(tag::RULE80_A, FIXString::from(v));
726    }
727
728    /// Gets `Rule80A`, Tag 47.
729    pub fn get_rule80_a(&self) -> Result<String, MessageRejectErrorEnum> {
730        let mut fld = field::Rule80AField::new(String::new());
731        self.message.body.get_field(tag::RULE80_A, &mut fld.0)?;
732        Ok(fld.value().to_string())
733    }
734
735
736    /// Returns true if `Rule80A` is present, Tag 47.
737    pub fn has_rule80_a(&self) -> bool {
738        self.message.body.has(tag::RULE80_A)
739    }
740
741
742
743
744    /// Sets `SecurityDesc`, Tag 107.
745    pub fn set_security_desc(&mut self, v: String) {
746        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
747    }
748
749    /// Gets `SecurityDesc`, Tag 107.
750    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
751        let mut fld = field::SecurityDescField::new(String::new());
752        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
753        Ok(fld.value().to_string())
754    }
755
756
757    /// Returns true if `SecurityDesc` is present, Tag 107.
758    pub fn has_security_desc(&self) -> bool {
759        self.message.body.has(tag::SECURITY_DESC)
760    }
761
762
763
764
765    /// Sets `SecurityID`, Tag 48.
766    pub fn set_security_id(&mut self, v: String) {
767        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
768    }
769
770    /// Gets `SecurityID`, Tag 48.
771    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
772        let mut fld = field::SecurityIDField::new(String::new());
773        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
774        Ok(fld.value().to_string())
775    }
776
777
778    /// Returns true if `SecurityID` is present, Tag 48.
779    pub fn has_security_id(&self) -> bool {
780        self.message.body.has(tag::SECURITY_ID)
781    }
782
783
784
785
786    /// Sets `SettlCurrAmt`, Tag 119.
787    pub fn set_settl_curr_amt(&mut self, val: Decimal, scale: i32) {
788        self.message.body.set_field(tag::SETTL_CURR_AMT, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
789    }
790
791    /// Gets `SettlCurrAmt`, Tag 119.
792    pub fn get_settl_curr_amt(&self) -> Result<Decimal, MessageRejectErrorEnum> {
793        let mut fld = field::SettlCurrAmtField::new(Decimal::ZERO, 0);
794        self.message.body.get_field(tag::SETTL_CURR_AMT, &mut fld.0)?;
795        Ok(fld.value())
796    }
797
798
799    /// Returns true if `SettlCurrAmt` is present, Tag 119.
800    pub fn has_settl_curr_amt(&self) -> bool {
801        self.message.body.has(tag::SETTL_CURR_AMT)
802    }
803
804
805
806
807    /// Sets `SettlCurrency`, Tag 120.
808    pub fn set_settl_currency(&mut self, v: String) {
809        self.message.body.set_field(tag::SETTL_CURRENCY, FIXString::from(v));
810    }
811
812    /// Gets `SettlCurrency`, Tag 120.
813    pub fn get_settl_currency(&self) -> Result<String, MessageRejectErrorEnum> {
814        let mut fld = field::SettlCurrencyField::new(String::new());
815        self.message.body.get_field(tag::SETTL_CURRENCY, &mut fld.0)?;
816        Ok(fld.value().to_string())
817    }
818
819
820    /// Returns true if `SettlCurrency` is present, Tag 120.
821    pub fn has_settl_currency(&self) -> bool {
822        self.message.body.has(tag::SETTL_CURRENCY)
823    }
824
825
826
827
828    /// Sets `SettlmntTyp`, Tag 63.
829    pub fn set_settlmnt_typ(&mut self, v: String) {
830        self.message.body.set_field(tag::SETTLMNT_TYP, FIXString::from(v));
831    }
832
833    /// Gets `SettlmntTyp`, Tag 63.
834    pub fn get_settlmnt_typ(&self) -> Result<String, MessageRejectErrorEnum> {
835        let mut fld = field::SettlmntTypField::new(String::new());
836        self.message.body.get_field(tag::SETTLMNT_TYP, &mut fld.0)?;
837        Ok(fld.value().to_string())
838    }
839
840
841    /// Returns true if `SettlmntTyp` is present, Tag 63.
842    pub fn has_settlmnt_typ(&self) -> bool {
843        self.message.body.has(tag::SETTLMNT_TYP)
844    }
845
846
847
848
849    /// Sets `Side`, Tag 54.
850    pub fn set_side(&mut self, v: String) {
851        self.message.body.set_field(tag::SIDE, FIXString::from(v));
852    }
853
854    /// Gets `Side`, Tag 54.
855    pub fn get_side(&self) -> Result<String, MessageRejectErrorEnum> {
856        let mut fld = field::SideField::new(String::new());
857        self.message.body.get_field(tag::SIDE, &mut fld.0)?;
858        Ok(fld.value().to_string())
859    }
860
861
862    /// Returns true if `Side` is present, Tag 54.
863    pub fn has_side(&self) -> bool {
864        self.message.body.has(tag::SIDE)
865    }
866
867
868
869
870    /// Sets `StopPx`, Tag 99.
871    pub fn set_stop_px(&mut self, val: Decimal, scale: i32) {
872        self.message.body.set_field(tag::STOP_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
873    }
874
875    /// Gets `StopPx`, Tag 99.
876    pub fn get_stop_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
877        let mut fld = field::StopPxField::new(Decimal::ZERO, 0);
878        self.message.body.get_field(tag::STOP_PX, &mut fld.0)?;
879        Ok(fld.value())
880    }
881
882
883    /// Returns true if `StopPx` is present, Tag 99.
884    pub fn has_stop_px(&self) -> bool {
885        self.message.body.has(tag::STOP_PX)
886    }
887
888
889
890
891    /// Sets `Symbol`, Tag 55.
892    pub fn set_symbol(&mut self, v: String) {
893        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
894    }
895
896    /// Gets `Symbol`, Tag 55.
897    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
898        let mut fld = field::SymbolField::new(String::new());
899        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
900        Ok(fld.value().to_string())
901    }
902
903
904    /// Returns true if `Symbol` is present, Tag 55.
905    pub fn has_symbol(&self) -> bool {
906        self.message.body.has(tag::SYMBOL)
907    }
908
909
910
911
912    /// Sets `SymbolSfx`, Tag 65.
913    pub fn set_symbol_sfx(&mut self, v: String) {
914        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
915    }
916
917    /// Gets `SymbolSfx`, Tag 65.
918    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
919        let mut fld = field::SymbolSfxField::new(String::new());
920        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
921        Ok(fld.value().to_string())
922    }
923
924
925    /// Returns true if `SymbolSfx` is present, Tag 65.
926    pub fn has_symbol_sfx(&self) -> bool {
927        self.message.body.has(tag::SYMBOL_SFX)
928    }
929
930
931
932
933    /// Sets `Text`, Tag 58.
934    pub fn set_text(&mut self, v: String) {
935        self.message.body.set_field(tag::TEXT, FIXString::from(v));
936    }
937
938    /// Gets `Text`, Tag 58.
939    pub fn get_text(&self) -> Result<String, MessageRejectErrorEnum> {
940        let mut fld = field::TextField::new(String::new());
941        self.message.body.get_field(tag::TEXT, &mut fld.0)?;
942        Ok(fld.value().to_string())
943    }
944
945
946    /// Returns true if `Text` is present, Tag 58.
947    pub fn has_text(&self) -> bool {
948        self.message.body.has(tag::TEXT)
949    }
950
951
952
953
954    /// Sets `TimeInForce`, Tag 59.
955    pub fn set_time_in_force(&mut self, v: String) {
956        self.message.body.set_field(tag::TIME_IN_FORCE, FIXString::from(v));
957    }
958
959    /// Gets `TimeInForce`, Tag 59.
960    pub fn get_time_in_force(&self) -> Result<String, MessageRejectErrorEnum> {
961        let mut fld = field::TimeInForceField::new(String::new());
962        self.message.body.get_field(tag::TIME_IN_FORCE, &mut fld.0)?;
963        Ok(fld.value().to_string())
964    }
965
966
967    /// Returns true if `TimeInForce` is present, Tag 59.
968    pub fn has_time_in_force(&self) -> bool {
969        self.message.body.has(tag::TIME_IN_FORCE)
970    }
971
972
973
974
975    /// Sets `TradeDate`, Tag 75.
976    pub fn set_trade_date(&mut self, v: String) {
977        self.message.body.set_field(tag::TRADE_DATE, FIXString::from(v));
978    }
979
980    /// Gets `TradeDate`, Tag 75.
981    pub fn get_trade_date(&self) -> Result<String, MessageRejectErrorEnum> {
982        let mut fld = field::TradeDateField::new(String::new());
983        self.message.body.get_field(tag::TRADE_DATE, &mut fld.0)?;
984        Ok(fld.value().to_string())
985    }
986
987
988    /// Returns true if `TradeDate` is present, Tag 75.
989    pub fn has_trade_date(&self) -> bool {
990        self.message.body.has(tag::TRADE_DATE)
991    }
992
993
994
995
996    /// Sets `TransactTime`, Tag 60.
997    pub fn set_transact_time(&mut self, v: Timestamp) {
998        self.message.body.set_field(tag::TRANSACT_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
999            time: v,
1000            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
1001        });
1002    }
1003
1004    /// Gets `TransactTime`, Tag 60.
1005    pub fn get_transact_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
1006        let mut fld = field::TransactTimeField::new(Timestamp::UNIX_EPOCH);
1007        self.message.body.get_field(tag::TRANSACT_TIME, &mut fld.0)?;
1008        Ok(fld.value())
1009    }
1010
1011
1012    /// Returns true if `TransactTime` is present, Tag 60.
1013    pub fn has_transact_time(&self) -> bool {
1014        self.message.body.has(tag::TRANSACT_TIME)
1015    }
1016
1017
1018}
1019
1020/// `RouteOut` is the callback type for routing `ExecutionReport` messages.
1021pub type RouteOut = fn(msg: ExecutionReport, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
1022
1023/// Route type returned by the `route` function.
1024pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
1025
1026/// Returns the begin string, message type, and route function for `ExecutionReport`.
1027pub fn route(router: RouteOut) -> Route {
1028    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
1029        router(ExecutionReport::from_message(msg.clone()), session_id)
1030    };
1031    ("FIX.4.0", "8", Box::new(r))
1032}