Skip to main content

fixer_fix/fix42/
order_cancel_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/// `OrderCancelRequest` is the `fix42` `OrderCancelRequest` type, `MsgType` = F.
21pub struct OrderCancelRequest {
22    pub message: Message,
23}
24
25impl OrderCancelRequest {
26    /// Creates a new `OrderCancelRequest` with required fields.
27    pub fn new(orig_cl_ord_id: field::OrigClOrdIDField, cl_ord_id: field::ClOrdIDField, symbol: field::SymbolField, side: field::SideField, transact_time: field::TransactTimeField) -> Self {
28        let mut msg = Message::new();
29        msg.header.set_field(tag::MSG_TYPE, FIXString::from("F".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::SYMBOL, symbol.0);
36
37        msg.body.set_field(tag::SIDE, side.0);
38
39        msg.body.set_field(tag::TRANSACT_TIME, transact_time.0);
40
41        Self { message: msg }
42    }
43
44    /// Creates a `OrderCancelRequest` from an existing `Message`.
45    pub fn from_message(msg: Message) -> Self {
46        Self { message: msg }
47    }
48
49    /// Returns the underlying `Message`.
50    pub fn to_message(self) -> Message {
51        self.message
52    }
53
54
55
56
57    /// Sets `Account`, Tag 1.
58    pub fn set_account(&mut self, v: String) {
59        self.message.body.set_field(tag::ACCOUNT, FIXString::from(v));
60    }
61
62    /// Gets `Account`, Tag 1.
63    pub fn get_account(&self) -> Result<String, MessageRejectErrorEnum> {
64        let mut fld = field::AccountField::new(String::new());
65        self.message.body.get_field(tag::ACCOUNT, &mut fld.0)?;
66        Ok(fld.value().to_string())
67    }
68
69
70    /// Returns true if `Account` is present, Tag 1.
71    pub fn has_account(&self) -> bool {
72        self.message.body.has(tag::ACCOUNT)
73    }
74
75
76
77
78    /// Sets `CashOrderQty`, Tag 152.
79    pub fn set_cash_order_qty(&mut self, val: Decimal, scale: i32) {
80        self.message.body.set_field(tag::CASH_ORDER_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
81    }
82
83    /// Gets `CashOrderQty`, Tag 152.
84    pub fn get_cash_order_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
85        let mut fld = field::CashOrderQtyField::new(Decimal::ZERO, 0);
86        self.message.body.get_field(tag::CASH_ORDER_QTY, &mut fld.0)?;
87        Ok(fld.value())
88    }
89
90
91    /// Returns true if `CashOrderQty` is present, Tag 152.
92    pub fn has_cash_order_qty(&self) -> bool {
93        self.message.body.has(tag::CASH_ORDER_QTY)
94    }
95
96
97
98
99    /// Sets `ClOrdID`, Tag 11.
100    pub fn set_cl_ord_id(&mut self, v: String) {
101        self.message.body.set_field(tag::CL_ORD_ID, FIXString::from(v));
102    }
103
104    /// Gets `ClOrdID`, Tag 11.
105    pub fn get_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
106        let mut fld = field::ClOrdIDField::new(String::new());
107        self.message.body.get_field(tag::CL_ORD_ID, &mut fld.0)?;
108        Ok(fld.value().to_string())
109    }
110
111
112    /// Returns true if `ClOrdID` is present, Tag 11.
113    pub fn has_cl_ord_id(&self) -> bool {
114        self.message.body.has(tag::CL_ORD_ID)
115    }
116
117
118
119
120    /// Sets `ClientID`, Tag 109.
121    pub fn set_client_id(&mut self, v: String) {
122        self.message.body.set_field(tag::CLIENT_ID, FIXString::from(v));
123    }
124
125    /// Gets `ClientID`, Tag 109.
126    pub fn get_client_id(&self) -> Result<String, MessageRejectErrorEnum> {
127        let mut fld = field::ClientIDField::new(String::new());
128        self.message.body.get_field(tag::CLIENT_ID, &mut fld.0)?;
129        Ok(fld.value().to_string())
130    }
131
132
133    /// Returns true if `ClientID` is present, Tag 109.
134    pub fn has_client_id(&self) -> bool {
135        self.message.body.has(tag::CLIENT_ID)
136    }
137
138
139
140
141    /// Sets `ComplianceID`, Tag 376.
142    pub fn set_compliance_id(&mut self, v: String) {
143        self.message.body.set_field(tag::COMPLIANCE_ID, FIXString::from(v));
144    }
145
146    /// Gets `ComplianceID`, Tag 376.
147    pub fn get_compliance_id(&self) -> Result<String, MessageRejectErrorEnum> {
148        let mut fld = field::ComplianceIDField::new(String::new());
149        self.message.body.get_field(tag::COMPLIANCE_ID, &mut fld.0)?;
150        Ok(fld.value().to_string())
151    }
152
153
154    /// Returns true if `ComplianceID` is present, Tag 376.
155    pub fn has_compliance_id(&self) -> bool {
156        self.message.body.has(tag::COMPLIANCE_ID)
157    }
158
159
160
161
162    /// Sets `ContractMultiplier`, Tag 231.
163    pub fn set_contract_multiplier(&mut self, val: Decimal, scale: i32) {
164        self.message.body.set_field(tag::CONTRACT_MULTIPLIER, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
165    }
166
167    /// Gets `ContractMultiplier`, Tag 231.
168    pub fn get_contract_multiplier(&self) -> Result<Decimal, MessageRejectErrorEnum> {
169        let mut fld = field::ContractMultiplierField::new(Decimal::ZERO, 0);
170        self.message.body.get_field(tag::CONTRACT_MULTIPLIER, &mut fld.0)?;
171        Ok(fld.value())
172    }
173
174
175    /// Returns true if `ContractMultiplier` is present, Tag 231.
176    pub fn has_contract_multiplier(&self) -> bool {
177        self.message.body.has(tag::CONTRACT_MULTIPLIER)
178    }
179
180
181
182
183    /// Sets `CouponRate`, Tag 223.
184    pub fn set_coupon_rate(&mut self, val: Decimal, scale: i32) {
185        self.message.body.set_field(tag::COUPON_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
186    }
187
188    /// Gets `CouponRate`, Tag 223.
189    pub fn get_coupon_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
190        let mut fld = field::CouponRateField::new(Decimal::ZERO, 0);
191        self.message.body.get_field(tag::COUPON_RATE, &mut fld.0)?;
192        Ok(fld.value())
193    }
194
195
196    /// Returns true if `CouponRate` is present, Tag 223.
197    pub fn has_coupon_rate(&self) -> bool {
198        self.message.body.has(tag::COUPON_RATE)
199    }
200
201
202
203
204    /// Sets `EncodedIssuer`, Tag 349.
205    pub fn set_encoded_issuer(&mut self, v: String) {
206        self.message.body.set_field(tag::ENCODED_ISSUER, FIXString::from(v));
207    }
208
209    /// Gets `EncodedIssuer`, Tag 349.
210    pub fn get_encoded_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
211        let mut fld = field::EncodedIssuerField::new(String::new());
212        self.message.body.get_field(tag::ENCODED_ISSUER, &mut fld.0)?;
213        Ok(fld.value().to_string())
214    }
215
216
217    /// Returns true if `EncodedIssuer` is present, Tag 349.
218    pub fn has_encoded_issuer(&self) -> bool {
219        self.message.body.has(tag::ENCODED_ISSUER)
220    }
221
222
223
224
225    /// Sets `EncodedIssuerLen`, Tag 348.
226    pub fn set_encoded_issuer_len(&mut self, v: isize) {
227        self.message.body.set_field(tag::ENCODED_ISSUER_LEN, fixer::fix_int::FIXInt::from(v));
228    }
229
230    /// Gets `EncodedIssuerLen`, Tag 348.
231    pub fn get_encoded_issuer_len(&self) -> Result<isize, MessageRejectErrorEnum> {
232        let mut fld = field::EncodedIssuerLenField::new(0);
233        self.message.body.get_field(tag::ENCODED_ISSUER_LEN, &mut fld.0)?;
234        Ok(fld.value())
235    }
236
237
238    /// Returns true if `EncodedIssuerLen` is present, Tag 348.
239    pub fn has_encoded_issuer_len(&self) -> bool {
240        self.message.body.has(tag::ENCODED_ISSUER_LEN)
241    }
242
243
244
245
246    /// Sets `EncodedSecurityDesc`, Tag 351.
247    pub fn set_encoded_security_desc(&mut self, v: String) {
248        self.message.body.set_field(tag::ENCODED_SECURITY_DESC, FIXString::from(v));
249    }
250
251    /// Gets `EncodedSecurityDesc`, Tag 351.
252    pub fn get_encoded_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
253        let mut fld = field::EncodedSecurityDescField::new(String::new());
254        self.message.body.get_field(tag::ENCODED_SECURITY_DESC, &mut fld.0)?;
255        Ok(fld.value().to_string())
256    }
257
258
259    /// Returns true if `EncodedSecurityDesc` is present, Tag 351.
260    pub fn has_encoded_security_desc(&self) -> bool {
261        self.message.body.has(tag::ENCODED_SECURITY_DESC)
262    }
263
264
265
266
267    /// Sets `EncodedSecurityDescLen`, Tag 350.
268    pub fn set_encoded_security_desc_len(&mut self, v: isize) {
269        self.message.body.set_field(tag::ENCODED_SECURITY_DESC_LEN, fixer::fix_int::FIXInt::from(v));
270    }
271
272    /// Gets `EncodedSecurityDescLen`, Tag 350.
273    pub fn get_encoded_security_desc_len(&self) -> Result<isize, MessageRejectErrorEnum> {
274        let mut fld = field::EncodedSecurityDescLenField::new(0);
275        self.message.body.get_field(tag::ENCODED_SECURITY_DESC_LEN, &mut fld.0)?;
276        Ok(fld.value())
277    }
278
279
280    /// Returns true if `EncodedSecurityDescLen` is present, Tag 350.
281    pub fn has_encoded_security_desc_len(&self) -> bool {
282        self.message.body.has(tag::ENCODED_SECURITY_DESC_LEN)
283    }
284
285
286
287
288    /// Sets `EncodedText`, Tag 355.
289    pub fn set_encoded_text(&mut self, v: String) {
290        self.message.body.set_field(tag::ENCODED_TEXT, FIXString::from(v));
291    }
292
293    /// Gets `EncodedText`, Tag 355.
294    pub fn get_encoded_text(&self) -> Result<String, MessageRejectErrorEnum> {
295        let mut fld = field::EncodedTextField::new(String::new());
296        self.message.body.get_field(tag::ENCODED_TEXT, &mut fld.0)?;
297        Ok(fld.value().to_string())
298    }
299
300
301    /// Returns true if `EncodedText` is present, Tag 355.
302    pub fn has_encoded_text(&self) -> bool {
303        self.message.body.has(tag::ENCODED_TEXT)
304    }
305
306
307
308
309    /// Sets `EncodedTextLen`, Tag 354.
310    pub fn set_encoded_text_len(&mut self, v: isize) {
311        self.message.body.set_field(tag::ENCODED_TEXT_LEN, fixer::fix_int::FIXInt::from(v));
312    }
313
314    /// Gets `EncodedTextLen`, Tag 354.
315    pub fn get_encoded_text_len(&self) -> Result<isize, MessageRejectErrorEnum> {
316        let mut fld = field::EncodedTextLenField::new(0);
317        self.message.body.get_field(tag::ENCODED_TEXT_LEN, &mut fld.0)?;
318        Ok(fld.value())
319    }
320
321
322    /// Returns true if `EncodedTextLen` is present, Tag 354.
323    pub fn has_encoded_text_len(&self) -> bool {
324        self.message.body.has(tag::ENCODED_TEXT_LEN)
325    }
326
327
328
329
330    /// Sets `ExecBroker`, Tag 76.
331    pub fn set_exec_broker(&mut self, v: String) {
332        self.message.body.set_field(tag::EXEC_BROKER, FIXString::from(v));
333    }
334
335    /// Gets `ExecBroker`, Tag 76.
336    pub fn get_exec_broker(&self) -> Result<String, MessageRejectErrorEnum> {
337        let mut fld = field::ExecBrokerField::new(String::new());
338        self.message.body.get_field(tag::EXEC_BROKER, &mut fld.0)?;
339        Ok(fld.value().to_string())
340    }
341
342
343    /// Returns true if `ExecBroker` is present, Tag 76.
344    pub fn has_exec_broker(&self) -> bool {
345        self.message.body.has(tag::EXEC_BROKER)
346    }
347
348
349
350
351    /// Sets `IDSource`, Tag 22.
352    pub fn set_id_source(&mut self, v: String) {
353        self.message.body.set_field(tag::ID_SOURCE, FIXString::from(v));
354    }
355
356    /// Gets `IDSource`, Tag 22.
357    pub fn get_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
358        let mut fld = field::IDSourceField::new(String::new());
359        self.message.body.get_field(tag::ID_SOURCE, &mut fld.0)?;
360        Ok(fld.value().to_string())
361    }
362
363
364    /// Returns true if `IDSource` is present, Tag 22.
365    pub fn has_id_source(&self) -> bool {
366        self.message.body.has(tag::ID_SOURCE)
367    }
368
369
370
371
372    /// Sets `Issuer`, Tag 106.
373    pub fn set_issuer(&mut self, v: String) {
374        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
375    }
376
377    /// Gets `Issuer`, Tag 106.
378    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
379        let mut fld = field::IssuerField::new(String::new());
380        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
381        Ok(fld.value().to_string())
382    }
383
384
385    /// Returns true if `Issuer` is present, Tag 106.
386    pub fn has_issuer(&self) -> bool {
387        self.message.body.has(tag::ISSUER)
388    }
389
390
391
392
393    /// Sets `ListID`, Tag 66.
394    pub fn set_list_id(&mut self, v: String) {
395        self.message.body.set_field(tag::LIST_ID, FIXString::from(v));
396    }
397
398    /// Gets `ListID`, Tag 66.
399    pub fn get_list_id(&self) -> Result<String, MessageRejectErrorEnum> {
400        let mut fld = field::ListIDField::new(String::new());
401        self.message.body.get_field(tag::LIST_ID, &mut fld.0)?;
402        Ok(fld.value().to_string())
403    }
404
405
406    /// Returns true if `ListID` is present, Tag 66.
407    pub fn has_list_id(&self) -> bool {
408        self.message.body.has(tag::LIST_ID)
409    }
410
411
412
413
414    /// Sets `MaturityDay`, Tag 205.
415    pub fn set_maturity_day(&mut self, v: isize) {
416        self.message.body.set_field(tag::MATURITY_DAY, fixer::fix_int::FIXInt::from(v));
417    }
418
419    /// Gets `MaturityDay`, Tag 205.
420    pub fn get_maturity_day(&self) -> Result<isize, MessageRejectErrorEnum> {
421        let mut fld = field::MaturityDayField::new(0);
422        self.message.body.get_field(tag::MATURITY_DAY, &mut fld.0)?;
423        Ok(fld.value())
424    }
425
426
427    /// Returns true if `MaturityDay` is present, Tag 205.
428    pub fn has_maturity_day(&self) -> bool {
429        self.message.body.has(tag::MATURITY_DAY)
430    }
431
432
433
434
435    /// Sets `MaturityMonthYear`, Tag 200.
436    pub fn set_maturity_month_year(&mut self, v: String) {
437        self.message.body.set_field(tag::MATURITY_MONTH_YEAR, FIXString::from(v));
438    }
439
440    /// Gets `MaturityMonthYear`, Tag 200.
441    pub fn get_maturity_month_year(&self) -> Result<String, MessageRejectErrorEnum> {
442        let mut fld = field::MaturityMonthYearField::new(String::new());
443        self.message.body.get_field(tag::MATURITY_MONTH_YEAR, &mut fld.0)?;
444        Ok(fld.value().to_string())
445    }
446
447
448    /// Returns true if `MaturityMonthYear` is present, Tag 200.
449    pub fn has_maturity_month_year(&self) -> bool {
450        self.message.body.has(tag::MATURITY_MONTH_YEAR)
451    }
452
453
454
455
456    /// Sets `OptAttribute`, Tag 206.
457    pub fn set_opt_attribute(&mut self, v: String) {
458        self.message.body.set_field(tag::OPT_ATTRIBUTE, FIXString::from(v));
459    }
460
461    /// Gets `OptAttribute`, Tag 206.
462    pub fn get_opt_attribute(&self) -> Result<String, MessageRejectErrorEnum> {
463        let mut fld = field::OptAttributeField::new(String::new());
464        self.message.body.get_field(tag::OPT_ATTRIBUTE, &mut fld.0)?;
465        Ok(fld.value().to_string())
466    }
467
468
469    /// Returns true if `OptAttribute` is present, Tag 206.
470    pub fn has_opt_attribute(&self) -> bool {
471        self.message.body.has(tag::OPT_ATTRIBUTE)
472    }
473
474
475
476
477    /// Sets `OrderID`, Tag 37.
478    pub fn set_order_id(&mut self, v: String) {
479        self.message.body.set_field(tag::ORDER_ID, FIXString::from(v));
480    }
481
482    /// Gets `OrderID`, Tag 37.
483    pub fn get_order_id(&self) -> Result<String, MessageRejectErrorEnum> {
484        let mut fld = field::OrderIDField::new(String::new());
485        self.message.body.get_field(tag::ORDER_ID, &mut fld.0)?;
486        Ok(fld.value().to_string())
487    }
488
489
490    /// Returns true if `OrderID` is present, Tag 37.
491    pub fn has_order_id(&self) -> bool {
492        self.message.body.has(tag::ORDER_ID)
493    }
494
495
496
497
498    /// Sets `OrderQty`, Tag 38.
499    pub fn set_order_qty(&mut self, val: Decimal, scale: i32) {
500        self.message.body.set_field(tag::ORDER_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
501    }
502
503    /// Gets `OrderQty`, Tag 38.
504    pub fn get_order_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
505        let mut fld = field::OrderQtyField::new(Decimal::ZERO, 0);
506        self.message.body.get_field(tag::ORDER_QTY, &mut fld.0)?;
507        Ok(fld.value())
508    }
509
510
511    /// Returns true if `OrderQty` is present, Tag 38.
512    pub fn has_order_qty(&self) -> bool {
513        self.message.body.has(tag::ORDER_QTY)
514    }
515
516
517
518
519    /// Sets `OrigClOrdID`, Tag 41.
520    pub fn set_orig_cl_ord_id(&mut self, v: String) {
521        self.message.body.set_field(tag::ORIG_CL_ORD_ID, FIXString::from(v));
522    }
523
524    /// Gets `OrigClOrdID`, Tag 41.
525    pub fn get_orig_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
526        let mut fld = field::OrigClOrdIDField::new(String::new());
527        self.message.body.get_field(tag::ORIG_CL_ORD_ID, &mut fld.0)?;
528        Ok(fld.value().to_string())
529    }
530
531
532    /// Returns true if `OrigClOrdID` is present, Tag 41.
533    pub fn has_orig_cl_ord_id(&self) -> bool {
534        self.message.body.has(tag::ORIG_CL_ORD_ID)
535    }
536
537
538
539
540    /// Sets `PutOrCall`, Tag 201.
541    pub fn set_put_or_call(&mut self, v: isize) {
542        self.message.body.set_field(tag::PUT_OR_CALL, fixer::fix_int::FIXInt::from(v));
543    }
544
545    /// Gets `PutOrCall`, Tag 201.
546    pub fn get_put_or_call(&self) -> Result<isize, MessageRejectErrorEnum> {
547        let mut fld = field::PutOrCallField::new(0);
548        self.message.body.get_field(tag::PUT_OR_CALL, &mut fld.0)?;
549        Ok(fld.value())
550    }
551
552
553    /// Returns true if `PutOrCall` is present, Tag 201.
554    pub fn has_put_or_call(&self) -> bool {
555        self.message.body.has(tag::PUT_OR_CALL)
556    }
557
558
559
560
561    /// Sets `SecurityDesc`, Tag 107.
562    pub fn set_security_desc(&mut self, v: String) {
563        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
564    }
565
566    /// Gets `SecurityDesc`, Tag 107.
567    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
568        let mut fld = field::SecurityDescField::new(String::new());
569        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
570        Ok(fld.value().to_string())
571    }
572
573
574    /// Returns true if `SecurityDesc` is present, Tag 107.
575    pub fn has_security_desc(&self) -> bool {
576        self.message.body.has(tag::SECURITY_DESC)
577    }
578
579
580
581
582    /// Sets `SecurityExchange`, Tag 207.
583    pub fn set_security_exchange(&mut self, v: String) {
584        self.message.body.set_field(tag::SECURITY_EXCHANGE, FIXString::from(v));
585    }
586
587    /// Gets `SecurityExchange`, Tag 207.
588    pub fn get_security_exchange(&self) -> Result<String, MessageRejectErrorEnum> {
589        let mut fld = field::SecurityExchangeField::new(String::new());
590        self.message.body.get_field(tag::SECURITY_EXCHANGE, &mut fld.0)?;
591        Ok(fld.value().to_string())
592    }
593
594
595    /// Returns true if `SecurityExchange` is present, Tag 207.
596    pub fn has_security_exchange(&self) -> bool {
597        self.message.body.has(tag::SECURITY_EXCHANGE)
598    }
599
600
601
602
603    /// Sets `SecurityID`, Tag 48.
604    pub fn set_security_id(&mut self, v: String) {
605        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
606    }
607
608    /// Gets `SecurityID`, Tag 48.
609    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
610        let mut fld = field::SecurityIDField::new(String::new());
611        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
612        Ok(fld.value().to_string())
613    }
614
615
616    /// Returns true if `SecurityID` is present, Tag 48.
617    pub fn has_security_id(&self) -> bool {
618        self.message.body.has(tag::SECURITY_ID)
619    }
620
621
622
623
624    /// Sets `SecurityType`, Tag 167.
625    pub fn set_security_type(&mut self, v: String) {
626        self.message.body.set_field(tag::SECURITY_TYPE, FIXString::from(v));
627    }
628
629    /// Gets `SecurityType`, Tag 167.
630    pub fn get_security_type(&self) -> Result<String, MessageRejectErrorEnum> {
631        let mut fld = field::SecurityTypeField::new(String::new());
632        self.message.body.get_field(tag::SECURITY_TYPE, &mut fld.0)?;
633        Ok(fld.value().to_string())
634    }
635
636
637    /// Returns true if `SecurityType` is present, Tag 167.
638    pub fn has_security_type(&self) -> bool {
639        self.message.body.has(tag::SECURITY_TYPE)
640    }
641
642
643
644
645    /// Sets `Side`, Tag 54.
646    pub fn set_side(&mut self, v: String) {
647        self.message.body.set_field(tag::SIDE, FIXString::from(v));
648    }
649
650    /// Gets `Side`, Tag 54.
651    pub fn get_side(&self) -> Result<String, MessageRejectErrorEnum> {
652        let mut fld = field::SideField::new(String::new());
653        self.message.body.get_field(tag::SIDE, &mut fld.0)?;
654        Ok(fld.value().to_string())
655    }
656
657
658    /// Returns true if `Side` is present, Tag 54.
659    pub fn has_side(&self) -> bool {
660        self.message.body.has(tag::SIDE)
661    }
662
663
664
665
666    /// Sets `SolicitedFlag`, Tag 377.
667    pub fn set_solicited_flag(&mut self, v: bool) {
668        self.message.body.set_field(tag::SOLICITED_FLAG, fixer::fix_boolean::FIXBoolean::from(v));
669    }
670
671    /// Gets `SolicitedFlag`, Tag 377.
672    pub fn get_solicited_flag(&self) -> Result<bool, MessageRejectErrorEnum> {
673        let mut fld = field::SolicitedFlagField::new(false);
674        self.message.body.get_field(tag::SOLICITED_FLAG, &mut fld.0)?;
675        Ok(fld.value())
676    }
677
678
679    /// Returns true if `SolicitedFlag` is present, Tag 377.
680    pub fn has_solicited_flag(&self) -> bool {
681        self.message.body.has(tag::SOLICITED_FLAG)
682    }
683
684
685
686
687    /// Sets `StrikePrice`, Tag 202.
688    pub fn set_strike_price(&mut self, val: Decimal, scale: i32) {
689        self.message.body.set_field(tag::STRIKE_PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
690    }
691
692    /// Gets `StrikePrice`, Tag 202.
693    pub fn get_strike_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
694        let mut fld = field::StrikePriceField::new(Decimal::ZERO, 0);
695        self.message.body.get_field(tag::STRIKE_PRICE, &mut fld.0)?;
696        Ok(fld.value())
697    }
698
699
700    /// Returns true if `StrikePrice` is present, Tag 202.
701    pub fn has_strike_price(&self) -> bool {
702        self.message.body.has(tag::STRIKE_PRICE)
703    }
704
705
706
707
708    /// Sets `Symbol`, Tag 55.
709    pub fn set_symbol(&mut self, v: String) {
710        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
711    }
712
713    /// Gets `Symbol`, Tag 55.
714    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
715        let mut fld = field::SymbolField::new(String::new());
716        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
717        Ok(fld.value().to_string())
718    }
719
720
721    /// Returns true if `Symbol` is present, Tag 55.
722    pub fn has_symbol(&self) -> bool {
723        self.message.body.has(tag::SYMBOL)
724    }
725
726
727
728
729    /// Sets `SymbolSfx`, Tag 65.
730    pub fn set_symbol_sfx(&mut self, v: String) {
731        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
732    }
733
734    /// Gets `SymbolSfx`, Tag 65.
735    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
736        let mut fld = field::SymbolSfxField::new(String::new());
737        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
738        Ok(fld.value().to_string())
739    }
740
741
742    /// Returns true if `SymbolSfx` is present, Tag 65.
743    pub fn has_symbol_sfx(&self) -> bool {
744        self.message.body.has(tag::SYMBOL_SFX)
745    }
746
747
748
749
750    /// Sets `Text`, Tag 58.
751    pub fn set_text(&mut self, v: String) {
752        self.message.body.set_field(tag::TEXT, FIXString::from(v));
753    }
754
755    /// Gets `Text`, Tag 58.
756    pub fn get_text(&self) -> Result<String, MessageRejectErrorEnum> {
757        let mut fld = field::TextField::new(String::new());
758        self.message.body.get_field(tag::TEXT, &mut fld.0)?;
759        Ok(fld.value().to_string())
760    }
761
762
763    /// Returns true if `Text` is present, Tag 58.
764    pub fn has_text(&self) -> bool {
765        self.message.body.has(tag::TEXT)
766    }
767
768
769
770
771    /// Sets `TransactTime`, Tag 60.
772    pub fn set_transact_time(&mut self, v: Timestamp) {
773        self.message.body.set_field(tag::TRANSACT_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
774            time: v,
775            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
776        });
777    }
778
779    /// Gets `TransactTime`, Tag 60.
780    pub fn get_transact_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
781        let mut fld = field::TransactTimeField::new(Timestamp::UNIX_EPOCH);
782        self.message.body.get_field(tag::TRANSACT_TIME, &mut fld.0)?;
783        Ok(fld.value())
784    }
785
786
787    /// Returns true if `TransactTime` is present, Tag 60.
788    pub fn has_transact_time(&self) -> bool {
789        self.message.body.has(tag::TRANSACT_TIME)
790    }
791
792
793}
794
795/// `RouteOut` is the callback type for routing `OrderCancelRequest` messages.
796pub type RouteOut = fn(msg: OrderCancelRequest, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
797
798/// Route type returned by the `route` function.
799pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
800
801/// Returns the begin string, message type, and route function for `OrderCancelRequest`.
802pub fn route(router: RouteOut) -> Route {
803    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
804        router(OrderCancelRequest::from_message(msg.clone()), session_id)
805    };
806    ("FIX.4.2", "F", Box::new(r))
807}