refix_fix44/generated/messages/
trade_capture_report_request_ack.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{Header, InstrmtLegGrp, Instrument, Trailer, UndInstrmtGrp};
7use super::super::enums::{
8 MultiLegReportingType, ResponseTransportType, SubscriptionRequestType, TradeRequestResult,
9 TradeRequestStatus, TradeRequestType,
10};
11
12pub struct TradeCaptureReportRequestAck(RawMessage);
14
15impl TradeCaptureReportRequestAck {
16 pub const MSG_TYPE: &[u8] = b"AQ";
17
18 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
19 static TAGS: LazyKnownTags = LazyKnownTags::new(
20 &[
21 Tag(568), Tag(569), Tag(263), Tag(748), Tag(749), Tag(750), Tag(711), Tag(555),
22 Tag(442), Tag(725), Tag(726), Tag(58), Tag(354), Tag(355),
23 ],
24 &[
25 Header::known_tags(), Trailer::known_tags(), Instrument::known_tags(),
26 UndInstrmtGrp::known_tags(), InstrmtLegGrp::known_tags(),
27 ],
28 );
29 &TAGS
30 }
31
32 pub fn from_raw(raw: RawMessage) -> Self {
33 Self(raw)
34 }
35
36 pub fn raw(&self) -> &RawMessage {
37 &self.0
38 }
39
40 pub fn header(&self) -> Header<'_> {
41 Header(self.0.scope(), Self::known_tags().get())
42 }
43
44 pub fn trailer(&self) -> Trailer<'_> {
45 Trailer(self.0.scope())
46 }
47
48 #[doc(alias = "TradeRequestID")]
50 pub fn trade_request_id(&self) -> Result<Option<&str>, InvalidValue> {
51 self.0.get_str(Tag(568))
52 }
53
54 #[doc(alias = "TradeRequestType")]
56 pub fn trade_request_type(&self) -> Result<Option<TradeRequestType>, InvalidValue> {
57 Ok(self.0.get_int(Tag(569))?.map(TradeRequestType::from_value))
58 }
59
60 #[doc(alias = "SubscriptionRequestType")]
62 pub fn subscription_request_type(&self) -> Result<Option<SubscriptionRequestType<'_>>, InvalidValue> {
63 Ok(self.0.get_str(Tag(263))?.map(SubscriptionRequestType::from_value))
64 }
65
66 #[doc(alias = "TotNumTradeReports")]
68 pub fn tot_num_trade_reports(&self) -> Result<Option<i64>, InvalidValue> {
69 self.0.get_int(Tag(748))
70 }
71
72 #[doc(alias = "TradeRequestResult")]
74 pub fn trade_request_result(&self) -> Result<Option<TradeRequestResult>, InvalidValue> {
75 Ok(self.0.get_int(Tag(749))?.map(TradeRequestResult::from_value))
76 }
77
78 #[doc(alias = "TradeRequestStatus")]
80 pub fn trade_request_status(&self) -> Result<Option<TradeRequestStatus>, InvalidValue> {
81 Ok(self.0.get_int(Tag(750))?.map(TradeRequestStatus::from_value))
82 }
83
84 pub fn instrument(&self) -> Instrument<'_> {
86 Instrument(self.0.scope(), Self::known_tags().get())
87 }
88
89 #[doc(alias = "NoUnderlyings")]
91 pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
92 self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
93 }
94
95 #[doc(alias = "NoLegs")]
97 pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
98 self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
99 }
100
101 #[doc(alias = "MultiLegReportingType")]
103 pub fn multi_leg_reporting_type(&self) -> Result<Option<MultiLegReportingType<'_>>, InvalidValue> {
104 Ok(self.0.get_str(Tag(442))?.map(MultiLegReportingType::from_value))
105 }
106
107 #[doc(alias = "ResponseTransportType")]
109 pub fn response_transport_type(&self) -> Result<Option<ResponseTransportType>, InvalidValue> {
110 Ok(self.0.get_int(Tag(725))?.map(ResponseTransportType::from_value))
111 }
112
113 #[doc(alias = "ResponseDestination")]
115 pub fn response_destination(&self) -> Result<Option<&str>, InvalidValue> {
116 self.0.get_str(Tag(726))
117 }
118
119 #[doc(alias = "Text")]
121 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
122 self.0.get_str(Tag(58))
123 }
124
125 #[doc(alias = "EncodedTextLen")]
127 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
128 self.0.get_int(Tag(354))
129 }
130
131 #[doc(alias = "EncodedText")]
133 pub fn encoded_text(&self) -> Option<&[u8]> {
134 self.0.get(Tag(355))
135 }
136}
137
138impl std::fmt::Debug for TradeCaptureReportRequestAck {
139 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
140 write!(f, "TradeCaptureReportRequestAck({})", self.0)
141 }
142}
143
144impl std::fmt::Display for TradeCaptureReportRequestAck {
145 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
146 std::fmt::Display::fmt(&self.0, f)
147 }
148}