Skip to main content

refix_fix42/generated/messages/
allocation.rs

1// @generated by refix codegen from FIX42.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5    Date, Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, MonthYear, RawMessage, Tag,
6    UtcTimestamp,
7};
8
9use super::super::components::{Header, Trailer};
10use super::super::enums::{
11    AllocHandlInst, AllocLinkType, AllocTransType, CommType, IDSource, LastCapacity, MiscFeeType,
12    OpenClose, ProcessCode, PutOrCall, SecurityType, SettlInstMode, SettlmntTyp, Side,
13};
14
15/// The `Allocation` (35=J) message.
16pub struct Allocation(RawMessage);
17
18impl Allocation {
19    pub const MSG_TYPE: &[u8] = b"J";
20
21    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
22        static TAGS: LazyKnownTags = LazyKnownTags::new(
23            &[
24                Tag(70), Tag(71), Tag(72), Tag(196), Tag(197), Tag(73), Tag(124), Tag(54), Tag(55),
25                Tag(65), Tag(48), Tag(22), Tag(167), Tag(200), Tag(205), Tag(201), Tag(202),
26                Tag(206), Tag(231), Tag(223), Tag(207), Tag(106), Tag(348), Tag(349), Tag(107),
27                Tag(350), Tag(351), Tag(53), Tag(30), Tag(336), Tag(6), Tag(15), Tag(74), Tag(75),
28                Tag(60), Tag(63), Tag(64), Tag(381), Tag(118), Tag(77), Tag(58), Tag(354), Tag(355),
29                Tag(157), Tag(158), Tag(78),
30            ],
31            &[
32                Header::known_tags(), Trailer::known_tags(), AllocationOrders::known_tags(),
33                AllocationExecs::known_tags(), AllocationAllocs::known_tags(),
34            ],
35        );
36        &TAGS
37    }
38
39    pub fn from_raw(raw: RawMessage) -> Self {
40        Self(raw)
41    }
42
43    pub fn raw(&self) -> &RawMessage {
44        &self.0
45    }
46
47    pub fn header(&self) -> Header<'_> {
48        Header(self.0.scope())
49    }
50
51    pub fn trailer(&self) -> Trailer<'_> {
52        Trailer(self.0.scope())
53    }
54
55    /// The `AllocID` (70) field.
56    #[doc(alias = "AllocID")]
57    pub fn alloc_id(&self) -> Result<Option<&str>, InvalidValue> {
58        self.0.get_str(Tag(70))
59    }
60
61    /// The `AllocTransType` (71) field.
62    #[doc(alias = "AllocTransType")]
63    pub fn alloc_trans_type(&self) -> Result<Option<AllocTransType<'_>>, InvalidValue> {
64        Ok(self.0.get_str(Tag(71))?.map(AllocTransType::from_value))
65    }
66
67    /// The `RefAllocID` (72) field.
68    #[doc(alias = "RefAllocID")]
69    pub fn ref_alloc_id(&self) -> Result<Option<&str>, InvalidValue> {
70        self.0.get_str(Tag(72))
71    }
72
73    /// The `AllocLinkID` (196) field.
74    #[doc(alias = "AllocLinkID")]
75    pub fn alloc_link_id(&self) -> Result<Option<&str>, InvalidValue> {
76        self.0.get_str(Tag(196))
77    }
78
79    /// The `AllocLinkType` (197) field.
80    #[doc(alias = "AllocLinkType")]
81    pub fn alloc_link_type(&self) -> Result<Option<AllocLinkType>, InvalidValue> {
82        Ok(self.0.get_int(Tag(197))?.map(AllocLinkType::from_value))
83    }
84
85    /// The instances of the `NoOrders` (73) group.
86    #[doc(alias = "NoOrders")]
87    pub fn orders(&self) -> Result<Instances<'_, AllocationOrders<'_>>, InvalidValue> {
88        self.0.get_group(&AllocationOrders::TABLE, &Self::known_tags().get()).map(Instances::from)
89    }
90
91    /// The instances of the `NoExecs` (124) group.
92    #[doc(alias = "NoExecs")]
93    pub fn execs(&self) -> Result<Instances<'_, AllocationExecs<'_>>, InvalidValue> {
94        self.0.get_group(&AllocationExecs::TABLE, &Self::known_tags().get()).map(Instances::from)
95    }
96
97    /// The `Side` (54) field.
98    #[doc(alias = "Side")]
99    pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
100        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
101    }
102
103    /// The `Symbol` (55) field.
104    #[doc(alias = "Symbol")]
105    pub fn symbol(&self) -> Result<Option<&str>, InvalidValue> {
106        self.0.get_str(Tag(55))
107    }
108
109    /// The `SymbolSfx` (65) field.
110    #[doc(alias = "SymbolSfx")]
111    pub fn symbol_sfx(&self) -> Result<Option<&str>, InvalidValue> {
112        self.0.get_str(Tag(65))
113    }
114
115    /// The `SecurityID` (48) field.
116    #[doc(alias = "SecurityID")]
117    pub fn security_id(&self) -> Result<Option<&str>, InvalidValue> {
118        self.0.get_str(Tag(48))
119    }
120
121    /// The `IDSource` (22) field.
122    #[doc(alias = "IDSource")]
123    pub fn id_source(&self) -> Result<Option<IDSource<'_>>, InvalidValue> {
124        Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
125    }
126
127    /// The `SecurityType` (167) field.
128    #[doc(alias = "SecurityType")]
129    pub fn security_type(&self) -> Result<Option<SecurityType<'_>>, InvalidValue> {
130        Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
131    }
132
133    /// The `MaturityMonthYear` (200) field.
134    #[doc(alias = "MaturityMonthYear")]
135    pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
136        self.0.get_month_year(Tag(200))
137    }
138
139    /// The `MaturityDay` (205) field.
140    #[doc(alias = "MaturityDay")]
141    pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
142        self.0.get_int(Tag(205))
143    }
144
145    /// The `PutOrCall` (201) field.
146    #[doc(alias = "PutOrCall")]
147    pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
148        Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
149    }
150
151    /// The `StrikePrice` (202) field.
152    #[doc(alias = "StrikePrice")]
153    pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
154        self.0.get_decimal(Tag(202))
155    }
156
157    /// The `OptAttribute` (206) field.
158    #[doc(alias = "OptAttribute")]
159    pub fn opt_attribute(&self) -> Result<Option<&str>, InvalidValue> {
160        self.0.get_str(Tag(206))
161    }
162
163    /// The `ContractMultiplier` (231) field.
164    #[doc(alias = "ContractMultiplier")]
165    pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
166        self.0.get_decimal(Tag(231))
167    }
168
169    /// The `CouponRate` (223) field.
170    #[doc(alias = "CouponRate")]
171    pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
172        self.0.get_decimal(Tag(223))
173    }
174
175    /// The `SecurityExchange` (207) field.
176    #[doc(alias = "SecurityExchange")]
177    pub fn security_exchange(&self) -> Result<Option<&str>, InvalidValue> {
178        self.0.get_str(Tag(207))
179    }
180
181    /// The `Issuer` (106) field.
182    #[doc(alias = "Issuer")]
183    pub fn issuer(&self) -> Result<Option<&str>, InvalidValue> {
184        self.0.get_str(Tag(106))
185    }
186
187    /// The `EncodedIssuerLen` (348) field.
188    #[doc(alias = "EncodedIssuerLen")]
189    pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
190        self.0.get_int(Tag(348))
191    }
192
193    /// The `EncodedIssuer` (349) field.
194    #[doc(alias = "EncodedIssuer")]
195    pub fn encoded_issuer(&self) -> Option<&[u8]> {
196        self.0.get(Tag(349))
197    }
198
199    /// The `SecurityDesc` (107) field.
200    #[doc(alias = "SecurityDesc")]
201    pub fn security_desc(&self) -> Result<Option<&str>, InvalidValue> {
202        self.0.get_str(Tag(107))
203    }
204
205    /// The `EncodedSecurityDescLen` (350) field.
206    #[doc(alias = "EncodedSecurityDescLen")]
207    pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
208        self.0.get_int(Tag(350))
209    }
210
211    /// The `EncodedSecurityDesc` (351) field.
212    #[doc(alias = "EncodedSecurityDesc")]
213    pub fn encoded_security_desc(&self) -> Option<&[u8]> {
214        self.0.get(Tag(351))
215    }
216
217    /// The `Shares` (53) field.
218    #[doc(alias = "Shares")]
219    pub fn shares(&self) -> Result<Option<Decimal>, InvalidValue> {
220        self.0.get_decimal(Tag(53))
221    }
222
223    /// The `LastMkt` (30) field.
224    #[doc(alias = "LastMkt")]
225    pub fn last_mkt(&self) -> Result<Option<&str>, InvalidValue> {
226        self.0.get_str(Tag(30))
227    }
228
229    /// The `TradingSessionID` (336) field.
230    #[doc(alias = "TradingSessionID")]
231    pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
232        self.0.get_str(Tag(336))
233    }
234
235    /// The `AvgPx` (6) field.
236    #[doc(alias = "AvgPx")]
237    pub fn avg_px(&self) -> Result<Option<Decimal>, InvalidValue> {
238        self.0.get_decimal(Tag(6))
239    }
240
241    /// The `Currency` (15) field.
242    #[doc(alias = "Currency")]
243    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
244        self.0.get_str(Tag(15))
245    }
246
247    /// The `AvgPrxPrecision` (74) field.
248    #[doc(alias = "AvgPrxPrecision")]
249    pub fn avg_prx_precision(&self) -> Result<Option<i64>, InvalidValue> {
250        self.0.get_int(Tag(74))
251    }
252
253    /// The `TradeDate` (75) field.
254    #[doc(alias = "TradeDate")]
255    pub fn trade_date(&self) -> Result<Option<Date>, InvalidValue> {
256        self.0.get_date(Tag(75))
257    }
258
259    /// The `TransactTime` (60) field.
260    #[doc(alias = "TransactTime")]
261    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
262        self.0.get_utc_timestamp(Tag(60))
263    }
264
265    /// The `SettlmntTyp` (63) field.
266    #[doc(alias = "SettlmntTyp")]
267    pub fn settlmnt_typ(&self) -> Result<Option<SettlmntTyp<'_>>, InvalidValue> {
268        Ok(self.0.get_str(Tag(63))?.map(SettlmntTyp::from_value))
269    }
270
271    /// The `FutSettDate` (64) field.
272    #[doc(alias = "FutSettDate")]
273    pub fn fut_sett_date(&self) -> Result<Option<Date>, InvalidValue> {
274        self.0.get_date(Tag(64))
275    }
276
277    /// The `GrossTradeAmt` (381) field.
278    #[doc(alias = "GrossTradeAmt")]
279    pub fn gross_trade_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
280        self.0.get_decimal(Tag(381))
281    }
282
283    /// The `NetMoney` (118) field.
284    #[doc(alias = "NetMoney")]
285    pub fn net_money(&self) -> Result<Option<Decimal>, InvalidValue> {
286        self.0.get_decimal(Tag(118))
287    }
288
289    /// The `OpenClose` (77) field.
290    #[doc(alias = "OpenClose")]
291    pub fn open_close(&self) -> Result<Option<OpenClose<'_>>, InvalidValue> {
292        Ok(self.0.get_str(Tag(77))?.map(OpenClose::from_value))
293    }
294
295    /// The `Text` (58) field.
296    #[doc(alias = "Text")]
297    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
298        self.0.get_str(Tag(58))
299    }
300
301    /// The `EncodedTextLen` (354) field.
302    #[doc(alias = "EncodedTextLen")]
303    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
304        self.0.get_int(Tag(354))
305    }
306
307    /// The `EncodedText` (355) field.
308    #[doc(alias = "EncodedText")]
309    pub fn encoded_text(&self) -> Option<&[u8]> {
310        self.0.get(Tag(355))
311    }
312
313    /// The `NumDaysInterest` (157) field.
314    #[doc(alias = "NumDaysInterest")]
315    pub fn num_days_interest(&self) -> Result<Option<i64>, InvalidValue> {
316        self.0.get_int(Tag(157))
317    }
318
319    /// The `AccruedInterestRate` (158) field.
320    #[doc(alias = "AccruedInterestRate")]
321    pub fn accrued_interest_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
322        self.0.get_decimal(Tag(158))
323    }
324
325    /// The instances of the `NoAllocs` (78) group.
326    #[doc(alias = "NoAllocs")]
327    pub fn allocs(&self) -> Result<Instances<'_, AllocationAllocs<'_>>, InvalidValue> {
328        self.0.get_group(&AllocationAllocs::TABLE, &Self::known_tags().get()).map(Instances::from)
329    }
330}
331
332impl std::fmt::Debug for Allocation {
333    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
334        write!(f, "Allocation({})", self.0)
335    }
336}
337
338impl std::fmt::Display for Allocation {
339    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
340        std::fmt::Display::fmt(&self.0, f)
341    }
342}
343
344/// An instance of the `NoOrders` (73) group.
345#[derive(Clone, Copy)]
346pub struct AllocationOrders<'a>(refix_message::Scope<'a>);
347
348impl<'a> From<refix_message::Scope<'a>> for AllocationOrders<'a> {
349    fn from(scope: refix_message::Scope<'a>) -> Self {
350        Self(scope)
351    }
352}
353
354impl<'a> AllocationOrders<'a> {
355    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
356        Tag(73),
357        Tag(11),
358        &[Tag(11), Tag(37), Tag(66), Tag(105), Tag(198)],
359        &[],
360    );
361
362    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
363        static TAGS: LazyKnownTags = LazyKnownTags::new(
364            &[Tag(11), Tag(37), Tag(198), Tag(66), Tag(105)],
365            &[],
366        );
367        &TAGS
368    }
369
370    pub fn raw(&self) -> refix_message::Scope<'a> {
371        self.0
372    }
373
374    /// The `ClOrdID` (11) field.
375    #[doc(alias = "ClOrdID")]
376    pub fn cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
377        self.0.get_str(Tag(11))
378    }
379
380    /// The `OrderID` (37) field.
381    #[doc(alias = "OrderID")]
382    pub fn order_id(&self) -> Result<Option<&'a str>, InvalidValue> {
383        self.0.get_str(Tag(37))
384    }
385
386    /// The `SecondaryOrderID` (198) field.
387    #[doc(alias = "SecondaryOrderID")]
388    pub fn secondary_order_id(&self) -> Result<Option<&'a str>, InvalidValue> {
389        self.0.get_str(Tag(198))
390    }
391
392    /// The `ListID` (66) field.
393    #[doc(alias = "ListID")]
394    pub fn list_id(&self) -> Result<Option<&'a str>, InvalidValue> {
395        self.0.get_str(Tag(66))
396    }
397
398    /// The `WaveNo` (105) field.
399    #[doc(alias = "WaveNo")]
400    pub fn wave_no(&self) -> Result<Option<&'a str>, InvalidValue> {
401        self.0.get_str(Tag(105))
402    }
403}
404
405impl std::fmt::Debug for AllocationOrders<'_> {
406    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
407        write!(f, "AllocationOrders({})", self.0)
408    }
409}
410
411/// An instance of the `NoExecs` (124) group.
412#[derive(Clone, Copy)]
413pub struct AllocationExecs<'a>(refix_message::Scope<'a>);
414
415impl<'a> From<refix_message::Scope<'a>> for AllocationExecs<'a> {
416    fn from(scope: refix_message::Scope<'a>) -> Self {
417        Self(scope)
418    }
419}
420
421impl<'a> AllocationExecs<'a> {
422    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
423        Tag(124),
424        Tag(32),
425        &[Tag(17), Tag(29), Tag(31), Tag(32)],
426        &[],
427    );
428
429    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
430        static TAGS: LazyKnownTags = LazyKnownTags::new(
431            &[Tag(32), Tag(17), Tag(31), Tag(29)],
432            &[],
433        );
434        &TAGS
435    }
436
437    pub fn raw(&self) -> refix_message::Scope<'a> {
438        self.0
439    }
440
441    /// The `LastShares` (32) field.
442    #[doc(alias = "LastShares")]
443    pub fn last_shares(&self) -> Result<Option<Decimal>, InvalidValue> {
444        self.0.get_decimal(Tag(32))
445    }
446
447    /// The `ExecID` (17) field.
448    #[doc(alias = "ExecID")]
449    pub fn exec_id(&self) -> Result<Option<&'a str>, InvalidValue> {
450        self.0.get_str(Tag(17))
451    }
452
453    /// The `LastPx` (31) field.
454    #[doc(alias = "LastPx")]
455    pub fn last_px(&self) -> Result<Option<Decimal>, InvalidValue> {
456        self.0.get_decimal(Tag(31))
457    }
458
459    /// The `LastCapacity` (29) field.
460    #[doc(alias = "LastCapacity")]
461    pub fn last_capacity(&self) -> Result<Option<LastCapacity<'a>>, InvalidValue> {
462        Ok(self.0.get_str(Tag(29))?.map(LastCapacity::from_value))
463    }
464}
465
466impl std::fmt::Debug for AllocationExecs<'_> {
467    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
468        write!(f, "AllocationExecs({})", self.0)
469    }
470}
471
472/// An instance of the `NoAllocs` (78) group.
473#[derive(Clone, Copy)]
474pub struct AllocationAllocs<'a>(refix_message::Scope<'a>);
475
476impl<'a> From<refix_message::Scope<'a>> for AllocationAllocs<'a> {
477    fn from(scope: refix_message::Scope<'a>) -> Self {
478        Self(scope)
479    }
480}
481
482impl<'a> AllocationAllocs<'a> {
483    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
484        Tag(78),
485        Tag(79),
486        &[
487            Tag(12), Tag(13), Tag(76), Tag(79), Tag(80), Tag(81), Tag(92), Tag(109), Tag(119),
488            Tag(120), Tag(136), Tag(153), Tag(154), Tag(155), Tag(156), Tag(159), Tag(160),
489            Tag(161), Tag(208), Tag(209), Tag(360), Tag(361), Tag(366),
490        ],
491        &[AllocationAllocsMiscFees::TABLE],
492    );
493
494    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
495        static TAGS: LazyKnownTags = LazyKnownTags::new(
496            &[
497                Tag(79), Tag(366), Tag(80), Tag(81), Tag(92), Tag(208), Tag(209), Tag(161),
498                Tag(360), Tag(361), Tag(76), Tag(109), Tag(12), Tag(13), Tag(153), Tag(154),
499                Tag(119), Tag(120), Tag(155), Tag(156), Tag(159), Tag(160), Tag(136),
500            ],
501            &[AllocationAllocsMiscFees::known_tags()],
502        );
503        &TAGS
504    }
505
506    pub fn raw(&self) -> refix_message::Scope<'a> {
507        self.0
508    }
509
510    /// The `AllocAccount` (79) field.
511    #[doc(alias = "AllocAccount")]
512    pub fn alloc_account(&self) -> Result<Option<&'a str>, InvalidValue> {
513        self.0.get_str(Tag(79))
514    }
515
516    /// The `AllocPrice` (366) field.
517    #[doc(alias = "AllocPrice")]
518    pub fn alloc_price(&self) -> Result<Option<Decimal>, InvalidValue> {
519        self.0.get_decimal(Tag(366))
520    }
521
522    /// The `AllocShares` (80) field.
523    #[doc(alias = "AllocShares")]
524    pub fn alloc_shares(&self) -> Result<Option<Decimal>, InvalidValue> {
525        self.0.get_decimal(Tag(80))
526    }
527
528    /// The `ProcessCode` (81) field.
529    #[doc(alias = "ProcessCode")]
530    pub fn process_code(&self) -> Result<Option<ProcessCode<'a>>, InvalidValue> {
531        Ok(self.0.get_str(Tag(81))?.map(ProcessCode::from_value))
532    }
533
534    /// The `BrokerOfCredit` (92) field.
535    #[doc(alias = "BrokerOfCredit")]
536    pub fn broker_of_credit(&self) -> Result<Option<&'a str>, InvalidValue> {
537        self.0.get_str(Tag(92))
538    }
539
540    /// The `NotifyBrokerOfCredit` (208) field.
541    #[doc(alias = "NotifyBrokerOfCredit")]
542    pub fn notify_broker_of_credit(&self) -> Result<Option<bool>, InvalidValue> {
543        self.0.get_bool(Tag(208))
544    }
545
546    /// The `AllocHandlInst` (209) field.
547    #[doc(alias = "AllocHandlInst")]
548    pub fn alloc_handl_inst(&self) -> Result<Option<AllocHandlInst>, InvalidValue> {
549        Ok(self.0.get_int(Tag(209))?.map(AllocHandlInst::from_value))
550    }
551
552    /// The `AllocText` (161) field.
553    #[doc(alias = "AllocText")]
554    pub fn alloc_text(&self) -> Result<Option<&'a str>, InvalidValue> {
555        self.0.get_str(Tag(161))
556    }
557
558    /// The `EncodedAllocTextLen` (360) field.
559    #[doc(alias = "EncodedAllocTextLen")]
560    pub fn encoded_alloc_text_len(&self) -> Result<Option<i64>, InvalidValue> {
561        self.0.get_int(Tag(360))
562    }
563
564    /// The `EncodedAllocText` (361) field.
565    #[doc(alias = "EncodedAllocText")]
566    pub fn encoded_alloc_text(&self) -> Option<&'a [u8]> {
567        self.0.get(Tag(361))
568    }
569
570    /// The `ExecBroker` (76) field.
571    #[doc(alias = "ExecBroker")]
572    pub fn exec_broker(&self) -> Result<Option<&'a str>, InvalidValue> {
573        self.0.get_str(Tag(76))
574    }
575
576    /// The `ClientID` (109) field.
577    #[doc(alias = "ClientID")]
578    pub fn client_id(&self) -> Result<Option<&'a str>, InvalidValue> {
579        self.0.get_str(Tag(109))
580    }
581
582    /// The `Commission` (12) field.
583    #[doc(alias = "Commission")]
584    pub fn commission(&self) -> Result<Option<Decimal>, InvalidValue> {
585        self.0.get_decimal(Tag(12))
586    }
587
588    /// The `CommType` (13) field.
589    #[doc(alias = "CommType")]
590    pub fn comm_type(&self) -> Result<Option<CommType<'a>>, InvalidValue> {
591        Ok(self.0.get_str(Tag(13))?.map(CommType::from_value))
592    }
593
594    /// The `AllocAvgPx` (153) field.
595    #[doc(alias = "AllocAvgPx")]
596    pub fn alloc_avg_px(&self) -> Result<Option<Decimal>, InvalidValue> {
597        self.0.get_decimal(Tag(153))
598    }
599
600    /// The `AllocNetMoney` (154) field.
601    #[doc(alias = "AllocNetMoney")]
602    pub fn alloc_net_money(&self) -> Result<Option<Decimal>, InvalidValue> {
603        self.0.get_decimal(Tag(154))
604    }
605
606    /// The `SettlCurrAmt` (119) field.
607    #[doc(alias = "SettlCurrAmt")]
608    pub fn settl_curr_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
609        self.0.get_decimal(Tag(119))
610    }
611
612    /// The `SettlCurrency` (120) field.
613    #[doc(alias = "SettlCurrency")]
614    pub fn settl_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
615        self.0.get_str(Tag(120))
616    }
617
618    /// The `SettlCurrFxRate` (155) field.
619    #[doc(alias = "SettlCurrFxRate")]
620    pub fn settl_curr_fx_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
621        self.0.get_decimal(Tag(155))
622    }
623
624    /// The `SettlCurrFxRateCalc` (156) field.
625    #[doc(alias = "SettlCurrFxRateCalc")]
626    pub fn settl_curr_fx_rate_calc(&self) -> Result<Option<&'a str>, InvalidValue> {
627        self.0.get_str(Tag(156))
628    }
629
630    /// The `AccruedInterestAmt` (159) field.
631    #[doc(alias = "AccruedInterestAmt")]
632    pub fn accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
633        self.0.get_decimal(Tag(159))
634    }
635
636    /// The `SettlInstMode` (160) field.
637    #[doc(alias = "SettlInstMode")]
638    pub fn settl_inst_mode(&self) -> Result<Option<SettlInstMode<'a>>, InvalidValue> {
639        Ok(self.0.get_str(Tag(160))?.map(SettlInstMode::from_value))
640    }
641
642    /// The instances of the `NoMiscFees` (136) group.
643    #[doc(alias = "NoMiscFees")]
644    pub fn misc_fees(&self) -> Result<Instances<'a, AllocationAllocsMiscFees<'a>>, InvalidValue> {
645        self.0.get_group(&AllocationAllocsMiscFees::TABLE, &Self::known_tags().get()).map(Instances::from)
646    }
647}
648
649impl std::fmt::Debug for AllocationAllocs<'_> {
650    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
651        write!(f, "AllocationAllocs({})", self.0)
652    }
653}
654
655/// An instance of the `NoMiscFees` (136) group.
656#[derive(Clone, Copy)]
657pub struct AllocationAllocsMiscFees<'a>(refix_message::Scope<'a>);
658
659impl<'a> From<refix_message::Scope<'a>> for AllocationAllocsMiscFees<'a> {
660    fn from(scope: refix_message::Scope<'a>) -> Self {
661        Self(scope)
662    }
663}
664
665impl<'a> AllocationAllocsMiscFees<'a> {
666    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
667        Tag(136),
668        Tag(137),
669        &[Tag(137), Tag(138), Tag(139)],
670        &[],
671    );
672
673    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
674        static TAGS: LazyKnownTags = LazyKnownTags::new(&[Tag(137), Tag(138), Tag(139)], &[]);
675        &TAGS
676    }
677
678    pub fn raw(&self) -> refix_message::Scope<'a> {
679        self.0
680    }
681
682    /// The `MiscFeeAmt` (137) field.
683    #[doc(alias = "MiscFeeAmt")]
684    pub fn misc_fee_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
685        self.0.get_decimal(Tag(137))
686    }
687
688    /// The `MiscFeeCurr` (138) field.
689    #[doc(alias = "MiscFeeCurr")]
690    pub fn misc_fee_curr(&self) -> Result<Option<&'a str>, InvalidValue> {
691        self.0.get_str(Tag(138))
692    }
693
694    /// The `MiscFeeType` (139) field.
695    #[doc(alias = "MiscFeeType")]
696    pub fn misc_fee_type(&self) -> Result<Option<MiscFeeType<'a>>, InvalidValue> {
697        Ok(self.0.get_str(Tag(139))?.map(MiscFeeType::from_value))
698    }
699}
700
701impl std::fmt::Debug for AllocationAllocsMiscFees<'_> {
702    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
703        write!(f, "AllocationAllocsMiscFees({})", self.0)
704    }
705}