refix_fix44/generated/messages/
trade_capture_report_ack.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5 Instances, InvalidValue, LazyKnownTags, MultipleValues, RawMessage, Tag, UtcTimestamp,
6};
7
8use super::super::components::{
9 Header, Instrument, Trailer, TrdAllocGrp, TrdInstrmtLegGrp, TrdRegTimestamps,
10};
11use super::super::enums::{
12 AccountType, AcctIDSource, ClearingFeeIndicator, CustOrderCapacity, ExecType, OrderCapacity,
13 OrderRestrictions, PositionEffect, PreallocMethod, ResponseTransportType,
14 SubscriptionRequestType, TradeReportRejectReason, TradeReportType, TrdRptStatus, TrdType,
15};
16
17pub struct TradeCaptureReportAck(RawMessage);
19
20impl TradeCaptureReportAck {
21 pub const MSG_TYPE: &[u8] = b"AR";
22
23 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
24 static TAGS: LazyKnownTags = LazyKnownTags::new(
25 &[
26 Tag(571), Tag(487), Tag(856), Tag(828), Tag(829), Tag(855), Tag(830), Tag(150),
27 Tag(572), Tag(881), Tag(939), Tag(751), Tag(818), Tag(263), Tag(820), Tag(880),
28 Tag(17), Tag(527), Tag(60), Tag(768), Tag(725), Tag(726), Tag(58), Tag(354),
29 Tag(355), Tag(555), Tag(635), Tag(528), Tag(529), Tag(582), Tag(1), Tag(660),
30 Tag(581), Tag(77), Tag(591), Tag(78),
31 ],
32 &[
33 Header::known_tags(), Trailer::known_tags(), Instrument::known_tags(),
34 TrdRegTimestamps::known_tags(), TrdInstrmtLegGrp::known_tags(),
35 TrdAllocGrp::known_tags(),
36 ],
37 );
38 &TAGS
39 }
40
41 pub fn from_raw(raw: RawMessage) -> Self {
42 Self(raw)
43 }
44
45 pub fn raw(&self) -> &RawMessage {
46 &self.0
47 }
48
49 pub fn header(&self) -> Header<'_> {
50 Header(self.0.scope(), Self::known_tags().get())
51 }
52
53 pub fn trailer(&self) -> Trailer<'_> {
54 Trailer(self.0.scope())
55 }
56
57 #[doc(alias = "TradeReportID")]
59 pub fn trade_report_id(&self) -> Result<Option<&str>, InvalidValue> {
60 self.0.get_str(Tag(571))
61 }
62
63 #[doc(alias = "TradeReportTransType")]
65 pub fn trade_report_trans_type(&self) -> Result<Option<i64>, InvalidValue> {
66 self.0.get_int(Tag(487))
67 }
68
69 #[doc(alias = "TradeReportType")]
71 pub fn trade_report_type(&self) -> Result<Option<TradeReportType>, InvalidValue> {
72 Ok(self.0.get_int(Tag(856))?.map(TradeReportType::from_value))
73 }
74
75 #[doc(alias = "TrdType")]
77 pub fn trd_type(&self) -> Result<Option<TrdType>, InvalidValue> {
78 Ok(self.0.get_int(Tag(828))?.map(TrdType::from_value))
79 }
80
81 #[doc(alias = "TrdSubType")]
83 pub fn trd_sub_type(&self) -> Result<Option<i64>, InvalidValue> {
84 self.0.get_int(Tag(829))
85 }
86
87 #[doc(alias = "SecondaryTrdType")]
89 pub fn secondary_trd_type(&self) -> Result<Option<i64>, InvalidValue> {
90 self.0.get_int(Tag(855))
91 }
92
93 #[doc(alias = "TransferReason")]
95 pub fn transfer_reason(&self) -> Result<Option<&str>, InvalidValue> {
96 self.0.get_str(Tag(830))
97 }
98
99 #[doc(alias = "ExecType")]
101 pub fn exec_type(&self) -> Result<Option<ExecType<'_>>, InvalidValue> {
102 Ok(self.0.get_str(Tag(150))?.map(ExecType::from_value))
103 }
104
105 #[doc(alias = "TradeReportRefID")]
107 pub fn trade_report_ref_id(&self) -> Result<Option<&str>, InvalidValue> {
108 self.0.get_str(Tag(572))
109 }
110
111 #[doc(alias = "SecondaryTradeReportRefID")]
113 pub fn secondary_trade_report_ref_id(&self) -> Result<Option<&str>, InvalidValue> {
114 self.0.get_str(Tag(881))
115 }
116
117 #[doc(alias = "TrdRptStatus")]
119 pub fn trd_rpt_status(&self) -> Result<Option<TrdRptStatus>, InvalidValue> {
120 Ok(self.0.get_int(Tag(939))?.map(TrdRptStatus::from_value))
121 }
122
123 #[doc(alias = "TradeReportRejectReason")]
125 pub fn trade_report_reject_reason(&self) -> Result<Option<TradeReportRejectReason>, InvalidValue> {
126 Ok(self.0.get_int(Tag(751))?.map(TradeReportRejectReason::from_value))
127 }
128
129 #[doc(alias = "SecondaryTradeReportID")]
131 pub fn secondary_trade_report_id(&self) -> Result<Option<&str>, InvalidValue> {
132 self.0.get_str(Tag(818))
133 }
134
135 #[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 #[doc(alias = "TradeLinkID")]
143 pub fn trade_link_id(&self) -> Result<Option<&str>, InvalidValue> {
144 self.0.get_str(Tag(820))
145 }
146
147 #[doc(alias = "TrdMatchID")]
149 pub fn trd_match_id(&self) -> Result<Option<&str>, InvalidValue> {
150 self.0.get_str(Tag(880))
151 }
152
153 #[doc(alias = "ExecID")]
155 pub fn exec_id(&self) -> Result<Option<&str>, InvalidValue> {
156 self.0.get_str(Tag(17))
157 }
158
159 #[doc(alias = "SecondaryExecID")]
161 pub fn secondary_exec_id(&self) -> Result<Option<&str>, InvalidValue> {
162 self.0.get_str(Tag(527))
163 }
164
165 pub fn instrument(&self) -> Instrument<'_> {
167 Instrument(self.0.scope(), Self::known_tags().get())
168 }
169
170 #[doc(alias = "TransactTime")]
172 pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
173 self.0.get_utc_timestamp(Tag(60))
174 }
175
176 #[doc(alias = "NoTrdRegTimestamps")]
178 pub fn trd_reg_timestamps(&self) -> Result<Instances<'_, TrdRegTimestamps<'_>>, InvalidValue> {
179 self.0.get_group(&TrdRegTimestamps::TABLE, &Self::known_tags().get()).map(Instances::from)
180 }
181
182 #[doc(alias = "ResponseTransportType")]
184 pub fn response_transport_type(&self) -> Result<Option<ResponseTransportType>, InvalidValue> {
185 Ok(self.0.get_int(Tag(725))?.map(ResponseTransportType::from_value))
186 }
187
188 #[doc(alias = "ResponseDestination")]
190 pub fn response_destination(&self) -> Result<Option<&str>, InvalidValue> {
191 self.0.get_str(Tag(726))
192 }
193
194 #[doc(alias = "Text")]
196 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
197 self.0.get_str(Tag(58))
198 }
199
200 #[doc(alias = "EncodedTextLen")]
202 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
203 self.0.get_int(Tag(354))
204 }
205
206 #[doc(alias = "EncodedText")]
208 pub fn encoded_text(&self) -> Option<&[u8]> {
209 self.0.get(Tag(355))
210 }
211
212 #[doc(alias = "NoLegs")]
214 pub fn legs(&self) -> Result<Instances<'_, TrdInstrmtLegGrp<'_>>, InvalidValue> {
215 self.0.get_group(&TrdInstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
216 }
217
218 #[doc(alias = "ClearingFeeIndicator")]
220 pub fn clearing_fee_indicator(&self) -> Result<Option<ClearingFeeIndicator<'_>>, InvalidValue> {
221 Ok(self.0.get_str(Tag(635))?.map(ClearingFeeIndicator::from_value))
222 }
223
224 #[doc(alias = "OrderCapacity")]
226 pub fn order_capacity(&self) -> Result<Option<OrderCapacity<'_>>, InvalidValue> {
227 Ok(self.0.get_str(Tag(528))?.map(OrderCapacity::from_value))
228 }
229
230 #[doc(alias = "OrderRestrictions")]
232 pub fn order_restrictions(&self) -> Result<Option<MultipleValues<'_, OrderRestrictions<'_>>>, InvalidValue> {
233 self.0.get_multiple_values(Tag(529))
234 }
235
236 #[doc(alias = "CustOrderCapacity")]
238 pub fn cust_order_capacity(&self) -> Result<Option<CustOrderCapacity>, InvalidValue> {
239 Ok(self.0.get_int(Tag(582))?.map(CustOrderCapacity::from_value))
240 }
241
242 #[doc(alias = "Account")]
244 pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
245 self.0.get_str(Tag(1))
246 }
247
248 #[doc(alias = "AcctIDSource")]
250 pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
251 Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
252 }
253
254 #[doc(alias = "AccountType")]
256 pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
257 Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
258 }
259
260 #[doc(alias = "PositionEffect")]
262 pub fn position_effect(&self) -> Result<Option<PositionEffect<'_>>, InvalidValue> {
263 Ok(self.0.get_str(Tag(77))?.map(PositionEffect::from_value))
264 }
265
266 #[doc(alias = "PreallocMethod")]
268 pub fn prealloc_method(&self) -> Result<Option<PreallocMethod<'_>>, InvalidValue> {
269 Ok(self.0.get_str(Tag(591))?.map(PreallocMethod::from_value))
270 }
271
272 #[doc(alias = "NoAllocs")]
274 pub fn allocs(&self) -> Result<Instances<'_, TrdAllocGrp<'_>>, InvalidValue> {
275 self.0.get_group(&TrdAllocGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
276 }
277}
278
279impl std::fmt::Debug for TradeCaptureReportAck {
280 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
281 write!(f, "TradeCaptureReportAck({})", self.0)
282 }
283}
284
285impl std::fmt::Display for TradeCaptureReportAck {
286 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
287 std::fmt::Display::fmt(&self.0, f)
288 }
289}