Skip to main content

fixer_fix/fix43/
allocation.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/// `Allocation` is the `fix43` `Allocation` type, `MsgType` = J.
21pub struct Allocation {
22    pub message: Message,
23}
24
25impl Allocation {
26    /// Creates a new `Allocation` with required fields.
27    pub fn new(alloc_id: field::AllocIDField, alloc_trans_type: field::AllocTransTypeField, alloc_type: field::AllocTypeField, side: field::SideField, quantity: field::QuantityField, avg_px: field::AvgPxField, trade_date: field::TradeDateField) -> Self {
28        let mut msg = Message::new();
29        msg.header.set_field(tag::MSG_TYPE, FIXString::from("J".to_string()));
30
31        msg.body.set_field(tag::ALLOC_ID, alloc_id.0);
32
33        msg.body.set_field(tag::ALLOC_TRANS_TYPE, alloc_trans_type.0);
34
35        msg.body.set_field(tag::ALLOC_TYPE, alloc_type.0);
36
37        msg.body.set_field(tag::SIDE, side.0);
38
39        msg.body.set_field(tag::QUANTITY, quantity.0);
40
41        msg.body.set_field(tag::AVG_PX, avg_px.0);
42
43        msg.body.set_field(tag::TRADE_DATE, trade_date.0);
44
45        Self { message: msg }
46    }
47
48    /// Creates a `Allocation` 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 `AccruedInterestRate`, Tag 158.
62    pub fn set_accrued_interest_rate(&mut self, val: Decimal, scale: i32) {
63        self.message.body.set_field(tag::ACCRUED_INTEREST_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
64    }
65
66    /// Gets `AccruedInterestRate`, Tag 158.
67    pub fn get_accrued_interest_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
68        let mut fld = field::AccruedInterestRateField::new(Decimal::ZERO, 0);
69        self.message.body.get_field(tag::ACCRUED_INTEREST_RATE, &mut fld.0)?;
70        Ok(fld.value())
71    }
72
73
74    /// Returns true if `AccruedInterestRate` is present, Tag 158.
75    pub fn has_accrued_interest_rate(&self) -> bool {
76        self.message.body.has(tag::ACCRUED_INTEREST_RATE)
77    }
78
79
80
81
82    /// Sets `AllocID`, Tag 70.
83    pub fn set_alloc_id(&mut self, v: String) {
84        self.message.body.set_field(tag::ALLOC_ID, FIXString::from(v));
85    }
86
87    /// Gets `AllocID`, Tag 70.
88    pub fn get_alloc_id(&self) -> Result<String, MessageRejectErrorEnum> {
89        let mut fld = field::AllocIDField::new(String::new());
90        self.message.body.get_field(tag::ALLOC_ID, &mut fld.0)?;
91        Ok(fld.value().to_string())
92    }
93
94
95    /// Returns true if `AllocID` is present, Tag 70.
96    pub fn has_alloc_id(&self) -> bool {
97        self.message.body.has(tag::ALLOC_ID)
98    }
99
100
101
102
103    /// Sets `AllocLinkID`, Tag 196.
104    pub fn set_alloc_link_id(&mut self, v: String) {
105        self.message.body.set_field(tag::ALLOC_LINK_ID, FIXString::from(v));
106    }
107
108    /// Gets `AllocLinkID`, Tag 196.
109    pub fn get_alloc_link_id(&self) -> Result<String, MessageRejectErrorEnum> {
110        let mut fld = field::AllocLinkIDField::new(String::new());
111        self.message.body.get_field(tag::ALLOC_LINK_ID, &mut fld.0)?;
112        Ok(fld.value().to_string())
113    }
114
115
116    /// Returns true if `AllocLinkID` is present, Tag 196.
117    pub fn has_alloc_link_id(&self) -> bool {
118        self.message.body.has(tag::ALLOC_LINK_ID)
119    }
120
121
122
123
124    /// Sets `AllocLinkType`, Tag 197.
125    pub fn set_alloc_link_type(&mut self, v: isize) {
126        self.message.body.set_field(tag::ALLOC_LINK_TYPE, fixer::fix_int::FIXInt::from(v));
127    }
128
129    /// Gets `AllocLinkType`, Tag 197.
130    pub fn get_alloc_link_type(&self) -> Result<isize, MessageRejectErrorEnum> {
131        let mut fld = field::AllocLinkTypeField::new(0);
132        self.message.body.get_field(tag::ALLOC_LINK_TYPE, &mut fld.0)?;
133        Ok(fld.value())
134    }
135
136
137    /// Returns true if `AllocLinkType` is present, Tag 197.
138    pub fn has_alloc_link_type(&self) -> bool {
139        self.message.body.has(tag::ALLOC_LINK_TYPE)
140    }
141
142
143
144
145    /// Sets `AllocTransType`, Tag 71.
146    pub fn set_alloc_trans_type(&mut self, v: String) {
147        self.message.body.set_field(tag::ALLOC_TRANS_TYPE, FIXString::from(v));
148    }
149
150    /// Gets `AllocTransType`, Tag 71.
151    pub fn get_alloc_trans_type(&self) -> Result<String, MessageRejectErrorEnum> {
152        let mut fld = field::AllocTransTypeField::new(String::new());
153        self.message.body.get_field(tag::ALLOC_TRANS_TYPE, &mut fld.0)?;
154        Ok(fld.value().to_string())
155    }
156
157
158    /// Returns true if `AllocTransType` is present, Tag 71.
159    pub fn has_alloc_trans_type(&self) -> bool {
160        self.message.body.has(tag::ALLOC_TRANS_TYPE)
161    }
162
163
164
165
166    /// Sets `AllocType`, Tag 626.
167    pub fn set_alloc_type(&mut self, v: isize) {
168        self.message.body.set_field(tag::ALLOC_TYPE, fixer::fix_int::FIXInt::from(v));
169    }
170
171    /// Gets `AllocType`, Tag 626.
172    pub fn get_alloc_type(&self) -> Result<isize, MessageRejectErrorEnum> {
173        let mut fld = field::AllocTypeField::new(0);
174        self.message.body.get_field(tag::ALLOC_TYPE, &mut fld.0)?;
175        Ok(fld.value())
176    }
177
178
179    /// Returns true if `AllocType` is present, Tag 626.
180    pub fn has_alloc_type(&self) -> bool {
181        self.message.body.has(tag::ALLOC_TYPE)
182    }
183
184
185
186
187    /// Sets `AvgPrxPrecision`, Tag 74.
188    pub fn set_avg_prx_precision(&mut self, v: isize) {
189        self.message.body.set_field(tag::AVG_PRX_PRECISION, fixer::fix_int::FIXInt::from(v));
190    }
191
192    /// Gets `AvgPrxPrecision`, Tag 74.
193    pub fn get_avg_prx_precision(&self) -> Result<isize, MessageRejectErrorEnum> {
194        let mut fld = field::AvgPrxPrecisionField::new(0);
195        self.message.body.get_field(tag::AVG_PRX_PRECISION, &mut fld.0)?;
196        Ok(fld.value())
197    }
198
199
200    /// Returns true if `AvgPrxPrecision` is present, Tag 74.
201    pub fn has_avg_prx_precision(&self) -> bool {
202        self.message.body.has(tag::AVG_PRX_PRECISION)
203    }
204
205
206
207
208    /// Sets `AvgPx`, Tag 6.
209    pub fn set_avg_px(&mut self, val: Decimal, scale: i32) {
210        self.message.body.set_field(tag::AVG_PX, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
211    }
212
213    /// Gets `AvgPx`, Tag 6.
214    pub fn get_avg_px(&self) -> Result<Decimal, MessageRejectErrorEnum> {
215        let mut fld = field::AvgPxField::new(Decimal::ZERO, 0);
216        self.message.body.get_field(tag::AVG_PX, &mut fld.0)?;
217        Ok(fld.value())
218    }
219
220
221    /// Returns true if `AvgPx` is present, Tag 6.
222    pub fn has_avg_px(&self) -> bool {
223        self.message.body.has(tag::AVG_PX)
224    }
225
226
227
228
229    /// Sets `BookingRefID`, Tag 466.
230    pub fn set_booking_ref_id(&mut self, v: String) {
231        self.message.body.set_field(tag::BOOKING_REF_ID, FIXString::from(v));
232    }
233
234    /// Gets `BookingRefID`, Tag 466.
235    pub fn get_booking_ref_id(&self) -> Result<String, MessageRejectErrorEnum> {
236        let mut fld = field::BookingRefIDField::new(String::new());
237        self.message.body.get_field(tag::BOOKING_REF_ID, &mut fld.0)?;
238        Ok(fld.value().to_string())
239    }
240
241
242    /// Returns true if `BookingRefID` is present, Tag 466.
243    pub fn has_booking_ref_id(&self) -> bool {
244        self.message.body.has(tag::BOOKING_REF_ID)
245    }
246
247
248
249
250    /// Sets `CFICode`, Tag 461.
251    pub fn set_cfi_code(&mut self, v: String) {
252        self.message.body.set_field(tag::CFI_CODE, FIXString::from(v));
253    }
254
255    /// Gets `CFICode`, Tag 461.
256    pub fn get_cfi_code(&self) -> Result<String, MessageRejectErrorEnum> {
257        let mut fld = field::CFICodeField::new(String::new());
258        self.message.body.get_field(tag::CFI_CODE, &mut fld.0)?;
259        Ok(fld.value().to_string())
260    }
261
262
263    /// Returns true if `CFICode` is present, Tag 461.
264    pub fn has_cfi_code(&self) -> bool {
265        self.message.body.has(tag::CFI_CODE)
266    }
267
268
269
270
271    /// Sets `Concession`, Tag 238.
272    pub fn set_concession(&mut self, val: Decimal, scale: i32) {
273        self.message.body.set_field(tag::CONCESSION, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
274    }
275
276    /// Gets `Concession`, Tag 238.
277    pub fn get_concession(&self) -> Result<Decimal, MessageRejectErrorEnum> {
278        let mut fld = field::ConcessionField::new(Decimal::ZERO, 0);
279        self.message.body.get_field(tag::CONCESSION, &mut fld.0)?;
280        Ok(fld.value())
281    }
282
283
284    /// Returns true if `Concession` is present, Tag 238.
285    pub fn has_concession(&self) -> bool {
286        self.message.body.has(tag::CONCESSION)
287    }
288
289
290
291
292    /// Sets `ContractMultiplier`, Tag 231.
293    pub fn set_contract_multiplier(&mut self, val: Decimal, scale: i32) {
294        self.message.body.set_field(tag::CONTRACT_MULTIPLIER, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
295    }
296
297    /// Gets `ContractMultiplier`, Tag 231.
298    pub fn get_contract_multiplier(&self) -> Result<Decimal, MessageRejectErrorEnum> {
299        let mut fld = field::ContractMultiplierField::new(Decimal::ZERO, 0);
300        self.message.body.get_field(tag::CONTRACT_MULTIPLIER, &mut fld.0)?;
301        Ok(fld.value())
302    }
303
304
305    /// Returns true if `ContractMultiplier` is present, Tag 231.
306    pub fn has_contract_multiplier(&self) -> bool {
307        self.message.body.has(tag::CONTRACT_MULTIPLIER)
308    }
309
310
311
312
313    /// Sets `CountryOfIssue`, Tag 470.
314    pub fn set_country_of_issue(&mut self, v: String) {
315        self.message.body.set_field(tag::COUNTRY_OF_ISSUE, FIXString::from(v));
316    }
317
318    /// Gets `CountryOfIssue`, Tag 470.
319    pub fn get_country_of_issue(&self) -> Result<String, MessageRejectErrorEnum> {
320        let mut fld = field::CountryOfIssueField::new(String::new());
321        self.message.body.get_field(tag::COUNTRY_OF_ISSUE, &mut fld.0)?;
322        Ok(fld.value().to_string())
323    }
324
325
326    /// Returns true if `CountryOfIssue` is present, Tag 470.
327    pub fn has_country_of_issue(&self) -> bool {
328        self.message.body.has(tag::COUNTRY_OF_ISSUE)
329    }
330
331
332
333
334    /// Sets `CouponPaymentDate`, Tag 224.
335    pub fn set_coupon_payment_date(&mut self, v: String) {
336        self.message.body.set_field(tag::COUPON_PAYMENT_DATE, FIXString::from(v));
337    }
338
339    /// Gets `CouponPaymentDate`, Tag 224.
340    pub fn get_coupon_payment_date(&self) -> Result<String, MessageRejectErrorEnum> {
341        let mut fld = field::CouponPaymentDateField::new(String::new());
342        self.message.body.get_field(tag::COUPON_PAYMENT_DATE, &mut fld.0)?;
343        Ok(fld.value().to_string())
344    }
345
346
347    /// Returns true if `CouponPaymentDate` is present, Tag 224.
348    pub fn has_coupon_payment_date(&self) -> bool {
349        self.message.body.has(tag::COUPON_PAYMENT_DATE)
350    }
351
352
353
354
355    /// Sets `CouponRate`, Tag 223.
356    pub fn set_coupon_rate(&mut self, val: Decimal, scale: i32) {
357        self.message.body.set_field(tag::COUPON_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
358    }
359
360    /// Gets `CouponRate`, Tag 223.
361    pub fn get_coupon_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
362        let mut fld = field::CouponRateField::new(Decimal::ZERO, 0);
363        self.message.body.get_field(tag::COUPON_RATE, &mut fld.0)?;
364        Ok(fld.value())
365    }
366
367
368    /// Returns true if `CouponRate` is present, Tag 223.
369    pub fn has_coupon_rate(&self) -> bool {
370        self.message.body.has(tag::COUPON_RATE)
371    }
372
373
374
375
376    /// Sets `CreditRating`, Tag 255.
377    pub fn set_credit_rating(&mut self, v: String) {
378        self.message.body.set_field(tag::CREDIT_RATING, FIXString::from(v));
379    }
380
381    /// Gets `CreditRating`, Tag 255.
382    pub fn get_credit_rating(&self) -> Result<String, MessageRejectErrorEnum> {
383        let mut fld = field::CreditRatingField::new(String::new());
384        self.message.body.get_field(tag::CREDIT_RATING, &mut fld.0)?;
385        Ok(fld.value().to_string())
386    }
387
388
389    /// Returns true if `CreditRating` is present, Tag 255.
390    pub fn has_credit_rating(&self) -> bool {
391        self.message.body.has(tag::CREDIT_RATING)
392    }
393
394
395
396
397    /// Sets `Currency`, Tag 15.
398    pub fn set_currency(&mut self, v: String) {
399        self.message.body.set_field(tag::CURRENCY, FIXString::from(v));
400    }
401
402    /// Gets `Currency`, Tag 15.
403    pub fn get_currency(&self) -> Result<String, MessageRejectErrorEnum> {
404        let mut fld = field::CurrencyField::new(String::new());
405        self.message.body.get_field(tag::CURRENCY, &mut fld.0)?;
406        Ok(fld.value().to_string())
407    }
408
409
410    /// Returns true if `Currency` is present, Tag 15.
411    pub fn has_currency(&self) -> bool {
412        self.message.body.has(tag::CURRENCY)
413    }
414
415
416
417
418    /// Sets `EncodedIssuer`, Tag 349.
419    pub fn set_encoded_issuer(&mut self, v: String) {
420        self.message.body.set_field(tag::ENCODED_ISSUER, FIXString::from(v));
421    }
422
423    /// Gets `EncodedIssuer`, Tag 349.
424    pub fn get_encoded_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
425        let mut fld = field::EncodedIssuerField::new(String::new());
426        self.message.body.get_field(tag::ENCODED_ISSUER, &mut fld.0)?;
427        Ok(fld.value().to_string())
428    }
429
430
431    /// Returns true if `EncodedIssuer` is present, Tag 349.
432    pub fn has_encoded_issuer(&self) -> bool {
433        self.message.body.has(tag::ENCODED_ISSUER)
434    }
435
436
437
438
439    /// Sets `EncodedIssuerLen`, Tag 348.
440    pub fn set_encoded_issuer_len(&mut self, v: isize) {
441        self.message.body.set_field(tag::ENCODED_ISSUER_LEN, fixer::fix_int::FIXInt::from(v));
442    }
443
444    /// Gets `EncodedIssuerLen`, Tag 348.
445    pub fn get_encoded_issuer_len(&self) -> Result<isize, MessageRejectErrorEnum> {
446        let mut fld = field::EncodedIssuerLenField::new(0);
447        self.message.body.get_field(tag::ENCODED_ISSUER_LEN, &mut fld.0)?;
448        Ok(fld.value())
449    }
450
451
452    /// Returns true if `EncodedIssuerLen` is present, Tag 348.
453    pub fn has_encoded_issuer_len(&self) -> bool {
454        self.message.body.has(tag::ENCODED_ISSUER_LEN)
455    }
456
457
458
459
460    /// Sets `EncodedSecurityDesc`, Tag 351.
461    pub fn set_encoded_security_desc(&mut self, v: String) {
462        self.message.body.set_field(tag::ENCODED_SECURITY_DESC, FIXString::from(v));
463    }
464
465    /// Gets `EncodedSecurityDesc`, Tag 351.
466    pub fn get_encoded_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
467        let mut fld = field::EncodedSecurityDescField::new(String::new());
468        self.message.body.get_field(tag::ENCODED_SECURITY_DESC, &mut fld.0)?;
469        Ok(fld.value().to_string())
470    }
471
472
473    /// Returns true if `EncodedSecurityDesc` is present, Tag 351.
474    pub fn has_encoded_security_desc(&self) -> bool {
475        self.message.body.has(tag::ENCODED_SECURITY_DESC)
476    }
477
478
479
480
481    /// Sets `EncodedSecurityDescLen`, Tag 350.
482    pub fn set_encoded_security_desc_len(&mut self, v: isize) {
483        self.message.body.set_field(tag::ENCODED_SECURITY_DESC_LEN, fixer::fix_int::FIXInt::from(v));
484    }
485
486    /// Gets `EncodedSecurityDescLen`, Tag 350.
487    pub fn get_encoded_security_desc_len(&self) -> Result<isize, MessageRejectErrorEnum> {
488        let mut fld = field::EncodedSecurityDescLenField::new(0);
489        self.message.body.get_field(tag::ENCODED_SECURITY_DESC_LEN, &mut fld.0)?;
490        Ok(fld.value())
491    }
492
493
494    /// Returns true if `EncodedSecurityDescLen` is present, Tag 350.
495    pub fn has_encoded_security_desc_len(&self) -> bool {
496        self.message.body.has(tag::ENCODED_SECURITY_DESC_LEN)
497    }
498
499
500
501
502    /// Sets `EncodedText`, Tag 355.
503    pub fn set_encoded_text(&mut self, v: String) {
504        self.message.body.set_field(tag::ENCODED_TEXT, FIXString::from(v));
505    }
506
507    /// Gets `EncodedText`, Tag 355.
508    pub fn get_encoded_text(&self) -> Result<String, MessageRejectErrorEnum> {
509        let mut fld = field::EncodedTextField::new(String::new());
510        self.message.body.get_field(tag::ENCODED_TEXT, &mut fld.0)?;
511        Ok(fld.value().to_string())
512    }
513
514
515    /// Returns true if `EncodedText` is present, Tag 355.
516    pub fn has_encoded_text(&self) -> bool {
517        self.message.body.has(tag::ENCODED_TEXT)
518    }
519
520
521
522
523    /// Sets `EncodedTextLen`, Tag 354.
524    pub fn set_encoded_text_len(&mut self, v: isize) {
525        self.message.body.set_field(tag::ENCODED_TEXT_LEN, fixer::fix_int::FIXInt::from(v));
526    }
527
528    /// Gets `EncodedTextLen`, Tag 354.
529    pub fn get_encoded_text_len(&self) -> Result<isize, MessageRejectErrorEnum> {
530        let mut fld = field::EncodedTextLenField::new(0);
531        self.message.body.get_field(tag::ENCODED_TEXT_LEN, &mut fld.0)?;
532        Ok(fld.value())
533    }
534
535
536    /// Returns true if `EncodedTextLen` is present, Tag 354.
537    pub fn has_encoded_text_len(&self) -> bool {
538        self.message.body.has(tag::ENCODED_TEXT_LEN)
539    }
540
541
542
543
544    /// Sets `Factor`, Tag 228.
545    pub fn set_factor(&mut self, val: Decimal, scale: i32) {
546        self.message.body.set_field(tag::FACTOR, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
547    }
548
549    /// Gets `Factor`, Tag 228.
550    pub fn get_factor(&self) -> Result<Decimal, MessageRejectErrorEnum> {
551        let mut fld = field::FactorField::new(Decimal::ZERO, 0);
552        self.message.body.get_field(tag::FACTOR, &mut fld.0)?;
553        Ok(fld.value())
554    }
555
556
557    /// Returns true if `Factor` is present, Tag 228.
558    pub fn has_factor(&self) -> bool {
559        self.message.body.has(tag::FACTOR)
560    }
561
562
563
564
565    /// Sets `FutSettDate`, Tag 64.
566    pub fn set_fut_sett_date(&mut self, v: String) {
567        self.message.body.set_field(tag::FUT_SETT_DATE, FIXString::from(v));
568    }
569
570    /// Gets `FutSettDate`, Tag 64.
571    pub fn get_fut_sett_date(&self) -> Result<String, MessageRejectErrorEnum> {
572        let mut fld = field::FutSettDateField::new(String::new());
573        self.message.body.get_field(tag::FUT_SETT_DATE, &mut fld.0)?;
574        Ok(fld.value().to_string())
575    }
576
577
578    /// Returns true if `FutSettDate` is present, Tag 64.
579    pub fn has_fut_sett_date(&self) -> bool {
580        self.message.body.has(tag::FUT_SETT_DATE)
581    }
582
583
584
585
586    /// Sets `GrossTradeAmt`, Tag 381.
587    pub fn set_gross_trade_amt(&mut self, val: Decimal, scale: i32) {
588        self.message.body.set_field(tag::GROSS_TRADE_AMT, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
589    }
590
591    /// Gets `GrossTradeAmt`, Tag 381.
592    pub fn get_gross_trade_amt(&self) -> Result<Decimal, MessageRejectErrorEnum> {
593        let mut fld = field::GrossTradeAmtField::new(Decimal::ZERO, 0);
594        self.message.body.get_field(tag::GROSS_TRADE_AMT, &mut fld.0)?;
595        Ok(fld.value())
596    }
597
598
599    /// Returns true if `GrossTradeAmt` is present, Tag 381.
600    pub fn has_gross_trade_amt(&self) -> bool {
601        self.message.body.has(tag::GROSS_TRADE_AMT)
602    }
603
604
605
606
607    /// Sets `InstrRegistry`, Tag 543.
608    pub fn set_instr_registry(&mut self, v: String) {
609        self.message.body.set_field(tag::INSTR_REGISTRY, FIXString::from(v));
610    }
611
612    /// Gets `InstrRegistry`, Tag 543.
613    pub fn get_instr_registry(&self) -> Result<String, MessageRejectErrorEnum> {
614        let mut fld = field::InstrRegistryField::new(String::new());
615        self.message.body.get_field(tag::INSTR_REGISTRY, &mut fld.0)?;
616        Ok(fld.value().to_string())
617    }
618
619
620    /// Returns true if `InstrRegistry` is present, Tag 543.
621    pub fn has_instr_registry(&self) -> bool {
622        self.message.body.has(tag::INSTR_REGISTRY)
623    }
624
625
626
627
628    /// Sets `IssueDate`, Tag 225.
629    pub fn set_issue_date(&mut self, v: String) {
630        self.message.body.set_field(tag::ISSUE_DATE, FIXString::from(v));
631    }
632
633    /// Gets `IssueDate`, Tag 225.
634    pub fn get_issue_date(&self) -> Result<String, MessageRejectErrorEnum> {
635        let mut fld = field::IssueDateField::new(String::new());
636        self.message.body.get_field(tag::ISSUE_DATE, &mut fld.0)?;
637        Ok(fld.value().to_string())
638    }
639
640
641    /// Returns true if `IssueDate` is present, Tag 225.
642    pub fn has_issue_date(&self) -> bool {
643        self.message.body.has(tag::ISSUE_DATE)
644    }
645
646
647
648
649    /// Sets `Issuer`, Tag 106.
650    pub fn set_issuer(&mut self, v: String) {
651        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
652    }
653
654    /// Gets `Issuer`, Tag 106.
655    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
656        let mut fld = field::IssuerField::new(String::new());
657        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
658        Ok(fld.value().to_string())
659    }
660
661
662    /// Returns true if `Issuer` is present, Tag 106.
663    pub fn has_issuer(&self) -> bool {
664        self.message.body.has(tag::ISSUER)
665    }
666
667
668
669
670    /// Sets `LastMkt`, Tag 30.
671    pub fn set_last_mkt(&mut self, v: String) {
672        self.message.body.set_field(tag::LAST_MKT, FIXString::from(v));
673    }
674
675    /// Gets `LastMkt`, Tag 30.
676    pub fn get_last_mkt(&self) -> Result<String, MessageRejectErrorEnum> {
677        let mut fld = field::LastMktField::new(String::new());
678        self.message.body.get_field(tag::LAST_MKT, &mut fld.0)?;
679        Ok(fld.value().to_string())
680    }
681
682
683    /// Returns true if `LastMkt` is present, Tag 30.
684    pub fn has_last_mkt(&self) -> bool {
685        self.message.body.has(tag::LAST_MKT)
686    }
687
688
689
690
691    /// Sets `LegalConfirm`, Tag 650.
692    pub fn set_legal_confirm(&mut self, v: bool) {
693        self.message.body.set_field(tag::LEGAL_CONFIRM, fixer::fix_boolean::FIXBoolean::from(v));
694    }
695
696    /// Gets `LegalConfirm`, Tag 650.
697    pub fn get_legal_confirm(&self) -> Result<bool, MessageRejectErrorEnum> {
698        let mut fld = field::LegalConfirmField::new(false);
699        self.message.body.get_field(tag::LEGAL_CONFIRM, &mut fld.0)?;
700        Ok(fld.value())
701    }
702
703
704    /// Returns true if `LegalConfirm` is present, Tag 650.
705    pub fn has_legal_confirm(&self) -> bool {
706        self.message.body.has(tag::LEGAL_CONFIRM)
707    }
708
709
710
711
712    /// Sets `LocaleOfIssue`, Tag 472.
713    pub fn set_locale_of_issue(&mut self, v: String) {
714        self.message.body.set_field(tag::LOCALE_OF_ISSUE, FIXString::from(v));
715    }
716
717    /// Gets `LocaleOfIssue`, Tag 472.
718    pub fn get_locale_of_issue(&self) -> Result<String, MessageRejectErrorEnum> {
719        let mut fld = field::LocaleOfIssueField::new(String::new());
720        self.message.body.get_field(tag::LOCALE_OF_ISSUE, &mut fld.0)?;
721        Ok(fld.value().to_string())
722    }
723
724
725    /// Returns true if `LocaleOfIssue` is present, Tag 472.
726    pub fn has_locale_of_issue(&self) -> bool {
727        self.message.body.has(tag::LOCALE_OF_ISSUE)
728    }
729
730
731
732
733    /// Sets `MaturityDate`, Tag 541.
734    pub fn set_maturity_date(&mut self, v: String) {
735        self.message.body.set_field(tag::MATURITY_DATE, FIXString::from(v));
736    }
737
738    /// Gets `MaturityDate`, Tag 541.
739    pub fn get_maturity_date(&self) -> Result<String, MessageRejectErrorEnum> {
740        let mut fld = field::MaturityDateField::new(String::new());
741        self.message.body.get_field(tag::MATURITY_DATE, &mut fld.0)?;
742        Ok(fld.value().to_string())
743    }
744
745
746    /// Returns true if `MaturityDate` is present, Tag 541.
747    pub fn has_maturity_date(&self) -> bool {
748        self.message.body.has(tag::MATURITY_DATE)
749    }
750
751
752
753
754    /// Sets `MaturityMonthYear`, Tag 200.
755    pub fn set_maturity_month_year(&mut self, v: String) {
756        self.message.body.set_field(tag::MATURITY_MONTH_YEAR, FIXString::from(v));
757    }
758
759    /// Gets `MaturityMonthYear`, Tag 200.
760    pub fn get_maturity_month_year(&self) -> Result<String, MessageRejectErrorEnum> {
761        let mut fld = field::MaturityMonthYearField::new(String::new());
762        self.message.body.get_field(tag::MATURITY_MONTH_YEAR, &mut fld.0)?;
763        Ok(fld.value().to_string())
764    }
765
766
767    /// Returns true if `MaturityMonthYear` is present, Tag 200.
768    pub fn has_maturity_month_year(&self) -> bool {
769        self.message.body.has(tag::MATURITY_MONTH_YEAR)
770    }
771
772
773
774
775    /// Sets `NetMoney`, Tag 118.
776    pub fn set_net_money(&mut self, val: Decimal, scale: i32) {
777        self.message.body.set_field(tag::NET_MONEY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
778    }
779
780    /// Gets `NetMoney`, Tag 118.
781    pub fn get_net_money(&self) -> Result<Decimal, MessageRejectErrorEnum> {
782        let mut fld = field::NetMoneyField::new(Decimal::ZERO, 0);
783        self.message.body.get_field(tag::NET_MONEY, &mut fld.0)?;
784        Ok(fld.value())
785    }
786
787
788    /// Returns true if `NetMoney` is present, Tag 118.
789    pub fn has_net_money(&self) -> bool {
790        self.message.body.has(tag::NET_MONEY)
791    }
792
793
794
795
796    /// Sets `NoAllocs`, Tag 78.
797    pub fn set_no_allocs(&mut self, v: isize) {
798        self.message.body.set_field(tag::NO_ALLOCS, fixer::fix_int::FIXInt::from(v));
799    }
800
801    /// Gets `NoAllocs`, Tag 78.
802    pub fn get_no_allocs(&self) -> Result<isize, MessageRejectErrorEnum> {
803        let mut fld = field::NoAllocsField::new(0);
804        self.message.body.get_field(tag::NO_ALLOCS, &mut fld.0)?;
805        Ok(fld.value())
806    }
807
808
809    /// Returns true if `NoAllocs` is present, Tag 78.
810    pub fn has_no_allocs(&self) -> bool {
811        self.message.body.has(tag::NO_ALLOCS)
812    }
813
814
815
816
817    /// Sets `NoExecs`, Tag 124.
818    pub fn set_no_execs(&mut self, v: isize) {
819        self.message.body.set_field(tag::NO_EXECS, fixer::fix_int::FIXInt::from(v));
820    }
821
822    /// Gets `NoExecs`, Tag 124.
823    pub fn get_no_execs(&self) -> Result<isize, MessageRejectErrorEnum> {
824        let mut fld = field::NoExecsField::new(0);
825        self.message.body.get_field(tag::NO_EXECS, &mut fld.0)?;
826        Ok(fld.value())
827    }
828
829
830    /// Returns true if `NoExecs` is present, Tag 124.
831    pub fn has_no_execs(&self) -> bool {
832        self.message.body.has(tag::NO_EXECS)
833    }
834
835
836
837
838    /// Sets `NoOrders`, Tag 73.
839    pub fn set_no_orders(&mut self, v: isize) {
840        self.message.body.set_field(tag::NO_ORDERS, fixer::fix_int::FIXInt::from(v));
841    }
842
843    /// Gets `NoOrders`, Tag 73.
844    pub fn get_no_orders(&self) -> Result<isize, MessageRejectErrorEnum> {
845        let mut fld = field::NoOrdersField::new(0);
846        self.message.body.get_field(tag::NO_ORDERS, &mut fld.0)?;
847        Ok(fld.value())
848    }
849
850
851    /// Returns true if `NoOrders` is present, Tag 73.
852    pub fn has_no_orders(&self) -> bool {
853        self.message.body.has(tag::NO_ORDERS)
854    }
855
856
857
858
859    /// Sets `NoPartyIDs`, Tag 453.
860    pub fn set_no_party_i_ds(&mut self, v: isize) {
861        self.message.body.set_field(tag::NO_PARTY_I_DS, fixer::fix_int::FIXInt::from(v));
862    }
863
864    /// Gets `NoPartyIDs`, Tag 453.
865    pub fn get_no_party_i_ds(&self) -> Result<isize, MessageRejectErrorEnum> {
866        let mut fld = field::NoPartyIDsField::new(0);
867        self.message.body.get_field(tag::NO_PARTY_I_DS, &mut fld.0)?;
868        Ok(fld.value())
869    }
870
871
872    /// Returns true if `NoPartyIDs` is present, Tag 453.
873    pub fn has_no_party_i_ds(&self) -> bool {
874        self.message.body.has(tag::NO_PARTY_I_DS)
875    }
876
877
878
879
880    /// Sets `NoSecurityAltID`, Tag 454.
881    pub fn set_no_security_alt_id(&mut self, v: isize) {
882        self.message.body.set_field(tag::NO_SECURITY_ALT_ID, fixer::fix_int::FIXInt::from(v));
883    }
884
885    /// Gets `NoSecurityAltID`, Tag 454.
886    pub fn get_no_security_alt_id(&self) -> Result<isize, MessageRejectErrorEnum> {
887        let mut fld = field::NoSecurityAltIDField::new(0);
888        self.message.body.get_field(tag::NO_SECURITY_ALT_ID, &mut fld.0)?;
889        Ok(fld.value())
890    }
891
892
893    /// Returns true if `NoSecurityAltID` is present, Tag 454.
894    pub fn has_no_security_alt_id(&self) -> bool {
895        self.message.body.has(tag::NO_SECURITY_ALT_ID)
896    }
897
898
899
900
901    /// Sets `NumDaysInterest`, Tag 157.
902    pub fn set_num_days_interest(&mut self, v: isize) {
903        self.message.body.set_field(tag::NUM_DAYS_INTEREST, fixer::fix_int::FIXInt::from(v));
904    }
905
906    /// Gets `NumDaysInterest`, Tag 157.
907    pub fn get_num_days_interest(&self) -> Result<isize, MessageRejectErrorEnum> {
908        let mut fld = field::NumDaysInterestField::new(0);
909        self.message.body.get_field(tag::NUM_DAYS_INTEREST, &mut fld.0)?;
910        Ok(fld.value())
911    }
912
913
914    /// Returns true if `NumDaysInterest` is present, Tag 157.
915    pub fn has_num_days_interest(&self) -> bool {
916        self.message.body.has(tag::NUM_DAYS_INTEREST)
917    }
918
919
920
921
922    /// Sets `OptAttribute`, Tag 206.
923    pub fn set_opt_attribute(&mut self, v: String) {
924        self.message.body.set_field(tag::OPT_ATTRIBUTE, FIXString::from(v));
925    }
926
927    /// Gets `OptAttribute`, Tag 206.
928    pub fn get_opt_attribute(&self) -> Result<String, MessageRejectErrorEnum> {
929        let mut fld = field::OptAttributeField::new(String::new());
930        self.message.body.get_field(tag::OPT_ATTRIBUTE, &mut fld.0)?;
931        Ok(fld.value().to_string())
932    }
933
934
935    /// Returns true if `OptAttribute` is present, Tag 206.
936    pub fn has_opt_attribute(&self) -> bool {
937        self.message.body.has(tag::OPT_ATTRIBUTE)
938    }
939
940
941
942
943    /// Sets `PositionEffect`, Tag 77.
944    pub fn set_position_effect(&mut self, v: String) {
945        self.message.body.set_field(tag::POSITION_EFFECT, FIXString::from(v));
946    }
947
948    /// Gets `PositionEffect`, Tag 77.
949    pub fn get_position_effect(&self) -> Result<String, MessageRejectErrorEnum> {
950        let mut fld = field::PositionEffectField::new(String::new());
951        self.message.body.get_field(tag::POSITION_EFFECT, &mut fld.0)?;
952        Ok(fld.value().to_string())
953    }
954
955
956    /// Returns true if `PositionEffect` is present, Tag 77.
957    pub fn has_position_effect(&self) -> bool {
958        self.message.body.has(tag::POSITION_EFFECT)
959    }
960
961
962
963
964    /// Sets `PriceType`, Tag 423.
965    pub fn set_price_type(&mut self, v: isize) {
966        self.message.body.set_field(tag::PRICE_TYPE, fixer::fix_int::FIXInt::from(v));
967    }
968
969    /// Gets `PriceType`, Tag 423.
970    pub fn get_price_type(&self) -> Result<isize, MessageRejectErrorEnum> {
971        let mut fld = field::PriceTypeField::new(0);
972        self.message.body.get_field(tag::PRICE_TYPE, &mut fld.0)?;
973        Ok(fld.value())
974    }
975
976
977    /// Returns true if `PriceType` is present, Tag 423.
978    pub fn has_price_type(&self) -> bool {
979        self.message.body.has(tag::PRICE_TYPE)
980    }
981
982
983
984
985    /// Sets `Product`, Tag 460.
986    pub fn set_product(&mut self, v: isize) {
987        self.message.body.set_field(tag::PRODUCT, fixer::fix_int::FIXInt::from(v));
988    }
989
990    /// Gets `Product`, Tag 460.
991    pub fn get_product(&self) -> Result<isize, MessageRejectErrorEnum> {
992        let mut fld = field::ProductField::new(0);
993        self.message.body.get_field(tag::PRODUCT, &mut fld.0)?;
994        Ok(fld.value())
995    }
996
997
998    /// Returns true if `Product` is present, Tag 460.
999    pub fn has_product(&self) -> bool {
1000        self.message.body.has(tag::PRODUCT)
1001    }
1002
1003
1004
1005
1006    /// Sets `Quantity`, Tag 53.
1007    pub fn set_quantity(&mut self, val: Decimal, scale: i32) {
1008        self.message.body.set_field(tag::QUANTITY, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1009    }
1010
1011    /// Gets `Quantity`, Tag 53.
1012    pub fn get_quantity(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1013        let mut fld = field::QuantityField::new(Decimal::ZERO, 0);
1014        self.message.body.get_field(tag::QUANTITY, &mut fld.0)?;
1015        Ok(fld.value())
1016    }
1017
1018
1019    /// Returns true if `Quantity` is present, Tag 53.
1020    pub fn has_quantity(&self) -> bool {
1021        self.message.body.has(tag::QUANTITY)
1022    }
1023
1024
1025
1026
1027    /// Sets `RedemptionDate`, Tag 240.
1028    pub fn set_redemption_date(&mut self, v: String) {
1029        self.message.body.set_field(tag::REDEMPTION_DATE, FIXString::from(v));
1030    }
1031
1032    /// Gets `RedemptionDate`, Tag 240.
1033    pub fn get_redemption_date(&self) -> Result<String, MessageRejectErrorEnum> {
1034        let mut fld = field::RedemptionDateField::new(String::new());
1035        self.message.body.get_field(tag::REDEMPTION_DATE, &mut fld.0)?;
1036        Ok(fld.value().to_string())
1037    }
1038
1039
1040    /// Returns true if `RedemptionDate` is present, Tag 240.
1041    pub fn has_redemption_date(&self) -> bool {
1042        self.message.body.has(tag::REDEMPTION_DATE)
1043    }
1044
1045
1046
1047
1048    /// Sets `RefAllocID`, Tag 72.
1049    pub fn set_ref_alloc_id(&mut self, v: String) {
1050        self.message.body.set_field(tag::REF_ALLOC_ID, FIXString::from(v));
1051    }
1052
1053    /// Gets `RefAllocID`, Tag 72.
1054    pub fn get_ref_alloc_id(&self) -> Result<String, MessageRejectErrorEnum> {
1055        let mut fld = field::RefAllocIDField::new(String::new());
1056        self.message.body.get_field(tag::REF_ALLOC_ID, &mut fld.0)?;
1057        Ok(fld.value().to_string())
1058    }
1059
1060
1061    /// Returns true if `RefAllocID` is present, Tag 72.
1062    pub fn has_ref_alloc_id(&self) -> bool {
1063        self.message.body.has(tag::REF_ALLOC_ID)
1064    }
1065
1066
1067
1068
1069    /// Sets `RepoCollateralSecurityType`, Tag 239.
1070    pub fn set_repo_collateral_security_type(&mut self, v: isize) {
1071        self.message.body.set_field(tag::REPO_COLLATERAL_SECURITY_TYPE, fixer::fix_int::FIXInt::from(v));
1072    }
1073
1074    /// Gets `RepoCollateralSecurityType`, Tag 239.
1075    pub fn get_repo_collateral_security_type(&self) -> Result<isize, MessageRejectErrorEnum> {
1076        let mut fld = field::RepoCollateralSecurityTypeField::new(0);
1077        self.message.body.get_field(tag::REPO_COLLATERAL_SECURITY_TYPE, &mut fld.0)?;
1078        Ok(fld.value())
1079    }
1080
1081
1082    /// Returns true if `RepoCollateralSecurityType` is present, Tag 239.
1083    pub fn has_repo_collateral_security_type(&self) -> bool {
1084        self.message.body.has(tag::REPO_COLLATERAL_SECURITY_TYPE)
1085    }
1086
1087
1088
1089
1090    /// Sets `RepurchaseRate`, Tag 227.
1091    pub fn set_repurchase_rate(&mut self, val: Decimal, scale: i32) {
1092        self.message.body.set_field(tag::REPURCHASE_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1093    }
1094
1095    /// Gets `RepurchaseRate`, Tag 227.
1096    pub fn get_repurchase_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1097        let mut fld = field::RepurchaseRateField::new(Decimal::ZERO, 0);
1098        self.message.body.get_field(tag::REPURCHASE_RATE, &mut fld.0)?;
1099        Ok(fld.value())
1100    }
1101
1102
1103    /// Returns true if `RepurchaseRate` is present, Tag 227.
1104    pub fn has_repurchase_rate(&self) -> bool {
1105        self.message.body.has(tag::REPURCHASE_RATE)
1106    }
1107
1108
1109
1110
1111    /// Sets `RepurchaseTerm`, Tag 226.
1112    pub fn set_repurchase_term(&mut self, v: isize) {
1113        self.message.body.set_field(tag::REPURCHASE_TERM, fixer::fix_int::FIXInt::from(v));
1114    }
1115
1116    /// Gets `RepurchaseTerm`, Tag 226.
1117    pub fn get_repurchase_term(&self) -> Result<isize, MessageRejectErrorEnum> {
1118        let mut fld = field::RepurchaseTermField::new(0);
1119        self.message.body.get_field(tag::REPURCHASE_TERM, &mut fld.0)?;
1120        Ok(fld.value())
1121    }
1122
1123
1124    /// Returns true if `RepurchaseTerm` is present, Tag 226.
1125    pub fn has_repurchase_term(&self) -> bool {
1126        self.message.body.has(tag::REPURCHASE_TERM)
1127    }
1128
1129
1130
1131
1132    /// Sets `SecurityDesc`, Tag 107.
1133    pub fn set_security_desc(&mut self, v: String) {
1134        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
1135    }
1136
1137    /// Gets `SecurityDesc`, Tag 107.
1138    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
1139        let mut fld = field::SecurityDescField::new(String::new());
1140        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
1141        Ok(fld.value().to_string())
1142    }
1143
1144
1145    /// Returns true if `SecurityDesc` is present, Tag 107.
1146    pub fn has_security_desc(&self) -> bool {
1147        self.message.body.has(tag::SECURITY_DESC)
1148    }
1149
1150
1151
1152
1153    /// Sets `SecurityExchange`, Tag 207.
1154    pub fn set_security_exchange(&mut self, v: String) {
1155        self.message.body.set_field(tag::SECURITY_EXCHANGE, FIXString::from(v));
1156    }
1157
1158    /// Gets `SecurityExchange`, Tag 207.
1159    pub fn get_security_exchange(&self) -> Result<String, MessageRejectErrorEnum> {
1160        let mut fld = field::SecurityExchangeField::new(String::new());
1161        self.message.body.get_field(tag::SECURITY_EXCHANGE, &mut fld.0)?;
1162        Ok(fld.value().to_string())
1163    }
1164
1165
1166    /// Returns true if `SecurityExchange` is present, Tag 207.
1167    pub fn has_security_exchange(&self) -> bool {
1168        self.message.body.has(tag::SECURITY_EXCHANGE)
1169    }
1170
1171
1172
1173
1174    /// Sets `SecurityID`, Tag 48.
1175    pub fn set_security_id(&mut self, v: String) {
1176        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
1177    }
1178
1179    /// Gets `SecurityID`, Tag 48.
1180    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
1181        let mut fld = field::SecurityIDField::new(String::new());
1182        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
1183        Ok(fld.value().to_string())
1184    }
1185
1186
1187    /// Returns true if `SecurityID` is present, Tag 48.
1188    pub fn has_security_id(&self) -> bool {
1189        self.message.body.has(tag::SECURITY_ID)
1190    }
1191
1192
1193
1194
1195    /// Sets `SecurityIDSource`, Tag 22.
1196    pub fn set_security_id_source(&mut self, v: String) {
1197        self.message.body.set_field(tag::SECURITY_ID_SOURCE, FIXString::from(v));
1198    }
1199
1200    /// Gets `SecurityIDSource`, Tag 22.
1201    pub fn get_security_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
1202        let mut fld = field::SecurityIDSourceField::new(String::new());
1203        self.message.body.get_field(tag::SECURITY_ID_SOURCE, &mut fld.0)?;
1204        Ok(fld.value().to_string())
1205    }
1206
1207
1208    /// Returns true if `SecurityIDSource` is present, Tag 22.
1209    pub fn has_security_id_source(&self) -> bool {
1210        self.message.body.has(tag::SECURITY_ID_SOURCE)
1211    }
1212
1213
1214
1215
1216    /// Sets `SecurityType`, Tag 167.
1217    pub fn set_security_type(&mut self, v: String) {
1218        self.message.body.set_field(tag::SECURITY_TYPE, FIXString::from(v));
1219    }
1220
1221    /// Gets `SecurityType`, Tag 167.
1222    pub fn get_security_type(&self) -> Result<String, MessageRejectErrorEnum> {
1223        let mut fld = field::SecurityTypeField::new(String::new());
1224        self.message.body.get_field(tag::SECURITY_TYPE, &mut fld.0)?;
1225        Ok(fld.value().to_string())
1226    }
1227
1228
1229    /// Returns true if `SecurityType` is present, Tag 167.
1230    pub fn has_security_type(&self) -> bool {
1231        self.message.body.has(tag::SECURITY_TYPE)
1232    }
1233
1234
1235
1236
1237    /// Sets `SettlmntTyp`, Tag 63.
1238    pub fn set_settlmnt_typ(&mut self, v: String) {
1239        self.message.body.set_field(tag::SETTLMNT_TYP, FIXString::from(v));
1240    }
1241
1242    /// Gets `SettlmntTyp`, Tag 63.
1243    pub fn get_settlmnt_typ(&self) -> Result<String, MessageRejectErrorEnum> {
1244        let mut fld = field::SettlmntTypField::new(String::new());
1245        self.message.body.get_field(tag::SETTLMNT_TYP, &mut fld.0)?;
1246        Ok(fld.value().to_string())
1247    }
1248
1249
1250    /// Returns true if `SettlmntTyp` is present, Tag 63.
1251    pub fn has_settlmnt_typ(&self) -> bool {
1252        self.message.body.has(tag::SETTLMNT_TYP)
1253    }
1254
1255
1256
1257
1258    /// Sets `Side`, Tag 54.
1259    pub fn set_side(&mut self, v: String) {
1260        self.message.body.set_field(tag::SIDE, FIXString::from(v));
1261    }
1262
1263    /// Gets `Side`, Tag 54.
1264    pub fn get_side(&self) -> Result<String, MessageRejectErrorEnum> {
1265        let mut fld = field::SideField::new(String::new());
1266        self.message.body.get_field(tag::SIDE, &mut fld.0)?;
1267        Ok(fld.value().to_string())
1268    }
1269
1270
1271    /// Returns true if `Side` is present, Tag 54.
1272    pub fn has_side(&self) -> bool {
1273        self.message.body.has(tag::SIDE)
1274    }
1275
1276
1277
1278
1279    /// Sets `StateOrProvinceOfIssue`, Tag 471.
1280    pub fn set_state_or_province_of_issue(&mut self, v: String) {
1281        self.message.body.set_field(tag::STATE_OR_PROVINCE_OF_ISSUE, FIXString::from(v));
1282    }
1283
1284    /// Gets `StateOrProvinceOfIssue`, Tag 471.
1285    pub fn get_state_or_province_of_issue(&self) -> Result<String, MessageRejectErrorEnum> {
1286        let mut fld = field::StateOrProvinceOfIssueField::new(String::new());
1287        self.message.body.get_field(tag::STATE_OR_PROVINCE_OF_ISSUE, &mut fld.0)?;
1288        Ok(fld.value().to_string())
1289    }
1290
1291
1292    /// Returns true if `StateOrProvinceOfIssue` is present, Tag 471.
1293    pub fn has_state_or_province_of_issue(&self) -> bool {
1294        self.message.body.has(tag::STATE_OR_PROVINCE_OF_ISSUE)
1295    }
1296
1297
1298
1299
1300    /// Sets `StrikePrice`, Tag 202.
1301    pub fn set_strike_price(&mut self, val: Decimal, scale: i32) {
1302        self.message.body.set_field(tag::STRIKE_PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1303    }
1304
1305    /// Gets `StrikePrice`, Tag 202.
1306    pub fn get_strike_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1307        let mut fld = field::StrikePriceField::new(Decimal::ZERO, 0);
1308        self.message.body.get_field(tag::STRIKE_PRICE, &mut fld.0)?;
1309        Ok(fld.value())
1310    }
1311
1312
1313    /// Returns true if `StrikePrice` is present, Tag 202.
1314    pub fn has_strike_price(&self) -> bool {
1315        self.message.body.has(tag::STRIKE_PRICE)
1316    }
1317
1318
1319
1320
1321    /// Sets `Symbol`, Tag 55.
1322    pub fn set_symbol(&mut self, v: String) {
1323        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
1324    }
1325
1326    /// Gets `Symbol`, Tag 55.
1327    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
1328        let mut fld = field::SymbolField::new(String::new());
1329        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
1330        Ok(fld.value().to_string())
1331    }
1332
1333
1334    /// Returns true if `Symbol` is present, Tag 55.
1335    pub fn has_symbol(&self) -> bool {
1336        self.message.body.has(tag::SYMBOL)
1337    }
1338
1339
1340
1341
1342    /// Sets `SymbolSfx`, Tag 65.
1343    pub fn set_symbol_sfx(&mut self, v: String) {
1344        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
1345    }
1346
1347    /// Gets `SymbolSfx`, Tag 65.
1348    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
1349        let mut fld = field::SymbolSfxField::new(String::new());
1350        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
1351        Ok(fld.value().to_string())
1352    }
1353
1354
1355    /// Returns true if `SymbolSfx` is present, Tag 65.
1356    pub fn has_symbol_sfx(&self) -> bool {
1357        self.message.body.has(tag::SYMBOL_SFX)
1358    }
1359
1360
1361
1362
1363    /// Sets `Text`, Tag 58.
1364    pub fn set_text(&mut self, v: String) {
1365        self.message.body.set_field(tag::TEXT, FIXString::from(v));
1366    }
1367
1368    /// Gets `Text`, Tag 58.
1369    pub fn get_text(&self) -> Result<String, MessageRejectErrorEnum> {
1370        let mut fld = field::TextField::new(String::new());
1371        self.message.body.get_field(tag::TEXT, &mut fld.0)?;
1372        Ok(fld.value().to_string())
1373    }
1374
1375
1376    /// Returns true if `Text` is present, Tag 58.
1377    pub fn has_text(&self) -> bool {
1378        self.message.body.has(tag::TEXT)
1379    }
1380
1381
1382
1383
1384    /// Sets `TotalAccruedInterestAmt`, Tag 540.
1385    pub fn set_total_accrued_interest_amt(&mut self, val: Decimal, scale: i32) {
1386        self.message.body.set_field(tag::TOTAL_ACCRUED_INTEREST_AMT, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1387    }
1388
1389    /// Gets `TotalAccruedInterestAmt`, Tag 540.
1390    pub fn get_total_accrued_interest_amt(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1391        let mut fld = field::TotalAccruedInterestAmtField::new(Decimal::ZERO, 0);
1392        self.message.body.get_field(tag::TOTAL_ACCRUED_INTEREST_AMT, &mut fld.0)?;
1393        Ok(fld.value())
1394    }
1395
1396
1397    /// Returns true if `TotalAccruedInterestAmt` is present, Tag 540.
1398    pub fn has_total_accrued_interest_amt(&self) -> bool {
1399        self.message.body.has(tag::TOTAL_ACCRUED_INTEREST_AMT)
1400    }
1401
1402
1403
1404
1405    /// Sets `TotalTakedown`, Tag 237.
1406    pub fn set_total_takedown(&mut self, val: Decimal, scale: i32) {
1407        self.message.body.set_field(tag::TOTAL_TAKEDOWN, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
1408    }
1409
1410    /// Gets `TotalTakedown`, Tag 237.
1411    pub fn get_total_takedown(&self) -> Result<Decimal, MessageRejectErrorEnum> {
1412        let mut fld = field::TotalTakedownField::new(Decimal::ZERO, 0);
1413        self.message.body.get_field(tag::TOTAL_TAKEDOWN, &mut fld.0)?;
1414        Ok(fld.value())
1415    }
1416
1417
1418    /// Returns true if `TotalTakedown` is present, Tag 237.
1419    pub fn has_total_takedown(&self) -> bool {
1420        self.message.body.has(tag::TOTAL_TAKEDOWN)
1421    }
1422
1423
1424
1425
1426    /// Sets `TradeDate`, Tag 75.
1427    pub fn set_trade_date(&mut self, v: String) {
1428        self.message.body.set_field(tag::TRADE_DATE, FIXString::from(v));
1429    }
1430
1431    /// Gets `TradeDate`, Tag 75.
1432    pub fn get_trade_date(&self) -> Result<String, MessageRejectErrorEnum> {
1433        let mut fld = field::TradeDateField::new(String::new());
1434        self.message.body.get_field(tag::TRADE_DATE, &mut fld.0)?;
1435        Ok(fld.value().to_string())
1436    }
1437
1438
1439    /// Returns true if `TradeDate` is present, Tag 75.
1440    pub fn has_trade_date(&self) -> bool {
1441        self.message.body.has(tag::TRADE_DATE)
1442    }
1443
1444
1445
1446
1447    /// Sets `TradeOriginationDate`, Tag 229.
1448    pub fn set_trade_origination_date(&mut self, v: String) {
1449        self.message.body.set_field(tag::TRADE_ORIGINATION_DATE, FIXString::from(v));
1450    }
1451
1452    /// Gets `TradeOriginationDate`, Tag 229.
1453    pub fn get_trade_origination_date(&self) -> Result<String, MessageRejectErrorEnum> {
1454        let mut fld = field::TradeOriginationDateField::new(String::new());
1455        self.message.body.get_field(tag::TRADE_ORIGINATION_DATE, &mut fld.0)?;
1456        Ok(fld.value().to_string())
1457    }
1458
1459
1460    /// Returns true if `TradeOriginationDate` is present, Tag 229.
1461    pub fn has_trade_origination_date(&self) -> bool {
1462        self.message.body.has(tag::TRADE_ORIGINATION_DATE)
1463    }
1464
1465
1466
1467
1468    /// Sets `TradingSessionID`, Tag 336.
1469    pub fn set_trading_session_id(&mut self, v: String) {
1470        self.message.body.set_field(tag::TRADING_SESSION_ID, FIXString::from(v));
1471    }
1472
1473    /// Gets `TradingSessionID`, Tag 336.
1474    pub fn get_trading_session_id(&self) -> Result<String, MessageRejectErrorEnum> {
1475        let mut fld = field::TradingSessionIDField::new(String::new());
1476        self.message.body.get_field(tag::TRADING_SESSION_ID, &mut fld.0)?;
1477        Ok(fld.value().to_string())
1478    }
1479
1480
1481    /// Returns true if `TradingSessionID` is present, Tag 336.
1482    pub fn has_trading_session_id(&self) -> bool {
1483        self.message.body.has(tag::TRADING_SESSION_ID)
1484    }
1485
1486
1487
1488
1489    /// Sets `TradingSessionSubID`, Tag 625.
1490    pub fn set_trading_session_sub_id(&mut self, v: String) {
1491        self.message.body.set_field(tag::TRADING_SESSION_SUB_ID, FIXString::from(v));
1492    }
1493
1494    /// Gets `TradingSessionSubID`, Tag 625.
1495    pub fn get_trading_session_sub_id(&self) -> Result<String, MessageRejectErrorEnum> {
1496        let mut fld = field::TradingSessionSubIDField::new(String::new());
1497        self.message.body.get_field(tag::TRADING_SESSION_SUB_ID, &mut fld.0)?;
1498        Ok(fld.value().to_string())
1499    }
1500
1501
1502    /// Returns true if `TradingSessionSubID` is present, Tag 625.
1503    pub fn has_trading_session_sub_id(&self) -> bool {
1504        self.message.body.has(tag::TRADING_SESSION_SUB_ID)
1505    }
1506
1507
1508
1509
1510    /// Sets `TransactTime`, Tag 60.
1511    pub fn set_transact_time(&mut self, v: Timestamp) {
1512        self.message.body.set_field(tag::TRANSACT_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
1513            time: v,
1514            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
1515        });
1516    }
1517
1518    /// Gets `TransactTime`, Tag 60.
1519    pub fn get_transact_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
1520        let mut fld = field::TransactTimeField::new(Timestamp::UNIX_EPOCH);
1521        self.message.body.get_field(tag::TRANSACT_TIME, &mut fld.0)?;
1522        Ok(fld.value())
1523    }
1524
1525
1526    /// Returns true if `TransactTime` is present, Tag 60.
1527    pub fn has_transact_time(&self) -> bool {
1528        self.message.body.has(tag::TRANSACT_TIME)
1529    }
1530
1531
1532}
1533
1534/// `RouteOut` is the callback type for routing `Allocation` messages.
1535pub type RouteOut = fn(msg: Allocation, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
1536
1537/// Route type returned by the `route` function.
1538pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
1539
1540/// Returns the begin string, message type, and route function for `Allocation`.
1541pub fn route(router: RouteOut) -> Route {
1542    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
1543        router(Allocation::from_message(msg.clone()), session_id)
1544    };
1545    ("FIX.4.3", "J", Box::new(r))
1546}