Skip to main content

fixer_fix/fix41/
order_cancel_replace_request.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/// `OrderCancelReplaceRequest` is the `fix41` `OrderCancelReplaceRequest` type, `MsgType` = G.
21pub struct OrderCancelReplaceRequest {
22    pub message: Message,
23}
24
25impl OrderCancelReplaceRequest {
26    /// Creates a new `OrderCancelReplaceRequest` with required fields.
27    pub fn new(orig_cl_ord_id: field::OrigClOrdIDField, cl_ord_id: field::ClOrdIDField, handl_inst: field::HandlInstField, symbol: field::SymbolField, side: field::SideField, ord_type: field::OrdTypeField) -> Self {
28        let mut msg = Message::new();
29        msg.header.set_field(tag::MSG_TYPE, FIXString::from("G".to_string()));
30
31        msg.body.set_field(tag::ORIG_CL_ORD_ID, orig_cl_ord_id.0);
32
33        msg.body.set_field(tag::CL_ORD_ID, cl_ord_id.0);
34
35        msg.body.set_field(tag::HANDL_INST, handl_inst.0);
36
37        msg.body.set_field(tag::SYMBOL, symbol.0);
38
39        msg.body.set_field(tag::SIDE, side.0);
40
41        msg.body.set_field(tag::ORD_TYPE, ord_type.0);
42
43        Self { message: msg }
44    }
45
46    /// Creates a `OrderCancelReplaceRequest` 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 `ClientID`, Tag 109.
123    pub fn set_client_id(&mut self, v: String) {
124        self.message.body.set_field(tag::CLIENT_ID, FIXString::from(v));
125    }
126
127    /// Gets `ClientID`, Tag 109.
128    pub fn get_client_id(&self) -> Result<String, MessageRejectErrorEnum> {
129        let mut fld = field::ClientIDField::new(String::new());
130        self.message.body.get_field(tag::CLIENT_ID, &mut fld.0)?;
131        Ok(fld.value().to_string())
132    }
133
134
135    /// Returns true if `ClientID` is present, Tag 109.
136    pub fn has_client_id(&self) -> bool {
137        self.message.body.has(tag::CLIENT_ID)
138    }
139
140
141
142
143    /// Sets `CommType`, Tag 13.
144    pub fn set_comm_type(&mut self, v: String) {
145        self.message.body.set_field(tag::COMM_TYPE, FIXString::from(v));
146    }
147
148    /// Gets `CommType`, Tag 13.
149    pub fn get_comm_type(&self) -> Result<String, MessageRejectErrorEnum> {
150        let mut fld = field::CommTypeField::new(String::new());
151        self.message.body.get_field(tag::COMM_TYPE, &mut fld.0)?;
152        Ok(fld.value().to_string())
153    }
154
155
156    /// Returns true if `CommType` is present, Tag 13.
157    pub fn has_comm_type(&self) -> bool {
158        self.message.body.has(tag::COMM_TYPE)
159    }
160
161
162
163
164    /// Sets `Commission`, Tag 12.
165    pub fn set_commission(&mut self, val: Decimal, scale: i32) {
166        self.message.body.set_field(tag::COMMISSION, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
167    }
168
169    /// Gets `Commission`, Tag 12.
170    pub fn get_commission(&self) -> Result<Decimal, MessageRejectErrorEnum> {
171        let mut fld = field::CommissionField::new(Decimal::ZERO, 0);
172        self.message.body.get_field(tag::COMMISSION, &mut fld.0)?;
173        Ok(fld.value())
174    }
175
176
177    /// Returns true if `Commission` is present, Tag 12.
178    pub fn has_commission(&self) -> bool {
179        self.message.body.has(tag::COMMISSION)
180    }
181
182
183
184
185    /// Sets `CoveredOrUncovered`, Tag 203.
186    pub fn set_covered_or_uncovered(&mut self, v: isize) {
187        self.message.body.set_field(tag::COVERED_OR_UNCOVERED, fixer::fix_int::FIXInt::from(v));
188    }
189
190    /// Gets `CoveredOrUncovered`, Tag 203.
191    pub fn get_covered_or_uncovered(&self) -> Result<isize, MessageRejectErrorEnum> {
192        let mut fld = field::CoveredOrUncoveredField::new(0);
193        self.message.body.get_field(tag::COVERED_OR_UNCOVERED, &mut fld.0)?;
194        Ok(fld.value())
195    }
196
197
198    /// Returns true if `CoveredOrUncovered` is present, Tag 203.
199    pub fn has_covered_or_uncovered(&self) -> bool {
200        self.message.body.has(tag::COVERED_OR_UNCOVERED)
201    }
202
203
204
205
206    /// Sets `Currency`, Tag 15.
207    pub fn set_currency(&mut self, v: String) {
208        self.message.body.set_field(tag::CURRENCY, FIXString::from(v));
209    }
210
211    /// Gets `Currency`, Tag 15.
212    pub fn get_currency(&self) -> Result<String, MessageRejectErrorEnum> {
213        let mut fld = field::CurrencyField::new(String::new());
214        self.message.body.get_field(tag::CURRENCY, &mut fld.0)?;
215        Ok(fld.value().to_string())
216    }
217
218
219    /// Returns true if `Currency` is present, Tag 15.
220    pub fn has_currency(&self) -> bool {
221        self.message.body.has(tag::CURRENCY)
222    }
223
224
225
226
227    /// Sets `CustomerOrFirm`, Tag 204.
228    pub fn set_customer_or_firm(&mut self, v: isize) {
229        self.message.body.set_field(tag::CUSTOMER_OR_FIRM, fixer::fix_int::FIXInt::from(v));
230    }
231
232    /// Gets `CustomerOrFirm`, Tag 204.
233    pub fn get_customer_or_firm(&self) -> Result<isize, MessageRejectErrorEnum> {
234        let mut fld = field::CustomerOrFirmField::new(0);
235        self.message.body.get_field(tag::CUSTOMER_OR_FIRM, &mut fld.0)?;
236        Ok(fld.value())
237    }
238
239
240    /// Returns true if `CustomerOrFirm` is present, Tag 204.
241    pub fn has_customer_or_firm(&self) -> bool {
242        self.message.body.has(tag::CUSTOMER_OR_FIRM)
243    }
244
245
246
247
248    /// Sets `ExDestination`, Tag 100.
249    pub fn set_ex_destination(&mut self, v: String) {
250        self.message.body.set_field(tag::EX_DESTINATION, FIXString::from(v));
251    }
252
253    /// Gets `ExDestination`, Tag 100.
254    pub fn get_ex_destination(&self) -> Result<String, MessageRejectErrorEnum> {
255        let mut fld = field::ExDestinationField::new(String::new());
256        self.message.body.get_field(tag::EX_DESTINATION, &mut fld.0)?;
257        Ok(fld.value().to_string())
258    }
259
260
261    /// Returns true if `ExDestination` is present, Tag 100.
262    pub fn has_ex_destination(&self) -> bool {
263        self.message.body.has(tag::EX_DESTINATION)
264    }
265
266
267
268
269    /// Sets `ExecBroker`, Tag 76.
270    pub fn set_exec_broker(&mut self, v: String) {
271        self.message.body.set_field(tag::EXEC_BROKER, FIXString::from(v));
272    }
273
274    /// Gets `ExecBroker`, Tag 76.
275    pub fn get_exec_broker(&self) -> Result<String, MessageRejectErrorEnum> {
276        let mut fld = field::ExecBrokerField::new(String::new());
277        self.message.body.get_field(tag::EXEC_BROKER, &mut fld.0)?;
278        Ok(fld.value().to_string())
279    }
280
281
282    /// Returns true if `ExecBroker` is present, Tag 76.
283    pub fn has_exec_broker(&self) -> bool {
284        self.message.body.has(tag::EXEC_BROKER)
285    }
286
287
288
289
290    /// Sets `ExecInst`, Tag 18.
291    pub fn set_exec_inst(&mut self, v: String) {
292        self.message.body.set_field(tag::EXEC_INST, FIXString::from(v));
293    }
294
295    /// Gets `ExecInst`, Tag 18.
296    pub fn get_exec_inst(&self) -> Result<String, MessageRejectErrorEnum> {
297        let mut fld = field::ExecInstField::new(String::new());
298        self.message.body.get_field(tag::EXEC_INST, &mut fld.0)?;
299        Ok(fld.value().to_string())
300    }
301
302
303    /// Returns true if `ExecInst` is present, Tag 18.
304    pub fn has_exec_inst(&self) -> bool {
305        self.message.body.has(tag::EXEC_INST)
306    }
307
308
309
310
311    /// Sets `ExpireTime`, Tag 126.
312    pub fn set_expire_time(&mut self, v: Timestamp) {
313        self.message.body.set_field(tag::EXPIRE_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
314            time: v,
315            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
316        });
317    }
318
319    /// Gets `ExpireTime`, Tag 126.
320    pub fn get_expire_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
321        let mut fld = field::ExpireTimeField::new(Timestamp::UNIX_EPOCH);
322        self.message.body.get_field(tag::EXPIRE_TIME, &mut fld.0)?;
323        Ok(fld.value())
324    }
325
326
327    /// Returns true if `ExpireTime` is present, Tag 126.
328    pub fn has_expire_time(&self) -> bool {
329        self.message.body.has(tag::EXPIRE_TIME)
330    }
331
332
333
334
335    /// Sets `ForexReq`, Tag 121.
336    pub fn set_forex_req(&mut self, v: bool) {
337        self.message.body.set_field(tag::FOREX_REQ, fixer::fix_boolean::FIXBoolean::from(v));
338    }
339
340    /// Gets `ForexReq`, Tag 121.
341    pub fn get_forex_req(&self) -> Result<bool, MessageRejectErrorEnum> {
342        let mut fld = field::ForexReqField::new(false);
343        self.message.body.get_field(tag::FOREX_REQ, &mut fld.0)?;
344        Ok(fld.value())
345    }
346
347
348    /// Returns true if `ForexReq` is present, Tag 121.
349    pub fn has_forex_req(&self) -> bool {
350        self.message.body.has(tag::FOREX_REQ)
351    }
352
353
354
355
356    /// Sets `FutSettDate`, Tag 64.
357    pub fn set_fut_sett_date(&mut self, v: String) {
358        self.message.body.set_field(tag::FUT_SETT_DATE, FIXString::from(v));
359    }
360
361    /// Gets `FutSettDate`, Tag 64.
362    pub fn get_fut_sett_date(&self) -> Result<String, MessageRejectErrorEnum> {
363        let mut fld = field::FutSettDateField::new(String::new());
364        self.message.body.get_field(tag::FUT_SETT_DATE, &mut fld.0)?;
365        Ok(fld.value().to_string())
366    }
367
368
369    /// Returns true if `FutSettDate` is present, Tag 64.
370    pub fn has_fut_sett_date(&self) -> bool {
371        self.message.body.has(tag::FUT_SETT_DATE)
372    }
373
374
375
376
377    /// Sets `FutSettDate2`, Tag 193.
378    pub fn set_fut_sett_date2(&mut self, v: String) {
379        self.message.body.set_field(tag::FUT_SETT_DATE2, FIXString::from(v));
380    }
381
382    /// Gets `FutSettDate2`, Tag 193.
383    pub fn get_fut_sett_date2(&self) -> Result<String, MessageRejectErrorEnum> {
384        let mut fld = field::FutSettDate2Field::new(String::new());
385        self.message.body.get_field(tag::FUT_SETT_DATE2, &mut fld.0)?;
386        Ok(fld.value().to_string())
387    }
388
389
390    /// Returns true if `FutSettDate2` is present, Tag 193.
391    pub fn has_fut_sett_date2(&self) -> bool {
392        self.message.body.has(tag::FUT_SETT_DATE2)
393    }
394
395
396
397
398    /// Sets `HandlInst`, Tag 21.
399    pub fn set_handl_inst(&mut self, v: String) {
400        self.message.body.set_field(tag::HANDL_INST, FIXString::from(v));
401    }
402
403    /// Gets `HandlInst`, Tag 21.
404    pub fn get_handl_inst(&self) -> Result<String, MessageRejectErrorEnum> {
405        let mut fld = field::HandlInstField::new(String::new());
406        self.message.body.get_field(tag::HANDL_INST, &mut fld.0)?;
407        Ok(fld.value().to_string())
408    }
409
410
411    /// Returns true if `HandlInst` is present, Tag 21.
412    pub fn has_handl_inst(&self) -> bool {
413        self.message.body.has(tag::HANDL_INST)
414    }
415
416
417
418
419    /// Sets `IDSource`, Tag 22.
420    pub fn set_id_source(&mut self, v: String) {
421        self.message.body.set_field(tag::ID_SOURCE, FIXString::from(v));
422    }
423
424    /// Gets `IDSource`, Tag 22.
425    pub fn get_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
426        let mut fld = field::IDSourceField::new(String::new());
427        self.message.body.get_field(tag::ID_SOURCE, &mut fld.0)?;
428        Ok(fld.value().to_string())
429    }
430
431
432    /// Returns true if `IDSource` is present, Tag 22.
433    pub fn has_id_source(&self) -> bool {
434        self.message.body.has(tag::ID_SOURCE)
435    }
436
437
438
439
440    /// Sets `Issuer`, Tag 106.
441    pub fn set_issuer(&mut self, v: String) {
442        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
443    }
444
445    /// Gets `Issuer`, Tag 106.
446    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
447        let mut fld = field::IssuerField::new(String::new());
448        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
449        Ok(fld.value().to_string())
450    }
451
452
453    /// Returns true if `Issuer` is present, Tag 106.
454    pub fn has_issuer(&self) -> bool {
455        self.message.body.has(tag::ISSUER)
456    }
457
458
459
460
461    /// Sets `ListID`, Tag 66.
462    pub fn set_list_id(&mut self, v: String) {
463        self.message.body.set_field(tag::LIST_ID, FIXString::from(v));
464    }
465
466    /// Gets `ListID`, Tag 66.
467    pub fn get_list_id(&self) -> Result<String, MessageRejectErrorEnum> {
468        let mut fld = field::ListIDField::new(String::new());
469        self.message.body.get_field(tag::LIST_ID, &mut fld.0)?;
470        Ok(fld.value().to_string())
471    }
472
473
474    /// Returns true if `ListID` is present, Tag 66.
475    pub fn has_list_id(&self) -> bool {
476        self.message.body.has(tag::LIST_ID)
477    }
478
479
480
481
482    /// Sets `LocateReqd`, Tag 114.
483    pub fn set_locate_reqd(&mut self, v: bool) {
484        self.message.body.set_field(tag::LOCATE_REQD, fixer::fix_boolean::FIXBoolean::from(v));
485    }
486
487    /// Gets `LocateReqd`, Tag 114.
488    pub fn get_locate_reqd(&self) -> Result<bool, MessageRejectErrorEnum> {
489        let mut fld = field::LocateReqdField::new(false);
490        self.message.body.get_field(tag::LOCATE_REQD, &mut fld.0)?;
491        Ok(fld.value())
492    }
493
494
495    /// Returns true if `LocateReqd` is present, Tag 114.
496    pub fn has_locate_reqd(&self) -> bool {
497        self.message.body.has(tag::LOCATE_REQD)
498    }
499
500
501
502
503    /// Sets `MaturityDay`, Tag 205.
504    pub fn set_maturity_day(&mut self, v: isize) {
505        self.message.body.set_field(tag::MATURITY_DAY, fixer::fix_int::FIXInt::from(v));
506    }
507
508    /// Gets `MaturityDay`, Tag 205.
509    pub fn get_maturity_day(&self) -> Result<isize, MessageRejectErrorEnum> {
510        let mut fld = field::MaturityDayField::new(0);
511        self.message.body.get_field(tag::MATURITY_DAY, &mut fld.0)?;
512        Ok(fld.value())
513    }
514
515
516    /// Returns true if `MaturityDay` is present, Tag 205.
517    pub fn has_maturity_day(&self) -> bool {
518        self.message.body.has(tag::MATURITY_DAY)
519    }
520
521
522
523
524    /// Sets `MaturityMonthYear`, Tag 200.
525    pub fn set_maturity_month_year(&mut self, v: String) {
526        self.message.body.set_field(tag::MATURITY_MONTH_YEAR, FIXString::from(v));
527    }
528
529    /// Gets `MaturityMonthYear`, Tag 200.
530    pub fn get_maturity_month_year(&self) -> Result<String, MessageRejectErrorEnum> {
531        let mut fld = field::MaturityMonthYearField::new(String::new());
532        self.message.body.get_field(tag::MATURITY_MONTH_YEAR, &mut fld.0)?;
533        Ok(fld.value().to_string())
534    }
535
536
537    /// Returns true if `MaturityMonthYear` is present, Tag 200.
538    pub fn has_maturity_month_year(&self) -> bool {
539        self.message.body.has(tag::MATURITY_MONTH_YEAR)
540    }
541
542
543
544
545    /// Sets `MaxFloor`, Tag 111.
546    pub fn set_max_floor(&mut self, val: Decimal, scale: i32) {
547        self.message.body.set_field(tag::MAX_FLOOR, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
548    }
549
550    /// Gets `MaxFloor`, Tag 111.
551    pub fn get_max_floor(&self) -> Result<Decimal, MessageRejectErrorEnum> {
552        let mut fld = field::MaxFloorField::new(Decimal::ZERO, 0);
553        self.message.body.get_field(tag::MAX_FLOOR, &mut fld.0)?;
554        Ok(fld.value())
555    }
556
557
558    /// Returns true if `MaxFloor` is present, Tag 111.
559    pub fn has_max_floor(&self) -> bool {
560        self.message.body.has(tag::MAX_FLOOR)
561    }
562
563
564
565
566    /// Sets `MaxShow`, Tag 210.
567    pub fn set_max_show(&mut self, val: Decimal, scale: i32) {
568        self.message.body.set_field(tag::MAX_SHOW, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
569    }
570
571    /// Gets `MaxShow`, Tag 210.
572    pub fn get_max_show(&self) -> Result<Decimal, MessageRejectErrorEnum> {
573        let mut fld = field::MaxShowField::new(Decimal::ZERO, 0);
574        self.message.body.get_field(tag::MAX_SHOW, &mut fld.0)?;
575        Ok(fld.value())
576    }
577
578
579    /// Returns true if `MaxShow` is present, Tag 210.
580    pub fn has_max_show(&self) -> bool {
581        self.message.body.has(tag::MAX_SHOW)
582    }
583
584
585
586
587    /// Sets `MinQty`, Tag 110.
588    pub fn set_min_qty(&mut self, val: Decimal, scale: i32) {
589        self.message.body.set_field(tag::MIN_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
590    }
591
592    /// Gets `MinQty`, Tag 110.
593    pub fn get_min_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
594        let mut fld = field::MinQtyField::new(Decimal::ZERO, 0);
595        self.message.body.get_field(tag::MIN_QTY, &mut fld.0)?;
596        Ok(fld.value())
597    }
598
599
600    /// Returns true if `MinQty` is present, Tag 110.
601    pub fn has_min_qty(&self) -> bool {
602        self.message.body.has(tag::MIN_QTY)
603    }
604
605
606
607
608    /// Sets `OpenClose`, Tag 77.
609    pub fn set_open_close(&mut self, v: String) {
610        self.message.body.set_field(tag::OPEN_CLOSE, FIXString::from(v));
611    }
612
613    /// Gets `OpenClose`, Tag 77.
614    pub fn get_open_close(&self) -> Result<String, MessageRejectErrorEnum> {
615        let mut fld = field::OpenCloseField::new(String::new());
616        self.message.body.get_field(tag::OPEN_CLOSE, &mut fld.0)?;
617        Ok(fld.value().to_string())
618    }
619
620
621    /// Returns true if `OpenClose` is present, Tag 77.
622    pub fn has_open_close(&self) -> bool {
623        self.message.body.has(tag::OPEN_CLOSE)
624    }
625
626
627
628
629    /// Sets `OptAttribute`, Tag 206.
630    pub fn set_opt_attribute(&mut self, v: String) {
631        self.message.body.set_field(tag::OPT_ATTRIBUTE, FIXString::from(v));
632    }
633
634    /// Gets `OptAttribute`, Tag 206.
635    pub fn get_opt_attribute(&self) -> Result<String, MessageRejectErrorEnum> {
636        let mut fld = field::OptAttributeField::new(String::new());
637        self.message.body.get_field(tag::OPT_ATTRIBUTE, &mut fld.0)?;
638        Ok(fld.value().to_string())
639    }
640
641
642    /// Returns true if `OptAttribute` is present, Tag 206.
643    pub fn has_opt_attribute(&self) -> bool {
644        self.message.body.has(tag::OPT_ATTRIBUTE)
645    }
646
647
648
649
650    /// Sets `OrdType`, Tag 40.
651    pub fn set_ord_type(&mut self, v: String) {
652        self.message.body.set_field(tag::ORD_TYPE, FIXString::from(v));
653    }
654
655    /// Gets `OrdType`, Tag 40.
656    pub fn get_ord_type(&self) -> Result<String, MessageRejectErrorEnum> {
657        let mut fld = field::OrdTypeField::new(String::new());
658        self.message.body.get_field(tag::ORD_TYPE, &mut fld.0)?;
659        Ok(fld.value().to_string())
660    }
661
662
663    /// Returns true if `OrdType` is present, Tag 40.
664    pub fn has_ord_type(&self) -> bool {
665        self.message.body.has(tag::ORD_TYPE)
666    }
667
668
669
670
671    /// Sets `OrderID`, Tag 37.
672    pub fn set_order_id(&mut self, v: String) {
673        self.message.body.set_field(tag::ORDER_ID, FIXString::from(v));
674    }
675
676    /// Gets `OrderID`, Tag 37.
677    pub fn get_order_id(&self) -> Result<String, MessageRejectErrorEnum> {
678        let mut fld = field::OrderIDField::new(String::new());
679        self.message.body.get_field(tag::ORDER_ID, &mut fld.0)?;
680        Ok(fld.value().to_string())
681    }
682
683
684    /// Returns true if `OrderID` is present, Tag 37.
685    pub fn has_order_id(&self) -> bool {
686        self.message.body.has(tag::ORDER_ID)
687    }
688
689
690
691
692    /// Sets `OrderQty`, Tag 38.
693    pub fn set_order_qty(&mut self, val: Decimal, scale: i32) {
694        self.message.body.set_field(tag::ORDER_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
695    }
696
697    /// Gets `OrderQty`, Tag 38.
698    pub fn get_order_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
699        let mut fld = field::OrderQtyField::new(Decimal::ZERO, 0);
700        self.message.body.get_field(tag::ORDER_QTY, &mut fld.0)?;
701        Ok(fld.value())
702    }
703
704
705    /// Returns true if `OrderQty` is present, Tag 38.
706    pub fn has_order_qty(&self) -> bool {
707        self.message.body.has(tag::ORDER_QTY)
708    }
709
710
711
712
713    /// Sets `OrderQty2`, Tag 192.
714    pub fn set_order_qty2(&mut self, val: Decimal, scale: i32) {
715        self.message.body.set_field(tag::ORDER_QTY2, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
716    }
717
718    /// Gets `OrderQty2`, Tag 192.
719    pub fn get_order_qty2(&self) -> Result<Decimal, MessageRejectErrorEnum> {
720        let mut fld = field::OrderQty2Field::new(Decimal::ZERO, 0);
721        self.message.body.get_field(tag::ORDER_QTY2, &mut fld.0)?;
722        Ok(fld.value())
723    }
724
725
726    /// Returns true if `OrderQty2` is present, Tag 192.
727    pub fn has_order_qty2(&self) -> bool {
728        self.message.body.has(tag::ORDER_QTY2)
729    }
730
731
732
733
734    /// Sets `OrigClOrdID`, Tag 41.
735    pub fn set_orig_cl_ord_id(&mut self, v: String) {
736        self.message.body.set_field(tag::ORIG_CL_ORD_ID, FIXString::from(v));
737    }
738
739    /// Gets `OrigClOrdID`, Tag 41.
740    pub fn get_orig_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
741        let mut fld = field::OrigClOrdIDField::new(String::new());
742        self.message.body.get_field(tag::ORIG_CL_ORD_ID, &mut fld.0)?;
743        Ok(fld.value().to_string())
744    }
745
746
747    /// Returns true if `OrigClOrdID` is present, Tag 41.
748    pub fn has_orig_cl_ord_id(&self) -> bool {
749        self.message.body.has(tag::ORIG_CL_ORD_ID)
750    }
751
752
753
754
755    /// Sets `PegDifference`, Tag 211.
756    pub fn set_peg_difference(&mut self, val: Decimal, scale: i32) {
757        self.message.body.set_field(tag::PEG_DIFFERENCE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
758    }
759
760    /// Gets `PegDifference`, Tag 211.
761    pub fn get_peg_difference(&self) -> Result<Decimal, MessageRejectErrorEnum> {
762        let mut fld = field::PegDifferenceField::new(Decimal::ZERO, 0);
763        self.message.body.get_field(tag::PEG_DIFFERENCE, &mut fld.0)?;
764        Ok(fld.value())
765    }
766
767
768    /// Returns true if `PegDifference` is present, Tag 211.
769    pub fn has_peg_difference(&self) -> bool {
770        self.message.body.has(tag::PEG_DIFFERENCE)
771    }
772
773
774
775
776    /// Sets `Price`, Tag 44.
777    pub fn set_price(&mut self, val: Decimal, scale: i32) {
778        self.message.body.set_field(tag::PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
779    }
780
781    /// Gets `Price`, Tag 44.
782    pub fn get_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
783        let mut fld = field::PriceField::new(Decimal::ZERO, 0);
784        self.message.body.get_field(tag::PRICE, &mut fld.0)?;
785        Ok(fld.value())
786    }
787
788
789    /// Returns true if `Price` is present, Tag 44.
790    pub fn has_price(&self) -> bool {
791        self.message.body.has(tag::PRICE)
792    }
793
794
795
796
797    /// Sets `PutOrCall`, Tag 201.
798    pub fn set_put_or_call(&mut self, v: isize) {
799        self.message.body.set_field(tag::PUT_OR_CALL, fixer::fix_int::FIXInt::from(v));
800    }
801
802    /// Gets `PutOrCall`, Tag 201.
803    pub fn get_put_or_call(&self) -> Result<isize, MessageRejectErrorEnum> {
804        let mut fld = field::PutOrCallField::new(0);
805        self.message.body.get_field(tag::PUT_OR_CALL, &mut fld.0)?;
806        Ok(fld.value())
807    }
808
809
810    /// Returns true if `PutOrCall` is present, Tag 201.
811    pub fn has_put_or_call(&self) -> bool {
812        self.message.body.has(tag::PUT_OR_CALL)
813    }
814
815
816
817
818    /// Sets `Rule80A`, Tag 47.
819    pub fn set_rule80_a(&mut self, v: String) {
820        self.message.body.set_field(tag::RULE80_A, FIXString::from(v));
821    }
822
823    /// Gets `Rule80A`, Tag 47.
824    pub fn get_rule80_a(&self) -> Result<String, MessageRejectErrorEnum> {
825        let mut fld = field::Rule80AField::new(String::new());
826        self.message.body.get_field(tag::RULE80_A, &mut fld.0)?;
827        Ok(fld.value().to_string())
828    }
829
830
831    /// Returns true if `Rule80A` is present, Tag 47.
832    pub fn has_rule80_a(&self) -> bool {
833        self.message.body.has(tag::RULE80_A)
834    }
835
836
837
838
839    /// Sets `SecurityDesc`, Tag 107.
840    pub fn set_security_desc(&mut self, v: String) {
841        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
842    }
843
844    /// Gets `SecurityDesc`, Tag 107.
845    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
846        let mut fld = field::SecurityDescField::new(String::new());
847        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
848        Ok(fld.value().to_string())
849    }
850
851
852    /// Returns true if `SecurityDesc` is present, Tag 107.
853    pub fn has_security_desc(&self) -> bool {
854        self.message.body.has(tag::SECURITY_DESC)
855    }
856
857
858
859
860    /// Sets `SecurityExchange`, Tag 207.
861    pub fn set_security_exchange(&mut self, v: String) {
862        self.message.body.set_field(tag::SECURITY_EXCHANGE, FIXString::from(v));
863    }
864
865    /// Gets `SecurityExchange`, Tag 207.
866    pub fn get_security_exchange(&self) -> Result<String, MessageRejectErrorEnum> {
867        let mut fld = field::SecurityExchangeField::new(String::new());
868        self.message.body.get_field(tag::SECURITY_EXCHANGE, &mut fld.0)?;
869        Ok(fld.value().to_string())
870    }
871
872
873    /// Returns true if `SecurityExchange` is present, Tag 207.
874    pub fn has_security_exchange(&self) -> bool {
875        self.message.body.has(tag::SECURITY_EXCHANGE)
876    }
877
878
879
880
881    /// Sets `SecurityID`, Tag 48.
882    pub fn set_security_id(&mut self, v: String) {
883        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
884    }
885
886    /// Gets `SecurityID`, Tag 48.
887    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
888        let mut fld = field::SecurityIDField::new(String::new());
889        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
890        Ok(fld.value().to_string())
891    }
892
893
894    /// Returns true if `SecurityID` is present, Tag 48.
895    pub fn has_security_id(&self) -> bool {
896        self.message.body.has(tag::SECURITY_ID)
897    }
898
899
900
901
902    /// Sets `SecurityType`, Tag 167.
903    pub fn set_security_type(&mut self, v: String) {
904        self.message.body.set_field(tag::SECURITY_TYPE, FIXString::from(v));
905    }
906
907    /// Gets `SecurityType`, Tag 167.
908    pub fn get_security_type(&self) -> Result<String, MessageRejectErrorEnum> {
909        let mut fld = field::SecurityTypeField::new(String::new());
910        self.message.body.get_field(tag::SECURITY_TYPE, &mut fld.0)?;
911        Ok(fld.value().to_string())
912    }
913
914
915    /// Returns true if `SecurityType` is present, Tag 167.
916    pub fn has_security_type(&self) -> bool {
917        self.message.body.has(tag::SECURITY_TYPE)
918    }
919
920
921
922
923    /// Sets `SettlCurrency`, Tag 120.
924    pub fn set_settl_currency(&mut self, v: String) {
925        self.message.body.set_field(tag::SETTL_CURRENCY, FIXString::from(v));
926    }
927
928    /// Gets `SettlCurrency`, Tag 120.
929    pub fn get_settl_currency(&self) -> Result<String, MessageRejectErrorEnum> {
930        let mut fld = field::SettlCurrencyField::new(String::new());
931        self.message.body.get_field(tag::SETTL_CURRENCY, &mut fld.0)?;
932        Ok(fld.value().to_string())
933    }
934
935
936    /// Returns true if `SettlCurrency` is present, Tag 120.
937    pub fn has_settl_currency(&self) -> bool {
938        self.message.body.has(tag::SETTL_CURRENCY)
939    }
940
941
942
943
944    /// Sets `SettlmntTyp`, Tag 63.
945    pub fn set_settlmnt_typ(&mut self, v: String) {
946        self.message.body.set_field(tag::SETTLMNT_TYP, FIXString::from(v));
947    }
948
949    /// Gets `SettlmntTyp`, Tag 63.
950    pub fn get_settlmnt_typ(&self) -> Result<String, MessageRejectErrorEnum> {
951        let mut fld = field::SettlmntTypField::new(String::new());
952        self.message.body.get_field(tag::SETTLMNT_TYP, &mut fld.0)?;
953        Ok(fld.value().to_string())
954    }
955
956
957    /// Returns true if `SettlmntTyp` is present, Tag 63.
958    pub fn has_settlmnt_typ(&self) -> bool {
959        self.message.body.has(tag::SETTLMNT_TYP)
960    }
961
962
963
964
965    /// Sets `Side`, Tag 54.
966    pub fn set_side(&mut self, v: String) {
967        self.message.body.set_field(tag::SIDE, FIXString::from(v));
968    }
969
970    /// Gets `Side`, Tag 54.
971    pub fn get_side(&self) -> Result<String, MessageRejectErrorEnum> {
972        let mut fld = field::SideField::new(String::new());
973        self.message.body.get_field(tag::SIDE, &mut fld.0)?;
974        Ok(fld.value().to_string())
975    }
976
977
978    /// Returns true if `Side` is present, Tag 54.
979    pub fn has_side(&self) -> bool {
980        self.message.body.has(tag::SIDE)
981    }
982
983
984
985
986    /// Sets `StopPx`, Tag 99.
987    pub fn set_stop_px(&mut self, val: Decimal, scale: i32) {
988        self.message.body.set_field(tag::STOP_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
989    }
990
991    /// Gets `StopPx`, Tag 99.
992    pub fn get_stop_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
993        let mut fld = field::StopPxField::new(Decimal::ZERO, 0);
994        self.message.body.get_field(tag::STOP_PX, &mut fld.0)?;
995        Ok(fld.value())
996    }
997
998
999    /// Returns true if `StopPx` is present, Tag 99.
1000    pub fn has_stop_px(&self) -> bool {
1001        self.message.body.has(tag::STOP_PX)
1002    }
1003
1004
1005
1006
1007    /// Sets `StrikePrice`, Tag 202.
1008    pub fn set_strike_price(&mut self, val: Decimal, scale: i32) {
1009        self.message.body.set_field(tag::STRIKE_PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1010    }
1011
1012    /// Gets `StrikePrice`, Tag 202.
1013    pub fn get_strike_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1014        let mut fld = field::StrikePriceField::new(Decimal::ZERO, 0);
1015        self.message.body.get_field(tag::STRIKE_PRICE, &mut fld.0)?;
1016        Ok(fld.value())
1017    }
1018
1019
1020    /// Returns true if `StrikePrice` is present, Tag 202.
1021    pub fn has_strike_price(&self) -> bool {
1022        self.message.body.has(tag::STRIKE_PRICE)
1023    }
1024
1025
1026
1027
1028    /// Sets `Symbol`, Tag 55.
1029    pub fn set_symbol(&mut self, v: String) {
1030        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
1031    }
1032
1033    /// Gets `Symbol`, Tag 55.
1034    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
1035        let mut fld = field::SymbolField::new(String::new());
1036        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
1037        Ok(fld.value().to_string())
1038    }
1039
1040
1041    /// Returns true if `Symbol` is present, Tag 55.
1042    pub fn has_symbol(&self) -> bool {
1043        self.message.body.has(tag::SYMBOL)
1044    }
1045
1046
1047
1048
1049    /// Sets `SymbolSfx`, Tag 65.
1050    pub fn set_symbol_sfx(&mut self, v: String) {
1051        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
1052    }
1053
1054    /// Gets `SymbolSfx`, Tag 65.
1055    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
1056        let mut fld = field::SymbolSfxField::new(String::new());
1057        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
1058        Ok(fld.value().to_string())
1059    }
1060
1061
1062    /// Returns true if `SymbolSfx` is present, Tag 65.
1063    pub fn has_symbol_sfx(&self) -> bool {
1064        self.message.body.has(tag::SYMBOL_SFX)
1065    }
1066
1067
1068
1069
1070    /// Sets `Text`, Tag 58.
1071    pub fn set_text(&mut self, v: String) {
1072        self.message.body.set_field(tag::TEXT, FIXString::from(v));
1073    }
1074
1075    /// Gets `Text`, Tag 58.
1076    pub fn get_text(&self) -> Result<String, MessageRejectErrorEnum> {
1077        let mut fld = field::TextField::new(String::new());
1078        self.message.body.get_field(tag::TEXT, &mut fld.0)?;
1079        Ok(fld.value().to_string())
1080    }
1081
1082
1083    /// Returns true if `Text` is present, Tag 58.
1084    pub fn has_text(&self) -> bool {
1085        self.message.body.has(tag::TEXT)
1086    }
1087
1088
1089
1090
1091    /// Sets `TimeInForce`, Tag 59.
1092    pub fn set_time_in_force(&mut self, v: String) {
1093        self.message.body.set_field(tag::TIME_IN_FORCE, FIXString::from(v));
1094    }
1095
1096    /// Gets `TimeInForce`, Tag 59.
1097    pub fn get_time_in_force(&self) -> Result<String, MessageRejectErrorEnum> {
1098        let mut fld = field::TimeInForceField::new(String::new());
1099        self.message.body.get_field(tag::TIME_IN_FORCE, &mut fld.0)?;
1100        Ok(fld.value().to_string())
1101    }
1102
1103
1104    /// Returns true if `TimeInForce` is present, Tag 59.
1105    pub fn has_time_in_force(&self) -> bool {
1106        self.message.body.has(tag::TIME_IN_FORCE)
1107    }
1108
1109
1110}
1111
1112/// `RouteOut` is the callback type for routing `OrderCancelReplaceRequest` messages.
1113pub type RouteOut = fn(msg: OrderCancelReplaceRequest, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
1114
1115/// Route type returned by the `route` function.
1116pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
1117
1118/// Returns the begin string, message type, and route function for `OrderCancelReplaceRequest`.
1119pub fn route(router: RouteOut) -> Route {
1120    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
1121        router(OrderCancelReplaceRequest::from_message(msg.clone()), session_id)
1122    };
1123    ("FIX.4.1", "G", Box::new(r))
1124}