refix_fix44/generated/messages/
trade_capture_report_request.rs1#![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
15pub 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 #[doc(alias = "TradeRequestID")]
58 pub fn trade_request_id(&self) -> Result<Option<&str>, InvalidValue> {
59 self.0.get_str(Tag(568))
60 }
61
62 #[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 #[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 #[doc(alias = "TradeReportID")]
76 pub fn trade_report_id(&self) -> Result<Option<&str>, InvalidValue> {
77 self.0.get_str(Tag(571))
78 }
79
80 #[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 #[doc(alias = "ExecID")]
88 pub fn exec_id(&self) -> Result<Option<&str>, InvalidValue> {
89 self.0.get_str(Tag(17))
90 }
91
92 #[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 #[doc(alias = "OrderID")]
100 pub fn order_id(&self) -> Result<Option<&str>, InvalidValue> {
101 self.0.get_str(Tag(37))
102 }
103
104 #[doc(alias = "ClOrdID")]
106 pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
107 self.0.get_str(Tag(11))
108 }
109
110 #[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 #[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 #[doc(alias = "TrdSubType")]
124 pub fn trd_sub_type(&self) -> Result<Option<i64>, InvalidValue> {
125 self.0.get_int(Tag(829))
126 }
127
128 #[doc(alias = "TransferReason")]
130 pub fn transfer_reason(&self) -> Result<Option<&str>, InvalidValue> {
131 self.0.get_str(Tag(830))
132 }
133
134 #[doc(alias = "SecondaryTrdType")]
136 pub fn secondary_trd_type(&self) -> Result<Option<i64>, InvalidValue> {
137 self.0.get_int(Tag(855))
138 }
139
140 #[doc(alias = "TradeLinkID")]
142 pub fn trade_link_id(&self) -> Result<Option<&str>, InvalidValue> {
143 self.0.get_str(Tag(820))
144 }
145
146 #[doc(alias = "TrdMatchID")]
148 pub fn trd_match_id(&self) -> Result<Option<&str>, InvalidValue> {
149 self.0.get_str(Tag(880))
150 }
151
152 #[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 pub fn instrument(&self) -> Instrument<'_> {
160 Instrument(self.0.scope(), Self::known_tags().get())
161 }
162
163 pub fn instrument_extension(&self) -> InstrumentExtension<'_> {
165 InstrumentExtension(self.0.scope(), Self::known_tags().get())
166 }
167
168 pub fn financing_details(&self) -> FinancingDetails<'_> {
170 FinancingDetails(self.0.scope())
171 }
172
173 #[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 #[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 #[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 #[doc(alias = "ClearingBusinessDate")]
193 pub fn clearing_business_date(&self) -> Result<Option<Date>, InvalidValue> {
194 self.0.get_date(Tag(715))
195 }
196
197 #[doc(alias = "TradingSessionID")]
199 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
200 self.0.get_str(Tag(336))
201 }
202
203 #[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 #[doc(alias = "TimeBracket")]
211 pub fn time_bracket(&self) -> Result<Option<&str>, InvalidValue> {
212 self.0.get_str(Tag(943))
213 }
214
215 #[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 #[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 #[doc(alias = "TradeInputSource")]
229 pub fn trade_input_source(&self) -> Result<Option<&str>, InvalidValue> {
230 self.0.get_str(Tag(578))
231 }
232
233 #[doc(alias = "TradeInputDevice")]
235 pub fn trade_input_device(&self) -> Result<Option<&str>, InvalidValue> {
236 self.0.get_str(Tag(579))
237 }
238
239 #[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 #[doc(alias = "ResponseDestination")]
247 pub fn response_destination(&self) -> Result<Option<&str>, InvalidValue> {
248 self.0.get_str(Tag(726))
249 }
250
251 #[doc(alias = "Text")]
253 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
254 self.0.get_str(Tag(58))
255 }
256
257 #[doc(alias = "EncodedTextLen")]
259 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
260 self.0.get_int(Tag(354))
261 }
262
263 #[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}