Skip to main content

fixer_fix/fix40/
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 `fix40` `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, order_qty: field::OrderQtyField, 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::ORDER_QTY, order_qty.0);
42
43        msg.body.set_field(tag::ORD_TYPE, ord_type.0);
44
45        Self { message: msg }
46    }
47
48    /// Creates a `OrderCancelReplaceRequest` from an existing `Message`.
49    pub fn from_message(msg: Message) -> Self {
50        Self { message: msg }
51    }
52
53    /// Returns the underlying `Message`.
54    pub fn to_message(self) -> Message {
55        self.message
56    }
57
58
59
60
61    /// Sets `Account`, Tag 1.
62    pub fn set_account(&mut self, v: String) {
63        self.message.body.set_field(tag::ACCOUNT, FIXString::from(v));
64    }
65
66    /// Gets `Account`, Tag 1.
67    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    /// Returns true if `Account` is present, Tag 1.
75    pub fn has_account(&self) -> bool {
76        self.message.body.has(tag::ACCOUNT)
77    }
78
79
80
81
82    /// Sets `ClOrdID`, Tag 11.
83    pub fn set_cl_ord_id(&mut self, v: String) {
84        self.message.body.set_field(tag::CL_ORD_ID, FIXString::from(v));
85    }
86
87    /// Gets `ClOrdID`, Tag 11.
88    pub fn get_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
89        let mut fld = field::ClOrdIDField::new(String::new());
90        self.message.body.get_field(tag::CL_ORD_ID, &mut fld.0)?;
91        Ok(fld.value().to_string())
92    }
93
94
95    /// Returns true if `ClOrdID` is present, Tag 11.
96    pub fn has_cl_ord_id(&self) -> bool {
97        self.message.body.has(tag::CL_ORD_ID)
98    }
99
100
101
102
103    /// Sets `ClientID`, Tag 109.
104    pub fn set_client_id(&mut self, v: String) {
105        self.message.body.set_field(tag::CLIENT_ID, FIXString::from(v));
106    }
107
108    /// Gets `ClientID`, Tag 109.
109    pub fn get_client_id(&self) -> Result<String, MessageRejectErrorEnum> {
110        let mut fld = field::ClientIDField::new(String::new());
111        self.message.body.get_field(tag::CLIENT_ID, &mut fld.0)?;
112        Ok(fld.value().to_string())
113    }
114
115
116    /// Returns true if `ClientID` is present, Tag 109.
117    pub fn has_client_id(&self) -> bool {
118        self.message.body.has(tag::CLIENT_ID)
119    }
120
121
122
123
124    /// Sets `CommType`, Tag 13.
125    pub fn set_comm_type(&mut self, v: String) {
126        self.message.body.set_field(tag::COMM_TYPE, FIXString::from(v));
127    }
128
129    /// Gets `CommType`, Tag 13.
130    pub fn get_comm_type(&self) -> Result<String, MessageRejectErrorEnum> {
131        let mut fld = field::CommTypeField::new(String::new());
132        self.message.body.get_field(tag::COMM_TYPE, &mut fld.0)?;
133        Ok(fld.value().to_string())
134    }
135
136
137    /// Returns true if `CommType` is present, Tag 13.
138    pub fn has_comm_type(&self) -> bool {
139        self.message.body.has(tag::COMM_TYPE)
140    }
141
142
143
144
145    /// Sets `Commission`, Tag 12.
146    pub fn set_commission(&mut self, val: Decimal, scale: i32) {
147        self.message.body.set_field(tag::COMMISSION, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
148    }
149
150    /// Gets `Commission`, Tag 12.
151    pub fn get_commission(&self) -> Result<Decimal, MessageRejectErrorEnum> {
152        let mut fld = field::CommissionField::new(Decimal::ZERO, 0);
153        self.message.body.get_field(tag::COMMISSION, &mut fld.0)?;
154        Ok(fld.value())
155    }
156
157
158    /// Returns true if `Commission` is present, Tag 12.
159    pub fn has_commission(&self) -> bool {
160        self.message.body.has(tag::COMMISSION)
161    }
162
163
164
165
166    /// Sets `Currency`, Tag 15.
167    pub fn set_currency(&mut self, v: String) {
168        self.message.body.set_field(tag::CURRENCY, FIXString::from(v));
169    }
170
171    /// Gets `Currency`, Tag 15.
172    pub fn get_currency(&self) -> Result<String, MessageRejectErrorEnum> {
173        let mut fld = field::CurrencyField::new(String::new());
174        self.message.body.get_field(tag::CURRENCY, &mut fld.0)?;
175        Ok(fld.value().to_string())
176    }
177
178
179    /// Returns true if `Currency` is present, Tag 15.
180    pub fn has_currency(&self) -> bool {
181        self.message.body.has(tag::CURRENCY)
182    }
183
184
185
186
187    /// Sets `ExDestination`, Tag 100.
188    pub fn set_ex_destination(&mut self, v: String) {
189        self.message.body.set_field(tag::EX_DESTINATION, FIXString::from(v));
190    }
191
192    /// Gets `ExDestination`, Tag 100.
193    pub fn get_ex_destination(&self) -> Result<String, MessageRejectErrorEnum> {
194        let mut fld = field::ExDestinationField::new(String::new());
195        self.message.body.get_field(tag::EX_DESTINATION, &mut fld.0)?;
196        Ok(fld.value().to_string())
197    }
198
199
200    /// Returns true if `ExDestination` is present, Tag 100.
201    pub fn has_ex_destination(&self) -> bool {
202        self.message.body.has(tag::EX_DESTINATION)
203    }
204
205
206
207
208    /// Sets `ExecBroker`, Tag 76.
209    pub fn set_exec_broker(&mut self, v: String) {
210        self.message.body.set_field(tag::EXEC_BROKER, FIXString::from(v));
211    }
212
213    /// Gets `ExecBroker`, Tag 76.
214    pub fn get_exec_broker(&self) -> Result<String, MessageRejectErrorEnum> {
215        let mut fld = field::ExecBrokerField::new(String::new());
216        self.message.body.get_field(tag::EXEC_BROKER, &mut fld.0)?;
217        Ok(fld.value().to_string())
218    }
219
220
221    /// Returns true if `ExecBroker` is present, Tag 76.
222    pub fn has_exec_broker(&self) -> bool {
223        self.message.body.has(tag::EXEC_BROKER)
224    }
225
226
227
228
229    /// Sets `ExecInst`, Tag 18.
230    pub fn set_exec_inst(&mut self, v: String) {
231        self.message.body.set_field(tag::EXEC_INST, FIXString::from(v));
232    }
233
234    /// Gets `ExecInst`, Tag 18.
235    pub fn get_exec_inst(&self) -> Result<String, MessageRejectErrorEnum> {
236        let mut fld = field::ExecInstField::new(String::new());
237        self.message.body.get_field(tag::EXEC_INST, &mut fld.0)?;
238        Ok(fld.value().to_string())
239    }
240
241
242    /// Returns true if `ExecInst` is present, Tag 18.
243    pub fn has_exec_inst(&self) -> bool {
244        self.message.body.has(tag::EXEC_INST)
245    }
246
247
248
249
250    /// Sets `ExpireTime`, Tag 126.
251    pub fn set_expire_time(&mut self, v: Timestamp) {
252        self.message.body.set_field(tag::EXPIRE_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
253            time: v,
254            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
255        });
256    }
257
258    /// Gets `ExpireTime`, Tag 126.
259    pub fn get_expire_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
260        let mut fld = field::ExpireTimeField::new(Timestamp::UNIX_EPOCH);
261        self.message.body.get_field(tag::EXPIRE_TIME, &mut fld.0)?;
262        Ok(fld.value())
263    }
264
265
266    /// Returns true if `ExpireTime` is present, Tag 126.
267    pub fn has_expire_time(&self) -> bool {
268        self.message.body.has(tag::EXPIRE_TIME)
269    }
270
271
272
273
274    /// Sets `ForexReq`, Tag 121.
275    pub fn set_forex_req(&mut self, v: bool) {
276        self.message.body.set_field(tag::FOREX_REQ, fixer::fix_boolean::FIXBoolean::from(v));
277    }
278
279    /// Gets `ForexReq`, Tag 121.
280    pub fn get_forex_req(&self) -> Result<bool, MessageRejectErrorEnum> {
281        let mut fld = field::ForexReqField::new(false);
282        self.message.body.get_field(tag::FOREX_REQ, &mut fld.0)?;
283        Ok(fld.value())
284    }
285
286
287    /// Returns true if `ForexReq` is present, Tag 121.
288    pub fn has_forex_req(&self) -> bool {
289        self.message.body.has(tag::FOREX_REQ)
290    }
291
292
293
294
295    /// Sets `FutSettDate`, Tag 64.
296    pub fn set_fut_sett_date(&mut self, v: String) {
297        self.message.body.set_field(tag::FUT_SETT_DATE, FIXString::from(v));
298    }
299
300    /// Gets `FutSettDate`, Tag 64.
301    pub fn get_fut_sett_date(&self) -> Result<String, MessageRejectErrorEnum> {
302        let mut fld = field::FutSettDateField::new(String::new());
303        self.message.body.get_field(tag::FUT_SETT_DATE, &mut fld.0)?;
304        Ok(fld.value().to_string())
305    }
306
307
308    /// Returns true if `FutSettDate` is present, Tag 64.
309    pub fn has_fut_sett_date(&self) -> bool {
310        self.message.body.has(tag::FUT_SETT_DATE)
311    }
312
313
314
315
316    /// Sets `HandlInst`, Tag 21.
317    pub fn set_handl_inst(&mut self, v: String) {
318        self.message.body.set_field(tag::HANDL_INST, FIXString::from(v));
319    }
320
321    /// Gets `HandlInst`, Tag 21.
322    pub fn get_handl_inst(&self) -> Result<String, MessageRejectErrorEnum> {
323        let mut fld = field::HandlInstField::new(String::new());
324        self.message.body.get_field(tag::HANDL_INST, &mut fld.0)?;
325        Ok(fld.value().to_string())
326    }
327
328
329    /// Returns true if `HandlInst` is present, Tag 21.
330    pub fn has_handl_inst(&self) -> bool {
331        self.message.body.has(tag::HANDL_INST)
332    }
333
334
335
336
337    /// Sets `IDSource`, Tag 22.
338    pub fn set_id_source(&mut self, v: String) {
339        self.message.body.set_field(tag::ID_SOURCE, FIXString::from(v));
340    }
341
342    /// Gets `IDSource`, Tag 22.
343    pub fn get_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
344        let mut fld = field::IDSourceField::new(String::new());
345        self.message.body.get_field(tag::ID_SOURCE, &mut fld.0)?;
346        Ok(fld.value().to_string())
347    }
348
349
350    /// Returns true if `IDSource` is present, Tag 22.
351    pub fn has_id_source(&self) -> bool {
352        self.message.body.has(tag::ID_SOURCE)
353    }
354
355
356
357
358    /// Sets `Issuer`, Tag 106.
359    pub fn set_issuer(&mut self, v: String) {
360        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
361    }
362
363    /// Gets `Issuer`, Tag 106.
364    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
365        let mut fld = field::IssuerField::new(String::new());
366        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
367        Ok(fld.value().to_string())
368    }
369
370
371    /// Returns true if `Issuer` is present, Tag 106.
372    pub fn has_issuer(&self) -> bool {
373        self.message.body.has(tag::ISSUER)
374    }
375
376
377
378
379    /// Sets `ListID`, Tag 66.
380    pub fn set_list_id(&mut self, v: String) {
381        self.message.body.set_field(tag::LIST_ID, FIXString::from(v));
382    }
383
384    /// Gets `ListID`, Tag 66.
385    pub fn get_list_id(&self) -> Result<String, MessageRejectErrorEnum> {
386        let mut fld = field::ListIDField::new(String::new());
387        self.message.body.get_field(tag::LIST_ID, &mut fld.0)?;
388        Ok(fld.value().to_string())
389    }
390
391
392    /// Returns true if `ListID` is present, Tag 66.
393    pub fn has_list_id(&self) -> bool {
394        self.message.body.has(tag::LIST_ID)
395    }
396
397
398
399
400    /// Sets `MaxFloor`, Tag 111.
401    pub fn set_max_floor(&mut self, val: Decimal, scale: i32) {
402        self.message.body.set_field(tag::MAX_FLOOR, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
403    }
404
405    /// Gets `MaxFloor`, Tag 111.
406    pub fn get_max_floor(&self) -> Result<Decimal, MessageRejectErrorEnum> {
407        let mut fld = field::MaxFloorField::new(Decimal::ZERO, 0);
408        self.message.body.get_field(tag::MAX_FLOOR, &mut fld.0)?;
409        Ok(fld.value())
410    }
411
412
413    /// Returns true if `MaxFloor` is present, Tag 111.
414    pub fn has_max_floor(&self) -> bool {
415        self.message.body.has(tag::MAX_FLOOR)
416    }
417
418
419
420
421    /// Sets `MinQty`, Tag 110.
422    pub fn set_min_qty(&mut self, val: Decimal, scale: i32) {
423        self.message.body.set_field(tag::MIN_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
424    }
425
426    /// Gets `MinQty`, Tag 110.
427    pub fn get_min_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
428        let mut fld = field::MinQtyField::new(Decimal::ZERO, 0);
429        self.message.body.get_field(tag::MIN_QTY, &mut fld.0)?;
430        Ok(fld.value())
431    }
432
433
434    /// Returns true if `MinQty` is present, Tag 110.
435    pub fn has_min_qty(&self) -> bool {
436        self.message.body.has(tag::MIN_QTY)
437    }
438
439
440
441
442    /// Sets `OrdType`, Tag 40.
443    pub fn set_ord_type(&mut self, v: String) {
444        self.message.body.set_field(tag::ORD_TYPE, FIXString::from(v));
445    }
446
447    /// Gets `OrdType`, Tag 40.
448    pub fn get_ord_type(&self) -> Result<String, MessageRejectErrorEnum> {
449        let mut fld = field::OrdTypeField::new(String::new());
450        self.message.body.get_field(tag::ORD_TYPE, &mut fld.0)?;
451        Ok(fld.value().to_string())
452    }
453
454
455    /// Returns true if `OrdType` is present, Tag 40.
456    pub fn has_ord_type(&self) -> bool {
457        self.message.body.has(tag::ORD_TYPE)
458    }
459
460
461
462
463    /// Sets `OrderID`, Tag 37.
464    pub fn set_order_id(&mut self, v: String) {
465        self.message.body.set_field(tag::ORDER_ID, FIXString::from(v));
466    }
467
468    /// Gets `OrderID`, Tag 37.
469    pub fn get_order_id(&self) -> Result<String, MessageRejectErrorEnum> {
470        let mut fld = field::OrderIDField::new(String::new());
471        self.message.body.get_field(tag::ORDER_ID, &mut fld.0)?;
472        Ok(fld.value().to_string())
473    }
474
475
476    /// Returns true if `OrderID` is present, Tag 37.
477    pub fn has_order_id(&self) -> bool {
478        self.message.body.has(tag::ORDER_ID)
479    }
480
481
482
483
484    /// Sets `OrderQty`, Tag 38.
485    pub fn set_order_qty(&mut self, val: Decimal, scale: i32) {
486        self.message.body.set_field(tag::ORDER_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
487    }
488
489    /// Gets `OrderQty`, Tag 38.
490    pub fn get_order_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
491        let mut fld = field::OrderQtyField::new(Decimal::ZERO, 0);
492        self.message.body.get_field(tag::ORDER_QTY, &mut fld.0)?;
493        Ok(fld.value())
494    }
495
496
497    /// Returns true if `OrderQty` is present, Tag 38.
498    pub fn has_order_qty(&self) -> bool {
499        self.message.body.has(tag::ORDER_QTY)
500    }
501
502
503
504
505    /// Sets `OrigClOrdID`, Tag 41.
506    pub fn set_orig_cl_ord_id(&mut self, v: String) {
507        self.message.body.set_field(tag::ORIG_CL_ORD_ID, FIXString::from(v));
508    }
509
510    /// Gets `OrigClOrdID`, Tag 41.
511    pub fn get_orig_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
512        let mut fld = field::OrigClOrdIDField::new(String::new());
513        self.message.body.get_field(tag::ORIG_CL_ORD_ID, &mut fld.0)?;
514        Ok(fld.value().to_string())
515    }
516
517
518    /// Returns true if `OrigClOrdID` is present, Tag 41.
519    pub fn has_orig_cl_ord_id(&self) -> bool {
520        self.message.body.has(tag::ORIG_CL_ORD_ID)
521    }
522
523
524
525
526    /// Sets `Price`, Tag 44.
527    pub fn set_price(&mut self, val: Decimal, scale: i32) {
528        self.message.body.set_field(tag::PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
529    }
530
531    /// Gets `Price`, Tag 44.
532    pub fn get_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
533        let mut fld = field::PriceField::new(Decimal::ZERO, 0);
534        self.message.body.get_field(tag::PRICE, &mut fld.0)?;
535        Ok(fld.value())
536    }
537
538
539    /// Returns true if `Price` is present, Tag 44.
540    pub fn has_price(&self) -> bool {
541        self.message.body.has(tag::PRICE)
542    }
543
544
545
546
547    /// Sets `Rule80A`, Tag 47.
548    pub fn set_rule80_a(&mut self, v: String) {
549        self.message.body.set_field(tag::RULE80_A, FIXString::from(v));
550    }
551
552    /// Gets `Rule80A`, Tag 47.
553    pub fn get_rule80_a(&self) -> Result<String, MessageRejectErrorEnum> {
554        let mut fld = field::Rule80AField::new(String::new());
555        self.message.body.get_field(tag::RULE80_A, &mut fld.0)?;
556        Ok(fld.value().to_string())
557    }
558
559
560    /// Returns true if `Rule80A` is present, Tag 47.
561    pub fn has_rule80_a(&self) -> bool {
562        self.message.body.has(tag::RULE80_A)
563    }
564
565
566
567
568    /// Sets `SecurityDesc`, Tag 107.
569    pub fn set_security_desc(&mut self, v: String) {
570        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
571    }
572
573    /// Gets `SecurityDesc`, Tag 107.
574    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
575        let mut fld = field::SecurityDescField::new(String::new());
576        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
577        Ok(fld.value().to_string())
578    }
579
580
581    /// Returns true if `SecurityDesc` is present, Tag 107.
582    pub fn has_security_desc(&self) -> bool {
583        self.message.body.has(tag::SECURITY_DESC)
584    }
585
586
587
588
589    /// Sets `SecurityID`, Tag 48.
590    pub fn set_security_id(&mut self, v: String) {
591        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
592    }
593
594    /// Gets `SecurityID`, Tag 48.
595    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
596        let mut fld = field::SecurityIDField::new(String::new());
597        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
598        Ok(fld.value().to_string())
599    }
600
601
602    /// Returns true if `SecurityID` is present, Tag 48.
603    pub fn has_security_id(&self) -> bool {
604        self.message.body.has(tag::SECURITY_ID)
605    }
606
607
608
609
610    /// Sets `SettlCurrency`, Tag 120.
611    pub fn set_settl_currency(&mut self, v: String) {
612        self.message.body.set_field(tag::SETTL_CURRENCY, FIXString::from(v));
613    }
614
615    /// Gets `SettlCurrency`, Tag 120.
616    pub fn get_settl_currency(&self) -> Result<String, MessageRejectErrorEnum> {
617        let mut fld = field::SettlCurrencyField::new(String::new());
618        self.message.body.get_field(tag::SETTL_CURRENCY, &mut fld.0)?;
619        Ok(fld.value().to_string())
620    }
621
622
623    /// Returns true if `SettlCurrency` is present, Tag 120.
624    pub fn has_settl_currency(&self) -> bool {
625        self.message.body.has(tag::SETTL_CURRENCY)
626    }
627
628
629
630
631    /// Sets `SettlmntTyp`, Tag 63.
632    pub fn set_settlmnt_typ(&mut self, v: String) {
633        self.message.body.set_field(tag::SETTLMNT_TYP, FIXString::from(v));
634    }
635
636    /// Gets `SettlmntTyp`, Tag 63.
637    pub fn get_settlmnt_typ(&self) -> Result<String, MessageRejectErrorEnum> {
638        let mut fld = field::SettlmntTypField::new(String::new());
639        self.message.body.get_field(tag::SETTLMNT_TYP, &mut fld.0)?;
640        Ok(fld.value().to_string())
641    }
642
643
644    /// Returns true if `SettlmntTyp` is present, Tag 63.
645    pub fn has_settlmnt_typ(&self) -> bool {
646        self.message.body.has(tag::SETTLMNT_TYP)
647    }
648
649
650
651
652    /// Sets `Side`, Tag 54.
653    pub fn set_side(&mut self, v: String) {
654        self.message.body.set_field(tag::SIDE, FIXString::from(v));
655    }
656
657    /// Gets `Side`, Tag 54.
658    pub fn get_side(&self) -> Result<String, MessageRejectErrorEnum> {
659        let mut fld = field::SideField::new(String::new());
660        self.message.body.get_field(tag::SIDE, &mut fld.0)?;
661        Ok(fld.value().to_string())
662    }
663
664
665    /// Returns true if `Side` is present, Tag 54.
666    pub fn has_side(&self) -> bool {
667        self.message.body.has(tag::SIDE)
668    }
669
670
671
672
673    /// Sets `StopPx`, Tag 99.
674    pub fn set_stop_px(&mut self, val: Decimal, scale: i32) {
675        self.message.body.set_field(tag::STOP_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
676    }
677
678    /// Gets `StopPx`, Tag 99.
679    pub fn get_stop_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
680        let mut fld = field::StopPxField::new(Decimal::ZERO, 0);
681        self.message.body.get_field(tag::STOP_PX, &mut fld.0)?;
682        Ok(fld.value())
683    }
684
685
686    /// Returns true if `StopPx` is present, Tag 99.
687    pub fn has_stop_px(&self) -> bool {
688        self.message.body.has(tag::STOP_PX)
689    }
690
691
692
693
694    /// Sets `Symbol`, Tag 55.
695    pub fn set_symbol(&mut self, v: String) {
696        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
697    }
698
699    /// Gets `Symbol`, Tag 55.
700    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
701        let mut fld = field::SymbolField::new(String::new());
702        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
703        Ok(fld.value().to_string())
704    }
705
706
707    /// Returns true if `Symbol` is present, Tag 55.
708    pub fn has_symbol(&self) -> bool {
709        self.message.body.has(tag::SYMBOL)
710    }
711
712
713
714
715    /// Sets `SymbolSfx`, Tag 65.
716    pub fn set_symbol_sfx(&mut self, v: String) {
717        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
718    }
719
720    /// Gets `SymbolSfx`, Tag 65.
721    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
722        let mut fld = field::SymbolSfxField::new(String::new());
723        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
724        Ok(fld.value().to_string())
725    }
726
727
728    /// Returns true if `SymbolSfx` is present, Tag 65.
729    pub fn has_symbol_sfx(&self) -> bool {
730        self.message.body.has(tag::SYMBOL_SFX)
731    }
732
733
734
735
736    /// Sets `Text`, Tag 58.
737    pub fn set_text(&mut self, v: String) {
738        self.message.body.set_field(tag::TEXT, FIXString::from(v));
739    }
740
741    /// Gets `Text`, Tag 58.
742    pub fn get_text(&self) -> Result<String, MessageRejectErrorEnum> {
743        let mut fld = field::TextField::new(String::new());
744        self.message.body.get_field(tag::TEXT, &mut fld.0)?;
745        Ok(fld.value().to_string())
746    }
747
748
749    /// Returns true if `Text` is present, Tag 58.
750    pub fn has_text(&self) -> bool {
751        self.message.body.has(tag::TEXT)
752    }
753
754
755
756
757    /// Sets `TimeInForce`, Tag 59.
758    pub fn set_time_in_force(&mut self, v: String) {
759        self.message.body.set_field(tag::TIME_IN_FORCE, FIXString::from(v));
760    }
761
762    /// Gets `TimeInForce`, Tag 59.
763    pub fn get_time_in_force(&self) -> Result<String, MessageRejectErrorEnum> {
764        let mut fld = field::TimeInForceField::new(String::new());
765        self.message.body.get_field(tag::TIME_IN_FORCE, &mut fld.0)?;
766        Ok(fld.value().to_string())
767    }
768
769
770    /// Returns true if `TimeInForce` is present, Tag 59.
771    pub fn has_time_in_force(&self) -> bool {
772        self.message.body.has(tag::TIME_IN_FORCE)
773    }
774
775
776}
777
778/// `RouteOut` is the callback type for routing `OrderCancelReplaceRequest` messages.
779pub type RouteOut = fn(msg: OrderCancelReplaceRequest, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
780
781/// Route type returned by the `route` function.
782pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
783
784/// Returns the begin string, message type, and route function for `OrderCancelReplaceRequest`.
785pub fn route(router: RouteOut) -> Route {
786    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
787        router(OrderCancelReplaceRequest::from_message(msg.clone()), session_id)
788    };
789    ("FIX.4.0", "G", Box::new(r))
790}