Skip to main content

refix_fix44/generated/components/
trd_cap_rpt_side_grp.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5    Date, Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, MultipleValues, Tag,
6    UtcTimestamp,
7};
8
9use super::super::enums::{
10    AccountType, AcctIDSource, CustOrderCapacity, ExecInst, OrdType, OrderCapacity,
11    OrderRestrictions, PositionEffect, PreallocMethod, ProcessCode, SettlCurrFxRateCalc, Side,
12    SideMultiLegReportingType, TradeAllocIndicator,
13};
14use super::{
15    ClrInstGrp, CommissionData, ContAmtGrp, MiscFeesGrp, Parties, Stipulations, TrdAllocGrp,
16};
17
18/// An instance of the `NoSides` (552) group.
19#[derive(Clone, Copy)]
20pub struct TrdCapRptSideGrp<'a>(refix_message::Scope<'a>);
21
22impl<'a> From<refix_message::Scope<'a>> for TrdCapRptSideGrp<'a> {
23    fn from(scope: refix_message::Scope<'a>) -> Self {
24        Self(scope)
25    }
26}
27
28impl<'a> TrdCapRptSideGrp<'a> {
29    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
30        Tag(552),
31        Tag(54),
32        &[
33            Tag(1), Tag(11), Tag(12), Tag(13), Tag(15), Tag(18), Tag(37), Tag(40), Tag(54), Tag(58),
34            Tag(66), Tag(70), Tag(77), Tag(78), Tag(81), Tag(118), Tag(119), Tag(120), Tag(136),
35            Tag(155), Tag(156), Tag(157), Tag(158), Tag(159), Tag(198), Tag(230), Tag(232),
36            Tag(237), Tag(238), Tag(336), Tag(354), Tag(355), Tag(376), Tag(377), Tag(381),
37            Tag(453), Tag(479), Tag(483), Tag(497), Tag(518), Tag(526), Tag(528), Tag(529),
38            Tag(575), Tag(576), Tag(578), Tag(579), Tag(581), Tag(582), Tag(591), Tag(625),
39            Tag(660), Tag(738), Tag(752), Tag(821), Tag(825), Tag(826), Tag(920), Tag(921),
40            Tag(922), Tag(943),
41        ],
42        &[
43            Parties::TABLE, ClrInstGrp::TABLE, ContAmtGrp::TABLE, Stipulations::TABLE,
44            MiscFeesGrp::TABLE, TrdAllocGrp::TABLE,
45        ],
46    );
47
48    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
49        static TAGS: LazyKnownTags = LazyKnownTags::new(
50            &[
51                Tag(54), Tag(37), Tag(198), Tag(11), Tag(526), Tag(66), Tag(453), Tag(1), Tag(660),
52                Tag(581), Tag(81), Tag(575), Tag(576), Tag(578), Tag(579), Tag(821), Tag(15),
53                Tag(376), Tag(377), Tag(528), Tag(529), Tag(582), Tag(40), Tag(18), Tag(483),
54                Tag(336), Tag(625), Tag(943), Tag(381), Tag(157), Tag(230), Tag(158), Tag(159),
55                Tag(738), Tag(920), Tag(921), Tag(922), Tag(238), Tag(237), Tag(118), Tag(119),
56                Tag(120), Tag(155), Tag(156), Tag(77), Tag(58), Tag(354), Tag(355), Tag(752),
57                Tag(518), Tag(232), Tag(136), Tag(825), Tag(826), Tag(591), Tag(70), Tag(78),
58            ],
59            &[
60                Parties::known_tags(), ClrInstGrp::known_tags(), CommissionData::known_tags(),
61                ContAmtGrp::known_tags(), Stipulations::known_tags(), MiscFeesGrp::known_tags(),
62                TrdAllocGrp::known_tags(),
63            ],
64        );
65        &TAGS
66    }
67
68    pub fn raw(&self) -> refix_message::Scope<'a> {
69        self.0
70    }
71
72    /// The `Side` (54) field.
73    #[doc(alias = "Side")]
74    pub fn side(&self) -> Result<Option<Side<'a>>, InvalidValue> {
75        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
76    }
77
78    /// The `OrderID` (37) field.
79    #[doc(alias = "OrderID")]
80    pub fn order_id(&self) -> Result<Option<&'a str>, InvalidValue> {
81        self.0.get_str(Tag(37))
82    }
83
84    /// The `SecondaryOrderID` (198) field.
85    #[doc(alias = "SecondaryOrderID")]
86    pub fn secondary_order_id(&self) -> Result<Option<&'a str>, InvalidValue> {
87        self.0.get_str(Tag(198))
88    }
89
90    /// The `ClOrdID` (11) field.
91    #[doc(alias = "ClOrdID")]
92    pub fn cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
93        self.0.get_str(Tag(11))
94    }
95
96    /// The `SecondaryClOrdID` (526) field.
97    #[doc(alias = "SecondaryClOrdID")]
98    pub fn secondary_cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
99        self.0.get_str(Tag(526))
100    }
101
102    /// The `ListID` (66) field.
103    #[doc(alias = "ListID")]
104    pub fn list_id(&self) -> Result<Option<&'a str>, InvalidValue> {
105        self.0.get_str(Tag(66))
106    }
107
108    /// The instances of the `NoPartyIDs` (453) group.
109    #[doc(alias = "NoPartyIDs")]
110    pub fn party_ids(&self) -> Result<Instances<'a, Parties<'a>>, InvalidValue> {
111        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
112    }
113
114    /// The `Account` (1) field.
115    #[doc(alias = "Account")]
116    pub fn account(&self) -> Result<Option<&'a str>, InvalidValue> {
117        self.0.get_str(Tag(1))
118    }
119
120    /// The `AcctIDSource` (660) field.
121    #[doc(alias = "AcctIDSource")]
122    pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
123        Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
124    }
125
126    /// The `AccountType` (581) field.
127    #[doc(alias = "AccountType")]
128    pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
129        Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
130    }
131
132    /// The `ProcessCode` (81) field.
133    #[doc(alias = "ProcessCode")]
134    pub fn process_code(&self) -> Result<Option<ProcessCode<'a>>, InvalidValue> {
135        Ok(self.0.get_str(Tag(81))?.map(ProcessCode::from_value))
136    }
137
138    /// The `OddLot` (575) field.
139    #[doc(alias = "OddLot")]
140    pub fn odd_lot(&self) -> Result<Option<bool>, InvalidValue> {
141        self.0.get_bool(Tag(575))
142    }
143
144    /// The instances of the `NoClearingInstructions` (576) group.
145    #[doc(alias = "NoClearingInstructions")]
146    pub fn clearing_instructions(&self) -> Result<Instances<'a, ClrInstGrp<'a>>, InvalidValue> {
147        self.0.get_group(&ClrInstGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
148    }
149
150    /// The `TradeInputSource` (578) field.
151    #[doc(alias = "TradeInputSource")]
152    pub fn trade_input_source(&self) -> Result<Option<&'a str>, InvalidValue> {
153        self.0.get_str(Tag(578))
154    }
155
156    /// The `TradeInputDevice` (579) field.
157    #[doc(alias = "TradeInputDevice")]
158    pub fn trade_input_device(&self) -> Result<Option<&'a str>, InvalidValue> {
159        self.0.get_str(Tag(579))
160    }
161
162    /// The `OrderInputDevice` (821) field.
163    #[doc(alias = "OrderInputDevice")]
164    pub fn order_input_device(&self) -> Result<Option<&'a str>, InvalidValue> {
165        self.0.get_str(Tag(821))
166    }
167
168    /// The `Currency` (15) field.
169    #[doc(alias = "Currency")]
170    pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
171        self.0.get_str(Tag(15))
172    }
173
174    /// The `ComplianceID` (376) field.
175    #[doc(alias = "ComplianceID")]
176    pub fn compliance_id(&self) -> Result<Option<&'a str>, InvalidValue> {
177        self.0.get_str(Tag(376))
178    }
179
180    /// The `SolicitedFlag` (377) field.
181    #[doc(alias = "SolicitedFlag")]
182    pub fn solicited_flag(&self) -> Result<Option<bool>, InvalidValue> {
183        self.0.get_bool(Tag(377))
184    }
185
186    /// The `OrderCapacity` (528) field.
187    #[doc(alias = "OrderCapacity")]
188    pub fn order_capacity(&self) -> Result<Option<OrderCapacity<'a>>, InvalidValue> {
189        Ok(self.0.get_str(Tag(528))?.map(OrderCapacity::from_value))
190    }
191
192    /// The `OrderRestrictions` (529) field.
193    #[doc(alias = "OrderRestrictions")]
194    pub fn order_restrictions(&self) -> Result<Option<MultipleValues<'a, OrderRestrictions<'a>>>, InvalidValue> {
195        self.0.get_multiple_values(Tag(529))
196    }
197
198    /// The `CustOrderCapacity` (582) field.
199    #[doc(alias = "CustOrderCapacity")]
200    pub fn cust_order_capacity(&self) -> Result<Option<CustOrderCapacity>, InvalidValue> {
201        Ok(self.0.get_int(Tag(582))?.map(CustOrderCapacity::from_value))
202    }
203
204    /// The `OrdType` (40) field.
205    #[doc(alias = "OrdType")]
206    pub fn ord_type(&self) -> Result<Option<OrdType<'a>>, InvalidValue> {
207        Ok(self.0.get_str(Tag(40))?.map(OrdType::from_value))
208    }
209
210    /// The `ExecInst` (18) field.
211    #[doc(alias = "ExecInst")]
212    pub fn exec_inst(&self) -> Result<Option<MultipleValues<'a, ExecInst<'a>>>, InvalidValue> {
213        self.0.get_multiple_values(Tag(18))
214    }
215
216    /// The `TransBkdTime` (483) field.
217    #[doc(alias = "TransBkdTime")]
218    pub fn trans_bkd_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
219        self.0.get_utc_timestamp(Tag(483))
220    }
221
222    /// The `TradingSessionID` (336) field.
223    #[doc(alias = "TradingSessionID")]
224    pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
225        self.0.get_str(Tag(336))
226    }
227
228    /// The `TradingSessionSubID` (625) field.
229    #[doc(alias = "TradingSessionSubID")]
230    pub fn trading_session_sub_id(&self) -> Result<Option<&'a str>, InvalidValue> {
231        self.0.get_str(Tag(625))
232    }
233
234    /// The `TimeBracket` (943) field.
235    #[doc(alias = "TimeBracket")]
236    pub fn time_bracket(&self) -> Result<Option<&'a str>, InvalidValue> {
237        self.0.get_str(Tag(943))
238    }
239
240    /// The `CommissionData` component.
241    pub fn commission_data(&self) -> CommissionData<'a> {
242        CommissionData(self.0)
243    }
244
245    /// The `GrossTradeAmt` (381) field.
246    #[doc(alias = "GrossTradeAmt")]
247    pub fn gross_trade_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
248        self.0.get_decimal(Tag(381))
249    }
250
251    /// The `NumDaysInterest` (157) field.
252    #[doc(alias = "NumDaysInterest")]
253    pub fn num_days_interest(&self) -> Result<Option<i64>, InvalidValue> {
254        self.0.get_int(Tag(157))
255    }
256
257    /// The `ExDate` (230) field.
258    #[doc(alias = "ExDate")]
259    pub fn ex_date(&self) -> Result<Option<Date>, InvalidValue> {
260        self.0.get_date(Tag(230))
261    }
262
263    /// The `AccruedInterestRate` (158) field.
264    #[doc(alias = "AccruedInterestRate")]
265    pub fn accrued_interest_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
266        self.0.get_decimal(Tag(158))
267    }
268
269    /// The `AccruedInterestAmt` (159) field.
270    #[doc(alias = "AccruedInterestAmt")]
271    pub fn accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
272        self.0.get_decimal(Tag(159))
273    }
274
275    /// The `InterestAtMaturity` (738) field.
276    #[doc(alias = "InterestAtMaturity")]
277    pub fn interest_at_maturity(&self) -> Result<Option<Decimal>, InvalidValue> {
278        self.0.get_decimal(Tag(738))
279    }
280
281    /// The `EndAccruedInterestAmt` (920) field.
282    #[doc(alias = "EndAccruedInterestAmt")]
283    pub fn end_accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
284        self.0.get_decimal(Tag(920))
285    }
286
287    /// The `StartCash` (921) field.
288    #[doc(alias = "StartCash")]
289    pub fn start_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
290        self.0.get_decimal(Tag(921))
291    }
292
293    /// The `EndCash` (922) field.
294    #[doc(alias = "EndCash")]
295    pub fn end_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
296        self.0.get_decimal(Tag(922))
297    }
298
299    /// The `Concession` (238) field.
300    #[doc(alias = "Concession")]
301    pub fn concession(&self) -> Result<Option<Decimal>, InvalidValue> {
302        self.0.get_decimal(Tag(238))
303    }
304
305    /// The `TotalTakedown` (237) field.
306    #[doc(alias = "TotalTakedown")]
307    pub fn total_takedown(&self) -> Result<Option<Decimal>, InvalidValue> {
308        self.0.get_decimal(Tag(237))
309    }
310
311    /// The `NetMoney` (118) field.
312    #[doc(alias = "NetMoney")]
313    pub fn net_money(&self) -> Result<Option<Decimal>, InvalidValue> {
314        self.0.get_decimal(Tag(118))
315    }
316
317    /// The `SettlCurrAmt` (119) field.
318    #[doc(alias = "SettlCurrAmt")]
319    pub fn settl_curr_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
320        self.0.get_decimal(Tag(119))
321    }
322
323    /// The `SettlCurrency` (120) field.
324    #[doc(alias = "SettlCurrency")]
325    pub fn settl_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
326        self.0.get_str(Tag(120))
327    }
328
329    /// The `SettlCurrFxRate` (155) field.
330    #[doc(alias = "SettlCurrFxRate")]
331    pub fn settl_curr_fx_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
332        self.0.get_decimal(Tag(155))
333    }
334
335    /// The `SettlCurrFxRateCalc` (156) field.
336    #[doc(alias = "SettlCurrFxRateCalc")]
337    pub fn settl_curr_fx_rate_calc(&self) -> Result<Option<SettlCurrFxRateCalc<'a>>, InvalidValue> {
338        Ok(self.0.get_str(Tag(156))?.map(SettlCurrFxRateCalc::from_value))
339    }
340
341    /// The `PositionEffect` (77) field.
342    #[doc(alias = "PositionEffect")]
343    pub fn position_effect(&self) -> Result<Option<PositionEffect<'a>>, InvalidValue> {
344        Ok(self.0.get_str(Tag(77))?.map(PositionEffect::from_value))
345    }
346
347    /// The `Text` (58) field.
348    #[doc(alias = "Text")]
349    pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
350        self.0.get_str(Tag(58))
351    }
352
353    /// The `EncodedTextLen` (354) field.
354    #[doc(alias = "EncodedTextLen")]
355    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
356        self.0.get_int(Tag(354))
357    }
358
359    /// The `EncodedText` (355) field.
360    #[doc(alias = "EncodedText")]
361    pub fn encoded_text(&self) -> Option<&'a [u8]> {
362        self.0.get(Tag(355))
363    }
364
365    /// The `SideMultiLegReportingType` (752) field.
366    #[doc(alias = "SideMultiLegReportingType")]
367    pub fn side_multi_leg_reporting_type(&self) -> Result<Option<SideMultiLegReportingType>, InvalidValue> {
368        Ok(self.0.get_int(Tag(752))?.map(SideMultiLegReportingType::from_value))
369    }
370
371    /// The instances of the `NoContAmts` (518) group.
372    #[doc(alias = "NoContAmts")]
373    pub fn cont_amts(&self) -> Result<Instances<'a, ContAmtGrp<'a>>, InvalidValue> {
374        self.0.get_group(&ContAmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
375    }
376
377    /// The instances of the `NoStipulations` (232) group.
378    #[doc(alias = "NoStipulations")]
379    pub fn stipulations(&self) -> Result<Instances<'a, Stipulations<'a>>, InvalidValue> {
380        self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
381    }
382
383    /// The instances of the `NoMiscFees` (136) group.
384    #[doc(alias = "NoMiscFees")]
385    pub fn misc_fees(&self) -> Result<Instances<'a, MiscFeesGrp<'a>>, InvalidValue> {
386        self.0.get_group(&MiscFeesGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
387    }
388
389    /// The `ExchangeRule` (825) field.
390    #[doc(alias = "ExchangeRule")]
391    pub fn exchange_rule(&self) -> Result<Option<&'a str>, InvalidValue> {
392        self.0.get_str(Tag(825))
393    }
394
395    /// The `TradeAllocIndicator` (826) field.
396    #[doc(alias = "TradeAllocIndicator")]
397    pub fn trade_alloc_indicator(&self) -> Result<Option<TradeAllocIndicator>, InvalidValue> {
398        Ok(self.0.get_int(Tag(826))?.map(TradeAllocIndicator::from_value))
399    }
400
401    /// The `PreallocMethod` (591) field.
402    #[doc(alias = "PreallocMethod")]
403    pub fn prealloc_method(&self) -> Result<Option<PreallocMethod<'a>>, InvalidValue> {
404        Ok(self.0.get_str(Tag(591))?.map(PreallocMethod::from_value))
405    }
406
407    /// The `AllocID` (70) field.
408    #[doc(alias = "AllocID")]
409    pub fn alloc_id(&self) -> Result<Option<&'a str>, InvalidValue> {
410        self.0.get_str(Tag(70))
411    }
412
413    /// The instances of the `NoAllocs` (78) group.
414    #[doc(alias = "NoAllocs")]
415    pub fn allocs(&self) -> Result<Instances<'a, TrdAllocGrp<'a>>, InvalidValue> {
416        self.0.get_group(&TrdAllocGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
417    }
418}
419
420impl std::fmt::Debug for TrdCapRptSideGrp<'_> {
421    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
422        write!(f, "TrdCapRptSideGrp({})", self.0)
423    }
424}