Skip to main content

fixer_fix/fix43/
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 `fix43` `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, 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::SIDE, side.0);
36
37        msg.body.set_field(tag::TRANSACT_TIME, transact_time.0);
38
39        Self { message: msg }
40    }
41
42    /// Creates a `OrderCancelRequest` from an existing `Message`.
43    pub fn from_message(msg: Message) -> Self {
44        Self { message: msg }
45    }
46
47    /// Returns the underlying `Message`.
48    pub fn to_message(self) -> Message {
49        self.message
50    }
51
52
53
54
55    /// Sets `Account`, Tag 1.
56    pub fn set_account(&mut self, v: String) {
57        self.message.body.set_field(tag::ACCOUNT, FIXString::from(v));
58    }
59
60    /// Gets `Account`, Tag 1.
61    pub fn get_account(&self) -> Result<String, MessageRejectErrorEnum> {
62        let mut fld = field::AccountField::new(String::new());
63        self.message.body.get_field(tag::ACCOUNT, &mut fld.0)?;
64        Ok(fld.value().to_string())
65    }
66
67
68    /// Returns true if `Account` is present, Tag 1.
69    pub fn has_account(&self) -> bool {
70        self.message.body.has(tag::ACCOUNT)
71    }
72
73
74
75
76    /// Sets `AccountType`, Tag 581.
77    pub fn set_account_type(&mut self, v: isize) {
78        self.message.body.set_field(tag::ACCOUNT_TYPE, fixer::fix_int::FIXInt::from(v));
79    }
80
81    /// Gets `AccountType`, Tag 581.
82    pub fn get_account_type(&self) -> Result<isize, MessageRejectErrorEnum> {
83        let mut fld = field::AccountTypeField::new(0);
84        self.message.body.get_field(tag::ACCOUNT_TYPE, &mut fld.0)?;
85        Ok(fld.value())
86    }
87
88
89    /// Returns true if `AccountType` is present, Tag 581.
90    pub fn has_account_type(&self) -> bool {
91        self.message.body.has(tag::ACCOUNT_TYPE)
92    }
93
94
95
96
97    /// Sets `CFICode`, Tag 461.
98    pub fn set_cfi_code(&mut self, v: String) {
99        self.message.body.set_field(tag::CFI_CODE, FIXString::from(v));
100    }
101
102    /// Gets `CFICode`, Tag 461.
103    pub fn get_cfi_code(&self) -> Result<String, MessageRejectErrorEnum> {
104        let mut fld = field::CFICodeField::new(String::new());
105        self.message.body.get_field(tag::CFI_CODE, &mut fld.0)?;
106        Ok(fld.value().to_string())
107    }
108
109
110    /// Returns true if `CFICode` is present, Tag 461.
111    pub fn has_cfi_code(&self) -> bool {
112        self.message.body.has(tag::CFI_CODE)
113    }
114
115
116
117
118    /// Sets `CashOrderQty`, Tag 152.
119    pub fn set_cash_order_qty(&mut self, val: Decimal, scale: i32) {
120        self.message.body.set_field(tag::CASH_ORDER_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
121    }
122
123    /// Gets `CashOrderQty`, Tag 152.
124    pub fn get_cash_order_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
125        let mut fld = field::CashOrderQtyField::new(Decimal::ZERO, 0);
126        self.message.body.get_field(tag::CASH_ORDER_QTY, &mut fld.0)?;
127        Ok(fld.value())
128    }
129
130
131    /// Returns true if `CashOrderQty` is present, Tag 152.
132    pub fn has_cash_order_qty(&self) -> bool {
133        self.message.body.has(tag::CASH_ORDER_QTY)
134    }
135
136
137
138
139    /// Sets `ClOrdID`, Tag 11.
140    pub fn set_cl_ord_id(&mut self, v: String) {
141        self.message.body.set_field(tag::CL_ORD_ID, FIXString::from(v));
142    }
143
144    /// Gets `ClOrdID`, Tag 11.
145    pub fn get_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
146        let mut fld = field::ClOrdIDField::new(String::new());
147        self.message.body.get_field(tag::CL_ORD_ID, &mut fld.0)?;
148        Ok(fld.value().to_string())
149    }
150
151
152    /// Returns true if `ClOrdID` is present, Tag 11.
153    pub fn has_cl_ord_id(&self) -> bool {
154        self.message.body.has(tag::CL_ORD_ID)
155    }
156
157
158
159
160    /// Sets `ClOrdLinkID`, Tag 583.
161    pub fn set_cl_ord_link_id(&mut self, v: String) {
162        self.message.body.set_field(tag::CL_ORD_LINK_ID, FIXString::from(v));
163    }
164
165    /// Gets `ClOrdLinkID`, Tag 583.
166    pub fn get_cl_ord_link_id(&self) -> Result<String, MessageRejectErrorEnum> {
167        let mut fld = field::ClOrdLinkIDField::new(String::new());
168        self.message.body.get_field(tag::CL_ORD_LINK_ID, &mut fld.0)?;
169        Ok(fld.value().to_string())
170    }
171
172
173    /// Returns true if `ClOrdLinkID` is present, Tag 583.
174    pub fn has_cl_ord_link_id(&self) -> bool {
175        self.message.body.has(tag::CL_ORD_LINK_ID)
176    }
177
178
179
180
181    /// Sets `ComplianceID`, Tag 376.
182    pub fn set_compliance_id(&mut self, v: String) {
183        self.message.body.set_field(tag::COMPLIANCE_ID, FIXString::from(v));
184    }
185
186    /// Gets `ComplianceID`, Tag 376.
187    pub fn get_compliance_id(&self) -> Result<String, MessageRejectErrorEnum> {
188        let mut fld = field::ComplianceIDField::new(String::new());
189        self.message.body.get_field(tag::COMPLIANCE_ID, &mut fld.0)?;
190        Ok(fld.value().to_string())
191    }
192
193
194    /// Returns true if `ComplianceID` is present, Tag 376.
195    pub fn has_compliance_id(&self) -> bool {
196        self.message.body.has(tag::COMPLIANCE_ID)
197    }
198
199
200
201
202    /// Sets `ContractMultiplier`, Tag 231.
203    pub fn set_contract_multiplier(&mut self, val: Decimal, scale: i32) {
204        self.message.body.set_field(tag::CONTRACT_MULTIPLIER, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
205    }
206
207    /// Gets `ContractMultiplier`, Tag 231.
208    pub fn get_contract_multiplier(&self) -> Result<Decimal, MessageRejectErrorEnum> {
209        let mut fld = field::ContractMultiplierField::new(Decimal::ZERO, 0);
210        self.message.body.get_field(tag::CONTRACT_MULTIPLIER, &mut fld.0)?;
211        Ok(fld.value())
212    }
213
214
215    /// Returns true if `ContractMultiplier` is present, Tag 231.
216    pub fn has_contract_multiplier(&self) -> bool {
217        self.message.body.has(tag::CONTRACT_MULTIPLIER)
218    }
219
220
221
222
223    /// Sets `CountryOfIssue`, Tag 470.
224    pub fn set_country_of_issue(&mut self, v: String) {
225        self.message.body.set_field(tag::COUNTRY_OF_ISSUE, FIXString::from(v));
226    }
227
228    /// Gets `CountryOfIssue`, Tag 470.
229    pub fn get_country_of_issue(&self) -> Result<String, MessageRejectErrorEnum> {
230        let mut fld = field::CountryOfIssueField::new(String::new());
231        self.message.body.get_field(tag::COUNTRY_OF_ISSUE, &mut fld.0)?;
232        Ok(fld.value().to_string())
233    }
234
235
236    /// Returns true if `CountryOfIssue` is present, Tag 470.
237    pub fn has_country_of_issue(&self) -> bool {
238        self.message.body.has(tag::COUNTRY_OF_ISSUE)
239    }
240
241
242
243
244    /// Sets `CouponPaymentDate`, Tag 224.
245    pub fn set_coupon_payment_date(&mut self, v: String) {
246        self.message.body.set_field(tag::COUPON_PAYMENT_DATE, FIXString::from(v));
247    }
248
249    /// Gets `CouponPaymentDate`, Tag 224.
250    pub fn get_coupon_payment_date(&self) -> Result<String, MessageRejectErrorEnum> {
251        let mut fld = field::CouponPaymentDateField::new(String::new());
252        self.message.body.get_field(tag::COUPON_PAYMENT_DATE, &mut fld.0)?;
253        Ok(fld.value().to_string())
254    }
255
256
257    /// Returns true if `CouponPaymentDate` is present, Tag 224.
258    pub fn has_coupon_payment_date(&self) -> bool {
259        self.message.body.has(tag::COUPON_PAYMENT_DATE)
260    }
261
262
263
264
265    /// Sets `CouponRate`, Tag 223.
266    pub fn set_coupon_rate(&mut self, val: Decimal, scale: i32) {
267        self.message.body.set_field(tag::COUPON_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
268    }
269
270    /// Gets `CouponRate`, Tag 223.
271    pub fn get_coupon_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
272        let mut fld = field::CouponRateField::new(Decimal::ZERO, 0);
273        self.message.body.get_field(tag::COUPON_RATE, &mut fld.0)?;
274        Ok(fld.value())
275    }
276
277
278    /// Returns true if `CouponRate` is present, Tag 223.
279    pub fn has_coupon_rate(&self) -> bool {
280        self.message.body.has(tag::COUPON_RATE)
281    }
282
283
284
285
286    /// Sets `CreditRating`, Tag 255.
287    pub fn set_credit_rating(&mut self, v: String) {
288        self.message.body.set_field(tag::CREDIT_RATING, FIXString::from(v));
289    }
290
291    /// Gets `CreditRating`, Tag 255.
292    pub fn get_credit_rating(&self) -> Result<String, MessageRejectErrorEnum> {
293        let mut fld = field::CreditRatingField::new(String::new());
294        self.message.body.get_field(tag::CREDIT_RATING, &mut fld.0)?;
295        Ok(fld.value().to_string())
296    }
297
298
299    /// Returns true if `CreditRating` is present, Tag 255.
300    pub fn has_credit_rating(&self) -> bool {
301        self.message.body.has(tag::CREDIT_RATING)
302    }
303
304
305
306
307    /// Sets `EncodedIssuer`, Tag 349.
308    pub fn set_encoded_issuer(&mut self, v: String) {
309        self.message.body.set_field(tag::ENCODED_ISSUER, FIXString::from(v));
310    }
311
312    /// Gets `EncodedIssuer`, Tag 349.
313    pub fn get_encoded_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
314        let mut fld = field::EncodedIssuerField::new(String::new());
315        self.message.body.get_field(tag::ENCODED_ISSUER, &mut fld.0)?;
316        Ok(fld.value().to_string())
317    }
318
319
320    /// Returns true if `EncodedIssuer` is present, Tag 349.
321    pub fn has_encoded_issuer(&self) -> bool {
322        self.message.body.has(tag::ENCODED_ISSUER)
323    }
324
325
326
327
328    /// Sets `EncodedIssuerLen`, Tag 348.
329    pub fn set_encoded_issuer_len(&mut self, v: isize) {
330        self.message.body.set_field(tag::ENCODED_ISSUER_LEN, fixer::fix_int::FIXInt::from(v));
331    }
332
333    /// Gets `EncodedIssuerLen`, Tag 348.
334    pub fn get_encoded_issuer_len(&self) -> Result<isize, MessageRejectErrorEnum> {
335        let mut fld = field::EncodedIssuerLenField::new(0);
336        self.message.body.get_field(tag::ENCODED_ISSUER_LEN, &mut fld.0)?;
337        Ok(fld.value())
338    }
339
340
341    /// Returns true if `EncodedIssuerLen` is present, Tag 348.
342    pub fn has_encoded_issuer_len(&self) -> bool {
343        self.message.body.has(tag::ENCODED_ISSUER_LEN)
344    }
345
346
347
348
349    /// Sets `EncodedSecurityDesc`, Tag 351.
350    pub fn set_encoded_security_desc(&mut self, v: String) {
351        self.message.body.set_field(tag::ENCODED_SECURITY_DESC, FIXString::from(v));
352    }
353
354    /// Gets `EncodedSecurityDesc`, Tag 351.
355    pub fn get_encoded_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
356        let mut fld = field::EncodedSecurityDescField::new(String::new());
357        self.message.body.get_field(tag::ENCODED_SECURITY_DESC, &mut fld.0)?;
358        Ok(fld.value().to_string())
359    }
360
361
362    /// Returns true if `EncodedSecurityDesc` is present, Tag 351.
363    pub fn has_encoded_security_desc(&self) -> bool {
364        self.message.body.has(tag::ENCODED_SECURITY_DESC)
365    }
366
367
368
369
370    /// Sets `EncodedSecurityDescLen`, Tag 350.
371    pub fn set_encoded_security_desc_len(&mut self, v: isize) {
372        self.message.body.set_field(tag::ENCODED_SECURITY_DESC_LEN, fixer::fix_int::FIXInt::from(v));
373    }
374
375    /// Gets `EncodedSecurityDescLen`, Tag 350.
376    pub fn get_encoded_security_desc_len(&self) -> Result<isize, MessageRejectErrorEnum> {
377        let mut fld = field::EncodedSecurityDescLenField::new(0);
378        self.message.body.get_field(tag::ENCODED_SECURITY_DESC_LEN, &mut fld.0)?;
379        Ok(fld.value())
380    }
381
382
383    /// Returns true if `EncodedSecurityDescLen` is present, Tag 350.
384    pub fn has_encoded_security_desc_len(&self) -> bool {
385        self.message.body.has(tag::ENCODED_SECURITY_DESC_LEN)
386    }
387
388
389
390
391    /// Sets `EncodedText`, Tag 355.
392    pub fn set_encoded_text(&mut self, v: String) {
393        self.message.body.set_field(tag::ENCODED_TEXT, FIXString::from(v));
394    }
395
396    /// Gets `EncodedText`, Tag 355.
397    pub fn get_encoded_text(&self) -> Result<String, MessageRejectErrorEnum> {
398        let mut fld = field::EncodedTextField::new(String::new());
399        self.message.body.get_field(tag::ENCODED_TEXT, &mut fld.0)?;
400        Ok(fld.value().to_string())
401    }
402
403
404    /// Returns true if `EncodedText` is present, Tag 355.
405    pub fn has_encoded_text(&self) -> bool {
406        self.message.body.has(tag::ENCODED_TEXT)
407    }
408
409
410
411
412    /// Sets `EncodedTextLen`, Tag 354.
413    pub fn set_encoded_text_len(&mut self, v: isize) {
414        self.message.body.set_field(tag::ENCODED_TEXT_LEN, fixer::fix_int::FIXInt::from(v));
415    }
416
417    /// Gets `EncodedTextLen`, Tag 354.
418    pub fn get_encoded_text_len(&self) -> Result<isize, MessageRejectErrorEnum> {
419        let mut fld = field::EncodedTextLenField::new(0);
420        self.message.body.get_field(tag::ENCODED_TEXT_LEN, &mut fld.0)?;
421        Ok(fld.value())
422    }
423
424
425    /// Returns true if `EncodedTextLen` is present, Tag 354.
426    pub fn has_encoded_text_len(&self) -> bool {
427        self.message.body.has(tag::ENCODED_TEXT_LEN)
428    }
429
430
431
432
433    /// Sets `Factor`, Tag 228.
434    pub fn set_factor(&mut self, val: Decimal, scale: i32) {
435        self.message.body.set_field(tag::FACTOR, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
436    }
437
438    /// Gets `Factor`, Tag 228.
439    pub fn get_factor(&self) -> Result<Decimal, MessageRejectErrorEnum> {
440        let mut fld = field::FactorField::new(Decimal::ZERO, 0);
441        self.message.body.get_field(tag::FACTOR, &mut fld.0)?;
442        Ok(fld.value())
443    }
444
445
446    /// Returns true if `Factor` is present, Tag 228.
447    pub fn has_factor(&self) -> bool {
448        self.message.body.has(tag::FACTOR)
449    }
450
451
452
453
454    /// Sets `InstrRegistry`, Tag 543.
455    pub fn set_instr_registry(&mut self, v: String) {
456        self.message.body.set_field(tag::INSTR_REGISTRY, FIXString::from(v));
457    }
458
459    /// Gets `InstrRegistry`, Tag 543.
460    pub fn get_instr_registry(&self) -> Result<String, MessageRejectErrorEnum> {
461        let mut fld = field::InstrRegistryField::new(String::new());
462        self.message.body.get_field(tag::INSTR_REGISTRY, &mut fld.0)?;
463        Ok(fld.value().to_string())
464    }
465
466
467    /// Returns true if `InstrRegistry` is present, Tag 543.
468    pub fn has_instr_registry(&self) -> bool {
469        self.message.body.has(tag::INSTR_REGISTRY)
470    }
471
472
473
474
475    /// Sets `IssueDate`, Tag 225.
476    pub fn set_issue_date(&mut self, v: String) {
477        self.message.body.set_field(tag::ISSUE_DATE, FIXString::from(v));
478    }
479
480    /// Gets `IssueDate`, Tag 225.
481    pub fn get_issue_date(&self) -> Result<String, MessageRejectErrorEnum> {
482        let mut fld = field::IssueDateField::new(String::new());
483        self.message.body.get_field(tag::ISSUE_DATE, &mut fld.0)?;
484        Ok(fld.value().to_string())
485    }
486
487
488    /// Returns true if `IssueDate` is present, Tag 225.
489    pub fn has_issue_date(&self) -> bool {
490        self.message.body.has(tag::ISSUE_DATE)
491    }
492
493
494
495
496    /// Sets `Issuer`, Tag 106.
497    pub fn set_issuer(&mut self, v: String) {
498        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
499    }
500
501    /// Gets `Issuer`, Tag 106.
502    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
503        let mut fld = field::IssuerField::new(String::new());
504        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
505        Ok(fld.value().to_string())
506    }
507
508
509    /// Returns true if `Issuer` is present, Tag 106.
510    pub fn has_issuer(&self) -> bool {
511        self.message.body.has(tag::ISSUER)
512    }
513
514
515
516
517    /// Sets `ListID`, Tag 66.
518    pub fn set_list_id(&mut self, v: String) {
519        self.message.body.set_field(tag::LIST_ID, FIXString::from(v));
520    }
521
522    /// Gets `ListID`, Tag 66.
523    pub fn get_list_id(&self) -> Result<String, MessageRejectErrorEnum> {
524        let mut fld = field::ListIDField::new(String::new());
525        self.message.body.get_field(tag::LIST_ID, &mut fld.0)?;
526        Ok(fld.value().to_string())
527    }
528
529
530    /// Returns true if `ListID` is present, Tag 66.
531    pub fn has_list_id(&self) -> bool {
532        self.message.body.has(tag::LIST_ID)
533    }
534
535
536
537
538    /// Sets `LocaleOfIssue`, Tag 472.
539    pub fn set_locale_of_issue(&mut self, v: String) {
540        self.message.body.set_field(tag::LOCALE_OF_ISSUE, FIXString::from(v));
541    }
542
543    /// Gets `LocaleOfIssue`, Tag 472.
544    pub fn get_locale_of_issue(&self) -> Result<String, MessageRejectErrorEnum> {
545        let mut fld = field::LocaleOfIssueField::new(String::new());
546        self.message.body.get_field(tag::LOCALE_OF_ISSUE, &mut fld.0)?;
547        Ok(fld.value().to_string())
548    }
549
550
551    /// Returns true if `LocaleOfIssue` is present, Tag 472.
552    pub fn has_locale_of_issue(&self) -> bool {
553        self.message.body.has(tag::LOCALE_OF_ISSUE)
554    }
555
556
557
558
559    /// Sets `MaturityDate`, Tag 541.
560    pub fn set_maturity_date(&mut self, v: String) {
561        self.message.body.set_field(tag::MATURITY_DATE, FIXString::from(v));
562    }
563
564    /// Gets `MaturityDate`, Tag 541.
565    pub fn get_maturity_date(&self) -> Result<String, MessageRejectErrorEnum> {
566        let mut fld = field::MaturityDateField::new(String::new());
567        self.message.body.get_field(tag::MATURITY_DATE, &mut fld.0)?;
568        Ok(fld.value().to_string())
569    }
570
571
572    /// Returns true if `MaturityDate` is present, Tag 541.
573    pub fn has_maturity_date(&self) -> bool {
574        self.message.body.has(tag::MATURITY_DATE)
575    }
576
577
578
579
580    /// Sets `MaturityMonthYear`, Tag 200.
581    pub fn set_maturity_month_year(&mut self, v: String) {
582        self.message.body.set_field(tag::MATURITY_MONTH_YEAR, FIXString::from(v));
583    }
584
585    /// Gets `MaturityMonthYear`, Tag 200.
586    pub fn get_maturity_month_year(&self) -> Result<String, MessageRejectErrorEnum> {
587        let mut fld = field::MaturityMonthYearField::new(String::new());
588        self.message.body.get_field(tag::MATURITY_MONTH_YEAR, &mut fld.0)?;
589        Ok(fld.value().to_string())
590    }
591
592
593    /// Returns true if `MaturityMonthYear` is present, Tag 200.
594    pub fn has_maturity_month_year(&self) -> bool {
595        self.message.body.has(tag::MATURITY_MONTH_YEAR)
596    }
597
598
599
600
601    /// Sets `NoPartyIDs`, Tag 453.
602    pub fn set_no_party_i_ds(&mut self, v: isize) {
603        self.message.body.set_field(tag::NO_PARTY_I_DS, fixer::fix_int::FIXInt::from(v));
604    }
605
606    /// Gets `NoPartyIDs`, Tag 453.
607    pub fn get_no_party_i_ds(&self) -> Result<isize, MessageRejectErrorEnum> {
608        let mut fld = field::NoPartyIDsField::new(0);
609        self.message.body.get_field(tag::NO_PARTY_I_DS, &mut fld.0)?;
610        Ok(fld.value())
611    }
612
613
614    /// Returns true if `NoPartyIDs` is present, Tag 453.
615    pub fn has_no_party_i_ds(&self) -> bool {
616        self.message.body.has(tag::NO_PARTY_I_DS)
617    }
618
619
620
621
622    /// Sets `NoSecurityAltID`, Tag 454.
623    pub fn set_no_security_alt_id(&mut self, v: isize) {
624        self.message.body.set_field(tag::NO_SECURITY_ALT_ID, fixer::fix_int::FIXInt::from(v));
625    }
626
627    /// Gets `NoSecurityAltID`, Tag 454.
628    pub fn get_no_security_alt_id(&self) -> Result<isize, MessageRejectErrorEnum> {
629        let mut fld = field::NoSecurityAltIDField::new(0);
630        self.message.body.get_field(tag::NO_SECURITY_ALT_ID, &mut fld.0)?;
631        Ok(fld.value())
632    }
633
634
635    /// Returns true if `NoSecurityAltID` is present, Tag 454.
636    pub fn has_no_security_alt_id(&self) -> bool {
637        self.message.body.has(tag::NO_SECURITY_ALT_ID)
638    }
639
640
641
642
643    /// Sets `OptAttribute`, Tag 206.
644    pub fn set_opt_attribute(&mut self, v: String) {
645        self.message.body.set_field(tag::OPT_ATTRIBUTE, FIXString::from(v));
646    }
647
648    /// Gets `OptAttribute`, Tag 206.
649    pub fn get_opt_attribute(&self) -> Result<String, MessageRejectErrorEnum> {
650        let mut fld = field::OptAttributeField::new(String::new());
651        self.message.body.get_field(tag::OPT_ATTRIBUTE, &mut fld.0)?;
652        Ok(fld.value().to_string())
653    }
654
655
656    /// Returns true if `OptAttribute` is present, Tag 206.
657    pub fn has_opt_attribute(&self) -> bool {
658        self.message.body.has(tag::OPT_ATTRIBUTE)
659    }
660
661
662
663
664    /// Sets `OrderID`, Tag 37.
665    pub fn set_order_id(&mut self, v: String) {
666        self.message.body.set_field(tag::ORDER_ID, FIXString::from(v));
667    }
668
669    /// Gets `OrderID`, Tag 37.
670    pub fn get_order_id(&self) -> Result<String, MessageRejectErrorEnum> {
671        let mut fld = field::OrderIDField::new(String::new());
672        self.message.body.get_field(tag::ORDER_ID, &mut fld.0)?;
673        Ok(fld.value().to_string())
674    }
675
676
677    /// Returns true if `OrderID` is present, Tag 37.
678    pub fn has_order_id(&self) -> bool {
679        self.message.body.has(tag::ORDER_ID)
680    }
681
682
683
684
685    /// Sets `OrderPercent`, Tag 516.
686    pub fn set_order_percent(&mut self, val: Decimal, scale: i32) {
687        self.message.body.set_field(tag::ORDER_PERCENT, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
688    }
689
690    /// Gets `OrderPercent`, Tag 516.
691    pub fn get_order_percent(&self) -> Result<Decimal, MessageRejectErrorEnum> {
692        let mut fld = field::OrderPercentField::new(Decimal::ZERO, 0);
693        self.message.body.get_field(tag::ORDER_PERCENT, &mut fld.0)?;
694        Ok(fld.value())
695    }
696
697
698    /// Returns true if `OrderPercent` is present, Tag 516.
699    pub fn has_order_percent(&self) -> bool {
700        self.message.body.has(tag::ORDER_PERCENT)
701    }
702
703
704
705
706    /// Sets `OrderQty`, Tag 38.
707    pub fn set_order_qty(&mut self, val: Decimal, scale: i32) {
708        self.message.body.set_field(tag::ORDER_QTY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
709    }
710
711    /// Gets `OrderQty`, Tag 38.
712    pub fn get_order_qty(&self) -> Result<Decimal, MessageRejectErrorEnum> {
713        let mut fld = field::OrderQtyField::new(Decimal::ZERO, 0);
714        self.message.body.get_field(tag::ORDER_QTY, &mut fld.0)?;
715        Ok(fld.value())
716    }
717
718
719    /// Returns true if `OrderQty` is present, Tag 38.
720    pub fn has_order_qty(&self) -> bool {
721        self.message.body.has(tag::ORDER_QTY)
722    }
723
724
725
726
727    /// Sets `OrigClOrdID`, Tag 41.
728    pub fn set_orig_cl_ord_id(&mut self, v: String) {
729        self.message.body.set_field(tag::ORIG_CL_ORD_ID, FIXString::from(v));
730    }
731
732    /// Gets `OrigClOrdID`, Tag 41.
733    pub fn get_orig_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
734        let mut fld = field::OrigClOrdIDField::new(String::new());
735        self.message.body.get_field(tag::ORIG_CL_ORD_ID, &mut fld.0)?;
736        Ok(fld.value().to_string())
737    }
738
739
740    /// Returns true if `OrigClOrdID` is present, Tag 41.
741    pub fn has_orig_cl_ord_id(&self) -> bool {
742        self.message.body.has(tag::ORIG_CL_ORD_ID)
743    }
744
745
746
747
748    /// Sets `OrigOrdModTime`, Tag 586.
749    pub fn set_orig_ord_mod_time(&mut self, v: Timestamp) {
750        self.message.body.set_field(tag::ORIG_ORD_MOD_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
751            time: v,
752            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
753        });
754    }
755
756    /// Gets `OrigOrdModTime`, Tag 586.
757    pub fn get_orig_ord_mod_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
758        let mut fld = field::OrigOrdModTimeField::new(Timestamp::UNIX_EPOCH);
759        self.message.body.get_field(tag::ORIG_ORD_MOD_TIME, &mut fld.0)?;
760        Ok(fld.value())
761    }
762
763
764    /// Returns true if `OrigOrdModTime` is present, Tag 586.
765    pub fn has_orig_ord_mod_time(&self) -> bool {
766        self.message.body.has(tag::ORIG_ORD_MOD_TIME)
767    }
768
769
770
771
772    /// Sets `Product`, Tag 460.
773    pub fn set_product(&mut self, v: isize) {
774        self.message.body.set_field(tag::PRODUCT, fixer::fix_int::FIXInt::from(v));
775    }
776
777    /// Gets `Product`, Tag 460.
778    pub fn get_product(&self) -> Result<isize, MessageRejectErrorEnum> {
779        let mut fld = field::ProductField::new(0);
780        self.message.body.get_field(tag::PRODUCT, &mut fld.0)?;
781        Ok(fld.value())
782    }
783
784
785    /// Returns true if `Product` is present, Tag 460.
786    pub fn has_product(&self) -> bool {
787        self.message.body.has(tag::PRODUCT)
788    }
789
790
791
792
793    /// Sets `RedemptionDate`, Tag 240.
794    pub fn set_redemption_date(&mut self, v: String) {
795        self.message.body.set_field(tag::REDEMPTION_DATE, FIXString::from(v));
796    }
797
798    /// Gets `RedemptionDate`, Tag 240.
799    pub fn get_redemption_date(&self) -> Result<String, MessageRejectErrorEnum> {
800        let mut fld = field::RedemptionDateField::new(String::new());
801        self.message.body.get_field(tag::REDEMPTION_DATE, &mut fld.0)?;
802        Ok(fld.value().to_string())
803    }
804
805
806    /// Returns true if `RedemptionDate` is present, Tag 240.
807    pub fn has_redemption_date(&self) -> bool {
808        self.message.body.has(tag::REDEMPTION_DATE)
809    }
810
811
812
813
814    /// Sets `RepoCollateralSecurityType`, Tag 239.
815    pub fn set_repo_collateral_security_type(&mut self, v: isize) {
816        self.message.body.set_field(tag::REPO_COLLATERAL_SECURITY_TYPE, fixer::fix_int::FIXInt::from(v));
817    }
818
819    /// Gets `RepoCollateralSecurityType`, Tag 239.
820    pub fn get_repo_collateral_security_type(&self) -> Result<isize, MessageRejectErrorEnum> {
821        let mut fld = field::RepoCollateralSecurityTypeField::new(0);
822        self.message.body.get_field(tag::REPO_COLLATERAL_SECURITY_TYPE, &mut fld.0)?;
823        Ok(fld.value())
824    }
825
826
827    /// Returns true if `RepoCollateralSecurityType` is present, Tag 239.
828    pub fn has_repo_collateral_security_type(&self) -> bool {
829        self.message.body.has(tag::REPO_COLLATERAL_SECURITY_TYPE)
830    }
831
832
833
834
835    /// Sets `RepurchaseRate`, Tag 227.
836    pub fn set_repurchase_rate(&mut self, val: Decimal, scale: i32) {
837        self.message.body.set_field(tag::REPURCHASE_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
838    }
839
840    /// Gets `RepurchaseRate`, Tag 227.
841    pub fn get_repurchase_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
842        let mut fld = field::RepurchaseRateField::new(Decimal::ZERO, 0);
843        self.message.body.get_field(tag::REPURCHASE_RATE, &mut fld.0)?;
844        Ok(fld.value())
845    }
846
847
848    /// Returns true if `RepurchaseRate` is present, Tag 227.
849    pub fn has_repurchase_rate(&self) -> bool {
850        self.message.body.has(tag::REPURCHASE_RATE)
851    }
852
853
854
855
856    /// Sets `RepurchaseTerm`, Tag 226.
857    pub fn set_repurchase_term(&mut self, v: isize) {
858        self.message.body.set_field(tag::REPURCHASE_TERM, fixer::fix_int::FIXInt::from(v));
859    }
860
861    /// Gets `RepurchaseTerm`, Tag 226.
862    pub fn get_repurchase_term(&self) -> Result<isize, MessageRejectErrorEnum> {
863        let mut fld = field::RepurchaseTermField::new(0);
864        self.message.body.get_field(tag::REPURCHASE_TERM, &mut fld.0)?;
865        Ok(fld.value())
866    }
867
868
869    /// Returns true if `RepurchaseTerm` is present, Tag 226.
870    pub fn has_repurchase_term(&self) -> bool {
871        self.message.body.has(tag::REPURCHASE_TERM)
872    }
873
874
875
876
877    /// Sets `RoundingDirection`, Tag 468.
878    pub fn set_rounding_direction(&mut self, v: String) {
879        self.message.body.set_field(tag::ROUNDING_DIRECTION, FIXString::from(v));
880    }
881
882    /// Gets `RoundingDirection`, Tag 468.
883    pub fn get_rounding_direction(&self) -> Result<String, MessageRejectErrorEnum> {
884        let mut fld = field::RoundingDirectionField::new(String::new());
885        self.message.body.get_field(tag::ROUNDING_DIRECTION, &mut fld.0)?;
886        Ok(fld.value().to_string())
887    }
888
889
890    /// Returns true if `RoundingDirection` is present, Tag 468.
891    pub fn has_rounding_direction(&self) -> bool {
892        self.message.body.has(tag::ROUNDING_DIRECTION)
893    }
894
895
896
897
898    /// Sets `RoundingModulus`, Tag 469.
899    pub fn set_rounding_modulus(&mut self, val: Decimal, scale: i32) {
900        self.message.body.set_field(tag::ROUNDING_MODULUS, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
901    }
902
903    /// Gets `RoundingModulus`, Tag 469.
904    pub fn get_rounding_modulus(&self) -> Result<Decimal, MessageRejectErrorEnum> {
905        let mut fld = field::RoundingModulusField::new(Decimal::ZERO, 0);
906        self.message.body.get_field(tag::ROUNDING_MODULUS, &mut fld.0)?;
907        Ok(fld.value())
908    }
909
910
911    /// Returns true if `RoundingModulus` is present, Tag 469.
912    pub fn has_rounding_modulus(&self) -> bool {
913        self.message.body.has(tag::ROUNDING_MODULUS)
914    }
915
916
917
918
919    /// Sets `SecondaryClOrdID`, Tag 526.
920    pub fn set_secondary_cl_ord_id(&mut self, v: String) {
921        self.message.body.set_field(tag::SECONDARY_CL_ORD_ID, FIXString::from(v));
922    }
923
924    /// Gets `SecondaryClOrdID`, Tag 526.
925    pub fn get_secondary_cl_ord_id(&self) -> Result<String, MessageRejectErrorEnum> {
926        let mut fld = field::SecondaryClOrdIDField::new(String::new());
927        self.message.body.get_field(tag::SECONDARY_CL_ORD_ID, &mut fld.0)?;
928        Ok(fld.value().to_string())
929    }
930
931
932    /// Returns true if `SecondaryClOrdID` is present, Tag 526.
933    pub fn has_secondary_cl_ord_id(&self) -> bool {
934        self.message.body.has(tag::SECONDARY_CL_ORD_ID)
935    }
936
937
938
939
940    /// Sets `SecurityDesc`, Tag 107.
941    pub fn set_security_desc(&mut self, v: String) {
942        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
943    }
944
945    /// Gets `SecurityDesc`, Tag 107.
946    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
947        let mut fld = field::SecurityDescField::new(String::new());
948        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
949        Ok(fld.value().to_string())
950    }
951
952
953    /// Returns true if `SecurityDesc` is present, Tag 107.
954    pub fn has_security_desc(&self) -> bool {
955        self.message.body.has(tag::SECURITY_DESC)
956    }
957
958
959
960
961    /// Sets `SecurityExchange`, Tag 207.
962    pub fn set_security_exchange(&mut self, v: String) {
963        self.message.body.set_field(tag::SECURITY_EXCHANGE, FIXString::from(v));
964    }
965
966    /// Gets `SecurityExchange`, Tag 207.
967    pub fn get_security_exchange(&self) -> Result<String, MessageRejectErrorEnum> {
968        let mut fld = field::SecurityExchangeField::new(String::new());
969        self.message.body.get_field(tag::SECURITY_EXCHANGE, &mut fld.0)?;
970        Ok(fld.value().to_string())
971    }
972
973
974    /// Returns true if `SecurityExchange` is present, Tag 207.
975    pub fn has_security_exchange(&self) -> bool {
976        self.message.body.has(tag::SECURITY_EXCHANGE)
977    }
978
979
980
981
982    /// Sets `SecurityID`, Tag 48.
983    pub fn set_security_id(&mut self, v: String) {
984        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
985    }
986
987    /// Gets `SecurityID`, Tag 48.
988    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
989        let mut fld = field::SecurityIDField::new(String::new());
990        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
991        Ok(fld.value().to_string())
992    }
993
994
995    /// Returns true if `SecurityID` is present, Tag 48.
996    pub fn has_security_id(&self) -> bool {
997        self.message.body.has(tag::SECURITY_ID)
998    }
999
1000
1001
1002
1003    /// Sets `SecurityIDSource`, Tag 22.
1004    pub fn set_security_id_source(&mut self, v: String) {
1005        self.message.body.set_field(tag::SECURITY_ID_SOURCE, FIXString::from(v));
1006    }
1007
1008    /// Gets `SecurityIDSource`, Tag 22.
1009    pub fn get_security_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
1010        let mut fld = field::SecurityIDSourceField::new(String::new());
1011        self.message.body.get_field(tag::SECURITY_ID_SOURCE, &mut fld.0)?;
1012        Ok(fld.value().to_string())
1013    }
1014
1015
1016    /// Returns true if `SecurityIDSource` is present, Tag 22.
1017    pub fn has_security_id_source(&self) -> bool {
1018        self.message.body.has(tag::SECURITY_ID_SOURCE)
1019    }
1020
1021
1022
1023
1024    /// Sets `SecurityType`, Tag 167.
1025    pub fn set_security_type(&mut self, v: String) {
1026        self.message.body.set_field(tag::SECURITY_TYPE, FIXString::from(v));
1027    }
1028
1029    /// Gets `SecurityType`, Tag 167.
1030    pub fn get_security_type(&self) -> Result<String, MessageRejectErrorEnum> {
1031        let mut fld = field::SecurityTypeField::new(String::new());
1032        self.message.body.get_field(tag::SECURITY_TYPE, &mut fld.0)?;
1033        Ok(fld.value().to_string())
1034    }
1035
1036
1037    /// Returns true if `SecurityType` is present, Tag 167.
1038    pub fn has_security_type(&self) -> bool {
1039        self.message.body.has(tag::SECURITY_TYPE)
1040    }
1041
1042
1043
1044
1045    /// Sets `Side`, Tag 54.
1046    pub fn set_side(&mut self, v: String) {
1047        self.message.body.set_field(tag::SIDE, FIXString::from(v));
1048    }
1049
1050    /// Gets `Side`, Tag 54.
1051    pub fn get_side(&self) -> Result<String, MessageRejectErrorEnum> {
1052        let mut fld = field::SideField::new(String::new());
1053        self.message.body.get_field(tag::SIDE, &mut fld.0)?;
1054        Ok(fld.value().to_string())
1055    }
1056
1057
1058    /// Returns true if `Side` is present, Tag 54.
1059    pub fn has_side(&self) -> bool {
1060        self.message.body.has(tag::SIDE)
1061    }
1062
1063
1064
1065
1066    /// Sets `StateOrProvinceOfIssue`, Tag 471.
1067    pub fn set_state_or_province_of_issue(&mut self, v: String) {
1068        self.message.body.set_field(tag::STATE_OR_PROVINCE_OF_ISSUE, FIXString::from(v));
1069    }
1070
1071    /// Gets `StateOrProvinceOfIssue`, Tag 471.
1072    pub fn get_state_or_province_of_issue(&self) -> Result<String, MessageRejectErrorEnum> {
1073        let mut fld = field::StateOrProvinceOfIssueField::new(String::new());
1074        self.message.body.get_field(tag::STATE_OR_PROVINCE_OF_ISSUE, &mut fld.0)?;
1075        Ok(fld.value().to_string())
1076    }
1077
1078
1079    /// Returns true if `StateOrProvinceOfIssue` is present, Tag 471.
1080    pub fn has_state_or_province_of_issue(&self) -> bool {
1081        self.message.body.has(tag::STATE_OR_PROVINCE_OF_ISSUE)
1082    }
1083
1084
1085
1086
1087    /// Sets `StrikePrice`, Tag 202.
1088    pub fn set_strike_price(&mut self, val: Decimal, scale: i32) {
1089        self.message.body.set_field(tag::STRIKE_PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1090    }
1091
1092    /// Gets `StrikePrice`, Tag 202.
1093    pub fn get_strike_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1094        let mut fld = field::StrikePriceField::new(Decimal::ZERO, 0);
1095        self.message.body.get_field(tag::STRIKE_PRICE, &mut fld.0)?;
1096        Ok(fld.value())
1097    }
1098
1099
1100    /// Returns true if `StrikePrice` is present, Tag 202.
1101    pub fn has_strike_price(&self) -> bool {
1102        self.message.body.has(tag::STRIKE_PRICE)
1103    }
1104
1105
1106
1107
1108    /// Sets `Symbol`, Tag 55.
1109    pub fn set_symbol(&mut self, v: String) {
1110        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
1111    }
1112
1113    /// Gets `Symbol`, Tag 55.
1114    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
1115        let mut fld = field::SymbolField::new(String::new());
1116        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
1117        Ok(fld.value().to_string())
1118    }
1119
1120
1121    /// Returns true if `Symbol` is present, Tag 55.
1122    pub fn has_symbol(&self) -> bool {
1123        self.message.body.has(tag::SYMBOL)
1124    }
1125
1126
1127
1128
1129    /// Sets `SymbolSfx`, Tag 65.
1130    pub fn set_symbol_sfx(&mut self, v: String) {
1131        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
1132    }
1133
1134    /// Gets `SymbolSfx`, Tag 65.
1135    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
1136        let mut fld = field::SymbolSfxField::new(String::new());
1137        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
1138        Ok(fld.value().to_string())
1139    }
1140
1141
1142    /// Returns true if `SymbolSfx` is present, Tag 65.
1143    pub fn has_symbol_sfx(&self) -> bool {
1144        self.message.body.has(tag::SYMBOL_SFX)
1145    }
1146
1147
1148
1149
1150    /// Sets `Text`, Tag 58.
1151    pub fn set_text(&mut self, v: String) {
1152        self.message.body.set_field(tag::TEXT, FIXString::from(v));
1153    }
1154
1155    /// Gets `Text`, Tag 58.
1156    pub fn get_text(&self) -> Result<String, MessageRejectErrorEnum> {
1157        let mut fld = field::TextField::new(String::new());
1158        self.message.body.get_field(tag::TEXT, &mut fld.0)?;
1159        Ok(fld.value().to_string())
1160    }
1161
1162
1163    /// Returns true if `Text` is present, Tag 58.
1164    pub fn has_text(&self) -> bool {
1165        self.message.body.has(tag::TEXT)
1166    }
1167
1168
1169
1170
1171    /// Sets `TransactTime`, Tag 60.
1172    pub fn set_transact_time(&mut self, v: Timestamp) {
1173        self.message.body.set_field(tag::TRANSACT_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
1174            time: v,
1175            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
1176        });
1177    }
1178
1179    /// Gets `TransactTime`, Tag 60.
1180    pub fn get_transact_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
1181        let mut fld = field::TransactTimeField::new(Timestamp::UNIX_EPOCH);
1182        self.message.body.get_field(tag::TRANSACT_TIME, &mut fld.0)?;
1183        Ok(fld.value())
1184    }
1185
1186
1187    /// Returns true if `TransactTime` is present, Tag 60.
1188    pub fn has_transact_time(&self) -> bool {
1189        self.message.body.has(tag::TRANSACT_TIME)
1190    }
1191
1192
1193}
1194
1195/// `RouteOut` is the callback type for routing `OrderCancelRequest` messages.
1196pub type RouteOut = fn(msg: OrderCancelRequest, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
1197
1198/// Route type returned by the `route` function.
1199pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
1200
1201/// Returns the begin string, message type, and route function for `OrderCancelRequest`.
1202pub fn route(router: RouteOut) -> Route {
1203    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
1204        router(OrderCancelRequest::from_message(msg.clone()), session_id)
1205    };
1206    ("FIX.4.3", "F", Box::new(r))
1207}