1#![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
20pub struct OrderCancelReplaceRequest {
22 pub message: Message,
23}
24
25impl OrderCancelReplaceRequest {
26 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 pub fn from_message(msg: Message) -> Self {
48 Self { message: msg }
49 }
50
51 pub fn to_message(self) -> Message {
53 self.message
54 }
55
56
57
58
59 pub fn set_account(&mut self, v: String) {
61 self.message.body.set_field(tag::ACCOUNT, FIXString::from(v));
62 }
63
64 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 pub fn has_account(&self) -> bool {
74 self.message.body.has(tag::ACCOUNT)
75 }
76
77
78
79
80 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 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 pub fn has_cash_order_qty(&self) -> bool {
95 self.message.body.has(tag::CASH_ORDER_QTY)
96 }
97
98
99
100
101 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 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 pub fn has_cl_ord_id(&self) -> bool {
116 self.message.body.has(tag::CL_ORD_ID)
117 }
118
119
120
121
122 pub fn set_client_id(&mut self, v: String) {
124 self.message.body.set_field(tag::CLIENT_ID, FIXString::from(v));
125 }
126
127 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 pub fn has_client_id(&self) -> bool {
137 self.message.body.has(tag::CLIENT_ID)
138 }
139
140
141
142
143 pub fn set_comm_type(&mut self, v: String) {
145 self.message.body.set_field(tag::COMM_TYPE, FIXString::from(v));
146 }
147
148 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 pub fn has_comm_type(&self) -> bool {
158 self.message.body.has(tag::COMM_TYPE)
159 }
160
161
162
163
164 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 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 pub fn has_commission(&self) -> bool {
179 self.message.body.has(tag::COMMISSION)
180 }
181
182
183
184
185 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 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 pub fn has_covered_or_uncovered(&self) -> bool {
200 self.message.body.has(tag::COVERED_OR_UNCOVERED)
201 }
202
203
204
205
206 pub fn set_currency(&mut self, v: String) {
208 self.message.body.set_field(tag::CURRENCY, FIXString::from(v));
209 }
210
211 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 pub fn has_currency(&self) -> bool {
221 self.message.body.has(tag::CURRENCY)
222 }
223
224
225
226
227 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 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 pub fn has_customer_or_firm(&self) -> bool {
242 self.message.body.has(tag::CUSTOMER_OR_FIRM)
243 }
244
245
246
247
248 pub fn set_ex_destination(&mut self, v: String) {
250 self.message.body.set_field(tag::EX_DESTINATION, FIXString::from(v));
251 }
252
253 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 pub fn has_ex_destination(&self) -> bool {
263 self.message.body.has(tag::EX_DESTINATION)
264 }
265
266
267
268
269 pub fn set_exec_broker(&mut self, v: String) {
271 self.message.body.set_field(tag::EXEC_BROKER, FIXString::from(v));
272 }
273
274 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 pub fn has_exec_broker(&self) -> bool {
284 self.message.body.has(tag::EXEC_BROKER)
285 }
286
287
288
289
290 pub fn set_exec_inst(&mut self, v: String) {
292 self.message.body.set_field(tag::EXEC_INST, FIXString::from(v));
293 }
294
295 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 pub fn has_exec_inst(&self) -> bool {
305 self.message.body.has(tag::EXEC_INST)
306 }
307
308
309
310
311 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 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 pub fn has_expire_time(&self) -> bool {
329 self.message.body.has(tag::EXPIRE_TIME)
330 }
331
332
333
334
335 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 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 pub fn has_forex_req(&self) -> bool {
350 self.message.body.has(tag::FOREX_REQ)
351 }
352
353
354
355
356 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 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 pub fn has_fut_sett_date(&self) -> bool {
371 self.message.body.has(tag::FUT_SETT_DATE)
372 }
373
374
375
376
377 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 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 pub fn has_fut_sett_date2(&self) -> bool {
392 self.message.body.has(tag::FUT_SETT_DATE2)
393 }
394
395
396
397
398 pub fn set_handl_inst(&mut self, v: String) {
400 self.message.body.set_field(tag::HANDL_INST, FIXString::from(v));
401 }
402
403 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 pub fn has_handl_inst(&self) -> bool {
413 self.message.body.has(tag::HANDL_INST)
414 }
415
416
417
418
419 pub fn set_id_source(&mut self, v: String) {
421 self.message.body.set_field(tag::ID_SOURCE, FIXString::from(v));
422 }
423
424 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 pub fn has_id_source(&self) -> bool {
434 self.message.body.has(tag::ID_SOURCE)
435 }
436
437
438
439
440 pub fn set_issuer(&mut self, v: String) {
442 self.message.body.set_field(tag::ISSUER, FIXString::from(v));
443 }
444
445 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 pub fn has_issuer(&self) -> bool {
455 self.message.body.has(tag::ISSUER)
456 }
457
458
459
460
461 pub fn set_list_id(&mut self, v: String) {
463 self.message.body.set_field(tag::LIST_ID, FIXString::from(v));
464 }
465
466 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 pub fn has_list_id(&self) -> bool {
476 self.message.body.has(tag::LIST_ID)
477 }
478
479
480
481
482 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 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 pub fn has_locate_reqd(&self) -> bool {
497 self.message.body.has(tag::LOCATE_REQD)
498 }
499
500
501
502
503 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 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 pub fn has_maturity_day(&self) -> bool {
518 self.message.body.has(tag::MATURITY_DAY)
519 }
520
521
522
523
524 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 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 pub fn has_maturity_month_year(&self) -> bool {
539 self.message.body.has(tag::MATURITY_MONTH_YEAR)
540 }
541
542
543
544
545 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 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 pub fn has_max_floor(&self) -> bool {
560 self.message.body.has(tag::MAX_FLOOR)
561 }
562
563
564
565
566 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 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 pub fn has_max_show(&self) -> bool {
581 self.message.body.has(tag::MAX_SHOW)
582 }
583
584
585
586
587 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 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 pub fn has_min_qty(&self) -> bool {
602 self.message.body.has(tag::MIN_QTY)
603 }
604
605
606
607
608 pub fn set_open_close(&mut self, v: String) {
610 self.message.body.set_field(tag::OPEN_CLOSE, FIXString::from(v));
611 }
612
613 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 pub fn has_open_close(&self) -> bool {
623 self.message.body.has(tag::OPEN_CLOSE)
624 }
625
626
627
628
629 pub fn set_opt_attribute(&mut self, v: String) {
631 self.message.body.set_field(tag::OPT_ATTRIBUTE, FIXString::from(v));
632 }
633
634 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 pub fn has_opt_attribute(&self) -> bool {
644 self.message.body.has(tag::OPT_ATTRIBUTE)
645 }
646
647
648
649
650 pub fn set_ord_type(&mut self, v: String) {
652 self.message.body.set_field(tag::ORD_TYPE, FIXString::from(v));
653 }
654
655 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 pub fn has_ord_type(&self) -> bool {
665 self.message.body.has(tag::ORD_TYPE)
666 }
667
668
669
670
671 pub fn set_order_id(&mut self, v: String) {
673 self.message.body.set_field(tag::ORDER_ID, FIXString::from(v));
674 }
675
676 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 pub fn has_order_id(&self) -> bool {
686 self.message.body.has(tag::ORDER_ID)
687 }
688
689
690
691
692 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 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 pub fn has_order_qty(&self) -> bool {
707 self.message.body.has(tag::ORDER_QTY)
708 }
709
710
711
712
713 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 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 pub fn has_order_qty2(&self) -> bool {
728 self.message.body.has(tag::ORDER_QTY2)
729 }
730
731
732
733
734 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 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 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 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 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 pub fn has_peg_difference(&self) -> bool {
770 self.message.body.has(tag::PEG_DIFFERENCE)
771 }
772
773
774
775
776 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 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 pub fn has_price(&self) -> bool {
791 self.message.body.has(tag::PRICE)
792 }
793
794
795
796
797 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 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 pub fn has_put_or_call(&self) -> bool {
812 self.message.body.has(tag::PUT_OR_CALL)
813 }
814
815
816
817
818 pub fn set_rule80_a(&mut self, v: String) {
820 self.message.body.set_field(tag::RULE80_A, FIXString::from(v));
821 }
822
823 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 pub fn has_rule80_a(&self) -> bool {
833 self.message.body.has(tag::RULE80_A)
834 }
835
836
837
838
839 pub fn set_security_desc(&mut self, v: String) {
841 self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
842 }
843
844 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 pub fn has_security_desc(&self) -> bool {
854 self.message.body.has(tag::SECURITY_DESC)
855 }
856
857
858
859
860 pub fn set_security_exchange(&mut self, v: String) {
862 self.message.body.set_field(tag::SECURITY_EXCHANGE, FIXString::from(v));
863 }
864
865 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 pub fn has_security_exchange(&self) -> bool {
875 self.message.body.has(tag::SECURITY_EXCHANGE)
876 }
877
878
879
880
881 pub fn set_security_id(&mut self, v: String) {
883 self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
884 }
885
886 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 pub fn has_security_id(&self) -> bool {
896 self.message.body.has(tag::SECURITY_ID)
897 }
898
899
900
901
902 pub fn set_security_type(&mut self, v: String) {
904 self.message.body.set_field(tag::SECURITY_TYPE, FIXString::from(v));
905 }
906
907 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 pub fn has_security_type(&self) -> bool {
917 self.message.body.has(tag::SECURITY_TYPE)
918 }
919
920
921
922
923 pub fn set_settl_currency(&mut self, v: String) {
925 self.message.body.set_field(tag::SETTL_CURRENCY, FIXString::from(v));
926 }
927
928 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 pub fn has_settl_currency(&self) -> bool {
938 self.message.body.has(tag::SETTL_CURRENCY)
939 }
940
941
942
943
944 pub fn set_settlmnt_typ(&mut self, v: String) {
946 self.message.body.set_field(tag::SETTLMNT_TYP, FIXString::from(v));
947 }
948
949 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 pub fn has_settlmnt_typ(&self) -> bool {
959 self.message.body.has(tag::SETTLMNT_TYP)
960 }
961
962
963
964
965 pub fn set_side(&mut self, v: String) {
967 self.message.body.set_field(tag::SIDE, FIXString::from(v));
968 }
969
970 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 pub fn has_side(&self) -> bool {
980 self.message.body.has(tag::SIDE)
981 }
982
983
984
985
986 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 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 pub fn has_stop_px(&self) -> bool {
1001 self.message.body.has(tag::STOP_PX)
1002 }
1003
1004
1005
1006
1007 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 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 pub fn has_strike_price(&self) -> bool {
1022 self.message.body.has(tag::STRIKE_PRICE)
1023 }
1024
1025
1026
1027
1028 pub fn set_symbol(&mut self, v: String) {
1030 self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
1031 }
1032
1033 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 pub fn has_symbol(&self) -> bool {
1043 self.message.body.has(tag::SYMBOL)
1044 }
1045
1046
1047
1048
1049 pub fn set_symbol_sfx(&mut self, v: String) {
1051 self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
1052 }
1053
1054 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 pub fn has_symbol_sfx(&self) -> bool {
1064 self.message.body.has(tag::SYMBOL_SFX)
1065 }
1066
1067
1068
1069
1070 pub fn set_text(&mut self, v: String) {
1072 self.message.body.set_field(tag::TEXT, FIXString::from(v));
1073 }
1074
1075 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 pub fn has_text(&self) -> bool {
1085 self.message.body.has(tag::TEXT)
1086 }
1087
1088
1089
1090
1091 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 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 pub fn has_time_in_force(&self) -> bool {
1106 self.message.body.has(tag::TIME_IN_FORCE)
1107 }
1108
1109
1110}
1111
1112pub type RouteOut = fn(msg: OrderCancelReplaceRequest, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
1114
1115pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
1117
1118pub 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}