Skip to main content

refix_fix44/generated/messages/
trade_capture_report_ack.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![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
17/// The `TradeCaptureReportAck` (35=AR) message.
18pub 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    /// The `TradeReportID` (571) field.
58    #[doc(alias = "TradeReportID")]
59    pub fn trade_report_id(&self) -> Result<Option<&str>, InvalidValue> {
60        self.0.get_str(Tag(571))
61    }
62
63    /// The `TradeReportTransType` (487) field.
64    #[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    /// The `TradeReportType` (856) field.
70    #[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    /// The `TrdType` (828) field.
76    #[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    /// The `TrdSubType` (829) field.
82    #[doc(alias = "TrdSubType")]
83    pub fn trd_sub_type(&self) -> Result<Option<i64>, InvalidValue> {
84        self.0.get_int(Tag(829))
85    }
86
87    /// The `SecondaryTrdType` (855) field.
88    #[doc(alias = "SecondaryTrdType")]
89    pub fn secondary_trd_type(&self) -> Result<Option<i64>, InvalidValue> {
90        self.0.get_int(Tag(855))
91    }
92
93    /// The `TransferReason` (830) field.
94    #[doc(alias = "TransferReason")]
95    pub fn transfer_reason(&self) -> Result<Option<&str>, InvalidValue> {
96        self.0.get_str(Tag(830))
97    }
98
99    /// The `ExecType` (150) field.
100    #[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    /// The `TradeReportRefID` (572) field.
106    #[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    /// The `SecondaryTradeReportRefID` (881) field.
112    #[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    /// The `TrdRptStatus` (939) field.
118    #[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    /// The `TradeReportRejectReason` (751) field.
124    #[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    /// The `SecondaryTradeReportID` (818) field.
130    #[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    /// 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 `TradeLinkID` (820) field.
142    #[doc(alias = "TradeLinkID")]
143    pub fn trade_link_id(&self) -> Result<Option<&str>, InvalidValue> {
144        self.0.get_str(Tag(820))
145    }
146
147    /// The `TrdMatchID` (880) field.
148    #[doc(alias = "TrdMatchID")]
149    pub fn trd_match_id(&self) -> Result<Option<&str>, InvalidValue> {
150        self.0.get_str(Tag(880))
151    }
152
153    /// The `ExecID` (17) field.
154    #[doc(alias = "ExecID")]
155    pub fn exec_id(&self) -> Result<Option<&str>, InvalidValue> {
156        self.0.get_str(Tag(17))
157    }
158
159    /// The `SecondaryExecID` (527) field.
160    #[doc(alias = "SecondaryExecID")]
161    pub fn secondary_exec_id(&self) -> Result<Option<&str>, InvalidValue> {
162        self.0.get_str(Tag(527))
163    }
164
165    /// The `Instrument` component.
166    pub fn instrument(&self) -> Instrument<'_> {
167        Instrument(self.0.scope(), Self::known_tags().get())
168    }
169
170    /// The `TransactTime` (60) field.
171    #[doc(alias = "TransactTime")]
172    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
173        self.0.get_utc_timestamp(Tag(60))
174    }
175
176    /// The instances of the `NoTrdRegTimestamps` (768) group.
177    #[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    /// The `ResponseTransportType` (725) field.
183    #[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    /// The `ResponseDestination` (726) field.
189    #[doc(alias = "ResponseDestination")]
190    pub fn response_destination(&self) -> Result<Option<&str>, InvalidValue> {
191        self.0.get_str(Tag(726))
192    }
193
194    /// The `Text` (58) field.
195    #[doc(alias = "Text")]
196    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
197        self.0.get_str(Tag(58))
198    }
199
200    /// The `EncodedTextLen` (354) field.
201    #[doc(alias = "EncodedTextLen")]
202    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
203        self.0.get_int(Tag(354))
204    }
205
206    /// The `EncodedText` (355) field.
207    #[doc(alias = "EncodedText")]
208    pub fn encoded_text(&self) -> Option<&[u8]> {
209        self.0.get(Tag(355))
210    }
211
212    /// The instances of the `NoLegs` (555) group.
213    #[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    /// The `ClearingFeeIndicator` (635) field.
219    #[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    /// The `OrderCapacity` (528) field.
225    #[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    /// The `OrderRestrictions` (529) field.
231    #[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    /// The `CustOrderCapacity` (582) field.
237    #[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    /// The `Account` (1) field.
243    #[doc(alias = "Account")]
244    pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
245        self.0.get_str(Tag(1))
246    }
247
248    /// The `AcctIDSource` (660) field.
249    #[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    /// The `AccountType` (581) field.
255    #[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    /// The `PositionEffect` (77) field.
261    #[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    /// The `PreallocMethod` (591) field.
267    #[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    /// The instances of the `NoAllocs` (78) group.
273    #[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}