Skip to main content

refix_fix44/generated/messages/
trade_capture_report.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, Instances, InvalidValue, LazyKnownTags, RawMessage, Tag, UtcTimestamp,
6};
7
8use super::super::components::{
9    FinancingDetails, Header, Instrument, OrderQtyData, PositionAmountData,
10    SpreadOrBenchmarkCurveData, Trailer, TrdCapRptSideGrp, TrdInstrmtLegGrp, TrdRegTimestamps,
11    UndInstrmtGrp, YieldData,
12};
13use super::super::enums::{
14    AvgPxIndicator, ExecRestatementReason, ExecType, MatchStatus, MatchType, MultiLegReportingType,
15    OrdStatus, PriceType, QtyType, SettlType, ShortSaleReason, SubscriptionRequestType,
16    TradeReportType, TrdType,
17};
18
19/// The `TradeCaptureReport` (35=AE) message.
20pub struct TradeCaptureReport(RawMessage);
21
22impl TradeCaptureReport {
23    pub const MSG_TYPE: &[u8] = b"AE";
24
25    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
26        static TAGS: LazyKnownTags = LazyKnownTags::new(
27            &[
28                Tag(571), Tag(487), Tag(856), Tag(568), Tag(828), Tag(829), Tag(855), Tag(830),
29                Tag(150), Tag(748), Tag(912), Tag(325), Tag(263), Tag(572), Tag(881), Tag(818),
30                Tag(820), Tag(880), Tag(17), Tag(39), Tag(527), Tag(378), Tag(570), Tag(423),
31                Tag(854), Tag(711), Tag(822), Tag(823), Tag(32), Tag(31), Tag(669), Tag(194),
32                Tag(195), Tag(30), Tag(75), Tag(715), Tag(6), Tag(819), Tag(753), Tag(442),
33                Tag(824), Tag(555), Tag(60), Tag(768), Tag(63), Tag(64), Tag(573), Tag(574),
34                Tag(552), Tag(797), Tag(852), Tag(853),
35            ],
36            &[
37                Header::known_tags(), Trailer::known_tags(), Instrument::known_tags(),
38                FinancingDetails::known_tags(), OrderQtyData::known_tags(), YieldData::known_tags(),
39                UndInstrmtGrp::known_tags(), SpreadOrBenchmarkCurveData::known_tags(),
40                PositionAmountData::known_tags(), TrdInstrmtLegGrp::known_tags(),
41                TrdRegTimestamps::known_tags(), TrdCapRptSideGrp::known_tags(),
42            ],
43        );
44        &TAGS
45    }
46
47    pub fn from_raw(raw: RawMessage) -> Self {
48        Self(raw)
49    }
50
51    pub fn raw(&self) -> &RawMessage {
52        &self.0
53    }
54
55    pub fn header(&self) -> Header<'_> {
56        Header(self.0.scope(), Self::known_tags().get())
57    }
58
59    pub fn trailer(&self) -> Trailer<'_> {
60        Trailer(self.0.scope())
61    }
62
63    /// The `TradeReportID` (571) field.
64    #[doc(alias = "TradeReportID")]
65    pub fn trade_report_id(&self) -> Result<Option<&str>, InvalidValue> {
66        self.0.get_str(Tag(571))
67    }
68
69    /// The `TradeReportTransType` (487) field.
70    #[doc(alias = "TradeReportTransType")]
71    pub fn trade_report_trans_type(&self) -> Result<Option<i64>, InvalidValue> {
72        self.0.get_int(Tag(487))
73    }
74
75    /// The `TradeReportType` (856) field.
76    #[doc(alias = "TradeReportType")]
77    pub fn trade_report_type(&self) -> Result<Option<TradeReportType>, InvalidValue> {
78        Ok(self.0.get_int(Tag(856))?.map(TradeReportType::from_value))
79    }
80
81    /// The `TradeRequestID` (568) field.
82    #[doc(alias = "TradeRequestID")]
83    pub fn trade_request_id(&self) -> Result<Option<&str>, InvalidValue> {
84        self.0.get_str(Tag(568))
85    }
86
87    /// The `TrdType` (828) field.
88    #[doc(alias = "TrdType")]
89    pub fn trd_type(&self) -> Result<Option<TrdType>, InvalidValue> {
90        Ok(self.0.get_int(Tag(828))?.map(TrdType::from_value))
91    }
92
93    /// The `TrdSubType` (829) field.
94    #[doc(alias = "TrdSubType")]
95    pub fn trd_sub_type(&self) -> Result<Option<i64>, InvalidValue> {
96        self.0.get_int(Tag(829))
97    }
98
99    /// The `SecondaryTrdType` (855) field.
100    #[doc(alias = "SecondaryTrdType")]
101    pub fn secondary_trd_type(&self) -> Result<Option<i64>, InvalidValue> {
102        self.0.get_int(Tag(855))
103    }
104
105    /// The `TransferReason` (830) field.
106    #[doc(alias = "TransferReason")]
107    pub fn transfer_reason(&self) -> Result<Option<&str>, InvalidValue> {
108        self.0.get_str(Tag(830))
109    }
110
111    /// The `ExecType` (150) field.
112    #[doc(alias = "ExecType")]
113    pub fn exec_type(&self) -> Result<Option<ExecType<'_>>, InvalidValue> {
114        Ok(self.0.get_str(Tag(150))?.map(ExecType::from_value))
115    }
116
117    /// The `TotNumTradeReports` (748) field.
118    #[doc(alias = "TotNumTradeReports")]
119    pub fn tot_num_trade_reports(&self) -> Result<Option<i64>, InvalidValue> {
120        self.0.get_int(Tag(748))
121    }
122
123    /// The `LastRptRequested` (912) field.
124    #[doc(alias = "LastRptRequested")]
125    pub fn last_rpt_requested(&self) -> Result<Option<bool>, InvalidValue> {
126        self.0.get_bool(Tag(912))
127    }
128
129    /// The `UnsolicitedIndicator` (325) field.
130    #[doc(alias = "UnsolicitedIndicator")]
131    pub fn unsolicited_indicator(&self) -> Result<Option<bool>, InvalidValue> {
132        self.0.get_bool(Tag(325))
133    }
134
135    /// The `SubscriptionRequestType` (263) field.
136    #[doc(alias = "SubscriptionRequestType")]
137    pub fn subscription_request_type(&self) -> Result<Option<SubscriptionRequestType<'_>>, InvalidValue> {
138        Ok(self.0.get_str(Tag(263))?.map(SubscriptionRequestType::from_value))
139    }
140
141    /// The `TradeReportRefID` (572) field.
142    #[doc(alias = "TradeReportRefID")]
143    pub fn trade_report_ref_id(&self) -> Result<Option<&str>, InvalidValue> {
144        self.0.get_str(Tag(572))
145    }
146
147    /// The `SecondaryTradeReportRefID` (881) field.
148    #[doc(alias = "SecondaryTradeReportRefID")]
149    pub fn secondary_trade_report_ref_id(&self) -> Result<Option<&str>, InvalidValue> {
150        self.0.get_str(Tag(881))
151    }
152
153    /// The `SecondaryTradeReportID` (818) field.
154    #[doc(alias = "SecondaryTradeReportID")]
155    pub fn secondary_trade_report_id(&self) -> Result<Option<&str>, InvalidValue> {
156        self.0.get_str(Tag(818))
157    }
158
159    /// The `TradeLinkID` (820) field.
160    #[doc(alias = "TradeLinkID")]
161    pub fn trade_link_id(&self) -> Result<Option<&str>, InvalidValue> {
162        self.0.get_str(Tag(820))
163    }
164
165    /// The `TrdMatchID` (880) field.
166    #[doc(alias = "TrdMatchID")]
167    pub fn trd_match_id(&self) -> Result<Option<&str>, InvalidValue> {
168        self.0.get_str(Tag(880))
169    }
170
171    /// The `ExecID` (17) field.
172    #[doc(alias = "ExecID")]
173    pub fn exec_id(&self) -> Result<Option<&str>, InvalidValue> {
174        self.0.get_str(Tag(17))
175    }
176
177    /// The `OrdStatus` (39) field.
178    #[doc(alias = "OrdStatus")]
179    pub fn ord_status(&self) -> Result<Option<OrdStatus<'_>>, InvalidValue> {
180        Ok(self.0.get_str(Tag(39))?.map(OrdStatus::from_value))
181    }
182
183    /// The `SecondaryExecID` (527) field.
184    #[doc(alias = "SecondaryExecID")]
185    pub fn secondary_exec_id(&self) -> Result<Option<&str>, InvalidValue> {
186        self.0.get_str(Tag(527))
187    }
188
189    /// The `ExecRestatementReason` (378) field.
190    #[doc(alias = "ExecRestatementReason")]
191    pub fn exec_restatement_reason(&self) -> Result<Option<ExecRestatementReason>, InvalidValue> {
192        Ok(self.0.get_int(Tag(378))?.map(ExecRestatementReason::from_value))
193    }
194
195    /// The `PreviouslyReported` (570) field.
196    #[doc(alias = "PreviouslyReported")]
197    pub fn previously_reported(&self) -> Result<Option<bool>, InvalidValue> {
198        self.0.get_bool(Tag(570))
199    }
200
201    /// The `PriceType` (423) field.
202    #[doc(alias = "PriceType")]
203    pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
204        Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
205    }
206
207    /// The `Instrument` component.
208    pub fn instrument(&self) -> Instrument<'_> {
209        Instrument(self.0.scope(), Self::known_tags().get())
210    }
211
212    /// The `FinancingDetails` component.
213    pub fn financing_details(&self) -> FinancingDetails<'_> {
214        FinancingDetails(self.0.scope())
215    }
216
217    /// The `OrderQtyData` component.
218    pub fn order_qty_data(&self) -> OrderQtyData<'_> {
219        OrderQtyData(self.0.scope())
220    }
221
222    /// The `QtyType` (854) field.
223    #[doc(alias = "QtyType")]
224    pub fn qty_type(&self) -> Result<Option<QtyType>, InvalidValue> {
225        Ok(self.0.get_int(Tag(854))?.map(QtyType::from_value))
226    }
227
228    /// The `YieldData` component.
229    pub fn yield_data(&self) -> YieldData<'_> {
230        YieldData(self.0.scope())
231    }
232
233    /// The instances of the `NoUnderlyings` (711) group.
234    #[doc(alias = "NoUnderlyings")]
235    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
236        self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
237    }
238
239    /// The `UnderlyingTradingSessionID` (822) field.
240    #[doc(alias = "UnderlyingTradingSessionID")]
241    pub fn underlying_trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
242        self.0.get_str(Tag(822))
243    }
244
245    /// The `UnderlyingTradingSessionSubID` (823) field.
246    #[doc(alias = "UnderlyingTradingSessionSubID")]
247    pub fn underlying_trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
248        self.0.get_str(Tag(823))
249    }
250
251    /// The `LastQty` (32) field.
252    #[doc(alias = "LastQty")]
253    pub fn last_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
254        self.0.get_decimal(Tag(32))
255    }
256
257    /// The `LastPx` (31) field.
258    #[doc(alias = "LastPx")]
259    pub fn last_px(&self) -> Result<Option<Decimal>, InvalidValue> {
260        self.0.get_decimal(Tag(31))
261    }
262
263    /// The `LastParPx` (669) field.
264    #[doc(alias = "LastParPx")]
265    pub fn last_par_px(&self) -> Result<Option<Decimal>, InvalidValue> {
266        self.0.get_decimal(Tag(669))
267    }
268
269    /// The `LastSpotRate` (194) field.
270    #[doc(alias = "LastSpotRate")]
271    pub fn last_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
272        self.0.get_decimal(Tag(194))
273    }
274
275    /// The `LastForwardPoints` (195) field.
276    #[doc(alias = "LastForwardPoints")]
277    pub fn last_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
278        self.0.get_decimal(Tag(195))
279    }
280
281    /// The `LastMkt` (30) field.
282    #[doc(alias = "LastMkt")]
283    pub fn last_mkt(&self) -> Result<Option<&str>, InvalidValue> {
284        self.0.get_str(Tag(30))
285    }
286
287    /// The `TradeDate` (75) field.
288    #[doc(alias = "TradeDate")]
289    pub fn trade_date(&self) -> Result<Option<Date>, InvalidValue> {
290        self.0.get_date(Tag(75))
291    }
292
293    /// The `ClearingBusinessDate` (715) field.
294    #[doc(alias = "ClearingBusinessDate")]
295    pub fn clearing_business_date(&self) -> Result<Option<Date>, InvalidValue> {
296        self.0.get_date(Tag(715))
297    }
298
299    /// The `AvgPx` (6) field.
300    #[doc(alias = "AvgPx")]
301    pub fn avg_px(&self) -> Result<Option<Decimal>, InvalidValue> {
302        self.0.get_decimal(Tag(6))
303    }
304
305    /// The `SpreadOrBenchmarkCurveData` component.
306    pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'_> {
307        SpreadOrBenchmarkCurveData(self.0.scope())
308    }
309
310    /// The `AvgPxIndicator` (819) field.
311    #[doc(alias = "AvgPxIndicator")]
312    pub fn avg_px_indicator(&self) -> Result<Option<AvgPxIndicator>, InvalidValue> {
313        Ok(self.0.get_int(Tag(819))?.map(AvgPxIndicator::from_value))
314    }
315
316    /// The instances of the `NoPosAmt` (753) group.
317    #[doc(alias = "NoPosAmt")]
318    pub fn pos_amt(&self) -> Result<Instances<'_, PositionAmountData<'_>>, InvalidValue> {
319        self.0.get_group(&PositionAmountData::TABLE, &Self::known_tags().get()).map(Instances::from)
320    }
321
322    /// The `MultiLegReportingType` (442) field.
323    #[doc(alias = "MultiLegReportingType")]
324    pub fn multi_leg_reporting_type(&self) -> Result<Option<MultiLegReportingType<'_>>, InvalidValue> {
325        Ok(self.0.get_str(Tag(442))?.map(MultiLegReportingType::from_value))
326    }
327
328    /// The `TradeLegRefID` (824) field.
329    #[doc(alias = "TradeLegRefID")]
330    pub fn trade_leg_ref_id(&self) -> Result<Option<&str>, InvalidValue> {
331        self.0.get_str(Tag(824))
332    }
333
334    /// The instances of the `NoLegs` (555) group.
335    #[doc(alias = "NoLegs")]
336    pub fn legs(&self) -> Result<Instances<'_, TrdInstrmtLegGrp<'_>>, InvalidValue> {
337        self.0.get_group(&TrdInstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
338    }
339
340    /// The `TransactTime` (60) field.
341    #[doc(alias = "TransactTime")]
342    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
343        self.0.get_utc_timestamp(Tag(60))
344    }
345
346    /// The instances of the `NoTrdRegTimestamps` (768) group.
347    #[doc(alias = "NoTrdRegTimestamps")]
348    pub fn trd_reg_timestamps(&self) -> Result<Instances<'_, TrdRegTimestamps<'_>>, InvalidValue> {
349        self.0.get_group(&TrdRegTimestamps::TABLE, &Self::known_tags().get()).map(Instances::from)
350    }
351
352    /// The `SettlType` (63) field.
353    #[doc(alias = "SettlType")]
354    pub fn settl_type(&self) -> Result<Option<SettlType<'_>>, InvalidValue> {
355        Ok(self.0.get_str(Tag(63))?.map(SettlType::from_value))
356    }
357
358    /// The `SettlDate` (64) field.
359    #[doc(alias = "SettlDate")]
360    pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
361        self.0.get_date(Tag(64))
362    }
363
364    /// The `MatchStatus` (573) field.
365    #[doc(alias = "MatchStatus")]
366    pub fn match_status(&self) -> Result<Option<MatchStatus<'_>>, InvalidValue> {
367        Ok(self.0.get_str(Tag(573))?.map(MatchStatus::from_value))
368    }
369
370    /// The `MatchType` (574) field.
371    #[doc(alias = "MatchType")]
372    pub fn match_type(&self) -> Result<Option<MatchType<'_>>, InvalidValue> {
373        Ok(self.0.get_str(Tag(574))?.map(MatchType::from_value))
374    }
375
376    /// The instances of the `NoSides` (552) group.
377    #[doc(alias = "NoSides")]
378    pub fn sides(&self) -> Result<Instances<'_, TrdCapRptSideGrp<'_>>, InvalidValue> {
379        self.0.get_group(&TrdCapRptSideGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
380    }
381
382    /// The `CopyMsgIndicator` (797) field.
383    #[doc(alias = "CopyMsgIndicator")]
384    pub fn copy_msg_indicator(&self) -> Result<Option<bool>, InvalidValue> {
385        self.0.get_bool(Tag(797))
386    }
387
388    /// The `PublishTrdIndicator` (852) field.
389    #[doc(alias = "PublishTrdIndicator")]
390    pub fn publish_trd_indicator(&self) -> Result<Option<bool>, InvalidValue> {
391        self.0.get_bool(Tag(852))
392    }
393
394    /// The `ShortSaleReason` (853) field.
395    #[doc(alias = "ShortSaleReason")]
396    pub fn short_sale_reason(&self) -> Result<Option<ShortSaleReason>, InvalidValue> {
397        Ok(self.0.get_int(Tag(853))?.map(ShortSaleReason::from_value))
398    }
399}
400
401impl std::fmt::Debug for TradeCaptureReport {
402    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
403        write!(f, "TradeCaptureReport({})", self.0)
404    }
405}
406
407impl std::fmt::Display for TradeCaptureReport {
408    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
409        std::fmt::Display::fmt(&self.0, f)
410    }
411}