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