Skip to main content

refix_fix44/generated/messages/
trade_capture_report_request.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Date, Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{
7    FinancingDetails, Header, InstrmtLegGrp, Instrument, InstrumentExtension, Parties, Trailer,
8    TrdCapDtGrp, UndInstrmtGrp,
9};
10use super::super::enums::{
11    ExecType, MatchStatus, MultiLegReportingType, ResponseTransportType, Side,
12    SubscriptionRequestType, TradeRequestType, TrdType,
13};
14
15/// The `TradeCaptureReportRequest` (35=AD) message.
16pub struct TradeCaptureReportRequest(RawMessage);
17
18impl TradeCaptureReportRequest {
19    pub const MSG_TYPE: &[u8] = b"AD";
20
21    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
22        static TAGS: LazyKnownTags = LazyKnownTags::new(
23            &[
24                Tag(568), Tag(569), Tag(263), Tag(571), Tag(818), Tag(17), Tag(150), Tag(37),
25                Tag(11), Tag(573), Tag(828), Tag(829), Tag(830), Tag(855), Tag(820), Tag(880),
26                Tag(453), Tag(711), Tag(555), Tag(580), Tag(715), Tag(336), Tag(625), Tag(943),
27                Tag(54), Tag(442), Tag(578), Tag(579), Tag(725), Tag(726), Tag(58), Tag(354),
28                Tag(355),
29            ],
30            &[
31                Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
32                Instrument::known_tags(), InstrumentExtension::known_tags(),
33                FinancingDetails::known_tags(), UndInstrmtGrp::known_tags(),
34                InstrmtLegGrp::known_tags(), TrdCapDtGrp::known_tags(),
35            ],
36        );
37        &TAGS
38    }
39
40    pub fn from_raw(raw: RawMessage) -> Self {
41        Self(raw)
42    }
43
44    pub fn raw(&self) -> &RawMessage {
45        &self.0
46    }
47
48    pub fn header(&self) -> Header<'_> {
49        Header(self.0.scope(), Self::known_tags().get())
50    }
51
52    pub fn trailer(&self) -> Trailer<'_> {
53        Trailer(self.0.scope())
54    }
55
56    /// The `TradeRequestID` (568) field.
57    #[doc(alias = "TradeRequestID")]
58    pub fn trade_request_id(&self) -> Result<Option<&str>, InvalidValue> {
59        self.0.get_str(Tag(568))
60    }
61
62    /// The `TradeRequestType` (569) field.
63    #[doc(alias = "TradeRequestType")]
64    pub fn trade_request_type(&self) -> Result<Option<TradeRequestType>, InvalidValue> {
65        Ok(self.0.get_int(Tag(569))?.map(TradeRequestType::from_value))
66    }
67
68    /// The `SubscriptionRequestType` (263) field.
69    #[doc(alias = "SubscriptionRequestType")]
70    pub fn subscription_request_type(&self) -> Result<Option<SubscriptionRequestType<'_>>, InvalidValue> {
71        Ok(self.0.get_str(Tag(263))?.map(SubscriptionRequestType::from_value))
72    }
73
74    /// The `TradeReportID` (571) field.
75    #[doc(alias = "TradeReportID")]
76    pub fn trade_report_id(&self) -> Result<Option<&str>, InvalidValue> {
77        self.0.get_str(Tag(571))
78    }
79
80    /// The `SecondaryTradeReportID` (818) field.
81    #[doc(alias = "SecondaryTradeReportID")]
82    pub fn secondary_trade_report_id(&self) -> Result<Option<&str>, InvalidValue> {
83        self.0.get_str(Tag(818))
84    }
85
86    /// The `ExecID` (17) field.
87    #[doc(alias = "ExecID")]
88    pub fn exec_id(&self) -> Result<Option<&str>, InvalidValue> {
89        self.0.get_str(Tag(17))
90    }
91
92    /// The `ExecType` (150) field.
93    #[doc(alias = "ExecType")]
94    pub fn exec_type(&self) -> Result<Option<ExecType<'_>>, InvalidValue> {
95        Ok(self.0.get_str(Tag(150))?.map(ExecType::from_value))
96    }
97
98    /// The `OrderID` (37) field.
99    #[doc(alias = "OrderID")]
100    pub fn order_id(&self) -> Result<Option<&str>, InvalidValue> {
101        self.0.get_str(Tag(37))
102    }
103
104    /// The `ClOrdID` (11) field.
105    #[doc(alias = "ClOrdID")]
106    pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
107        self.0.get_str(Tag(11))
108    }
109
110    /// The `MatchStatus` (573) field.
111    #[doc(alias = "MatchStatus")]
112    pub fn match_status(&self) -> Result<Option<MatchStatus<'_>>, InvalidValue> {
113        Ok(self.0.get_str(Tag(573))?.map(MatchStatus::from_value))
114    }
115
116    /// The `TrdType` (828) field.
117    #[doc(alias = "TrdType")]
118    pub fn trd_type(&self) -> Result<Option<TrdType>, InvalidValue> {
119        Ok(self.0.get_int(Tag(828))?.map(TrdType::from_value))
120    }
121
122    /// The `TrdSubType` (829) field.
123    #[doc(alias = "TrdSubType")]
124    pub fn trd_sub_type(&self) -> Result<Option<i64>, InvalidValue> {
125        self.0.get_int(Tag(829))
126    }
127
128    /// The `TransferReason` (830) field.
129    #[doc(alias = "TransferReason")]
130    pub fn transfer_reason(&self) -> Result<Option<&str>, InvalidValue> {
131        self.0.get_str(Tag(830))
132    }
133
134    /// The `SecondaryTrdType` (855) field.
135    #[doc(alias = "SecondaryTrdType")]
136    pub fn secondary_trd_type(&self) -> Result<Option<i64>, InvalidValue> {
137        self.0.get_int(Tag(855))
138    }
139
140    /// The `TradeLinkID` (820) field.
141    #[doc(alias = "TradeLinkID")]
142    pub fn trade_link_id(&self) -> Result<Option<&str>, InvalidValue> {
143        self.0.get_str(Tag(820))
144    }
145
146    /// The `TrdMatchID` (880) field.
147    #[doc(alias = "TrdMatchID")]
148    pub fn trd_match_id(&self) -> Result<Option<&str>, InvalidValue> {
149        self.0.get_str(Tag(880))
150    }
151
152    /// The instances of the `NoPartyIDs` (453) group.
153    #[doc(alias = "NoPartyIDs")]
154    pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
155        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
156    }
157
158    /// The `Instrument` component.
159    pub fn instrument(&self) -> Instrument<'_> {
160        Instrument(self.0.scope(), Self::known_tags().get())
161    }
162
163    /// The `InstrumentExtension` component.
164    pub fn instrument_extension(&self) -> InstrumentExtension<'_> {
165        InstrumentExtension(self.0.scope(), Self::known_tags().get())
166    }
167
168    /// The `FinancingDetails` component.
169    pub fn financing_details(&self) -> FinancingDetails<'_> {
170        FinancingDetails(self.0.scope())
171    }
172
173    /// The instances of the `NoUnderlyings` (711) group.
174    #[doc(alias = "NoUnderlyings")]
175    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
176        self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
177    }
178
179    /// The instances of the `NoLegs` (555) group.
180    #[doc(alias = "NoLegs")]
181    pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
182        self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
183    }
184
185    /// The instances of the `NoDates` (580) group.
186    #[doc(alias = "NoDates")]
187    pub fn dates(&self) -> Result<Instances<'_, TrdCapDtGrp<'_>>, InvalidValue> {
188        self.0.get_group(&TrdCapDtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
189    }
190
191    /// The `ClearingBusinessDate` (715) field.
192    #[doc(alias = "ClearingBusinessDate")]
193    pub fn clearing_business_date(&self) -> Result<Option<Date>, InvalidValue> {
194        self.0.get_date(Tag(715))
195    }
196
197    /// The `TradingSessionID` (336) field.
198    #[doc(alias = "TradingSessionID")]
199    pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
200        self.0.get_str(Tag(336))
201    }
202
203    /// The `TradingSessionSubID` (625) field.
204    #[doc(alias = "TradingSessionSubID")]
205    pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
206        self.0.get_str(Tag(625))
207    }
208
209    /// The `TimeBracket` (943) field.
210    #[doc(alias = "TimeBracket")]
211    pub fn time_bracket(&self) -> Result<Option<&str>, InvalidValue> {
212        self.0.get_str(Tag(943))
213    }
214
215    /// The `Side` (54) field.
216    #[doc(alias = "Side")]
217    pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
218        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
219    }
220
221    /// The `MultiLegReportingType` (442) field.
222    #[doc(alias = "MultiLegReportingType")]
223    pub fn multi_leg_reporting_type(&self) -> Result<Option<MultiLegReportingType<'_>>, InvalidValue> {
224        Ok(self.0.get_str(Tag(442))?.map(MultiLegReportingType::from_value))
225    }
226
227    /// The `TradeInputSource` (578) field.
228    #[doc(alias = "TradeInputSource")]
229    pub fn trade_input_source(&self) -> Result<Option<&str>, InvalidValue> {
230        self.0.get_str(Tag(578))
231    }
232
233    /// The `TradeInputDevice` (579) field.
234    #[doc(alias = "TradeInputDevice")]
235    pub fn trade_input_device(&self) -> Result<Option<&str>, InvalidValue> {
236        self.0.get_str(Tag(579))
237    }
238
239    /// The `ResponseTransportType` (725) field.
240    #[doc(alias = "ResponseTransportType")]
241    pub fn response_transport_type(&self) -> Result<Option<ResponseTransportType>, InvalidValue> {
242        Ok(self.0.get_int(Tag(725))?.map(ResponseTransportType::from_value))
243    }
244
245    /// The `ResponseDestination` (726) field.
246    #[doc(alias = "ResponseDestination")]
247    pub fn response_destination(&self) -> Result<Option<&str>, InvalidValue> {
248        self.0.get_str(Tag(726))
249    }
250
251    /// The `Text` (58) field.
252    #[doc(alias = "Text")]
253    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
254        self.0.get_str(Tag(58))
255    }
256
257    /// The `EncodedTextLen` (354) field.
258    #[doc(alias = "EncodedTextLen")]
259    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
260        self.0.get_int(Tag(354))
261    }
262
263    /// The `EncodedText` (355) field.
264    #[doc(alias = "EncodedText")]
265    pub fn encoded_text(&self) -> Option<&[u8]> {
266        self.0.get(Tag(355))
267    }
268}
269
270impl std::fmt::Debug for TradeCaptureReportRequest {
271    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
272        write!(f, "TradeCaptureReportRequest({})", self.0)
273    }
274}
275
276impl std::fmt::Display for TradeCaptureReportRequest {
277    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
278        std::fmt::Display::fmt(&self.0, f)
279    }
280}