Skip to main content

refix_fix44/generated/messages/
trade_capture_report_request_ack.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![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
12/// The `TradeCaptureReportRequestAck` (35=AQ) message.
13pub 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    /// The `TradeRequestID` (568) field.
49    #[doc(alias = "TradeRequestID")]
50    pub fn trade_request_id(&self) -> Result<Option<&str>, InvalidValue> {
51        self.0.get_str(Tag(568))
52    }
53
54    /// The `TradeRequestType` (569) field.
55    #[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    /// The `SubscriptionRequestType` (263) field.
61    #[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    /// The `TotNumTradeReports` (748) field.
67    #[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    /// The `TradeRequestResult` (749) field.
73    #[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    /// The `TradeRequestStatus` (750) field.
79    #[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    /// The `Instrument` component.
85    pub fn instrument(&self) -> Instrument<'_> {
86        Instrument(self.0.scope(), Self::known_tags().get())
87    }
88
89    /// The instances of the `NoUnderlyings` (711) group.
90    #[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    /// The instances of the `NoLegs` (555) group.
96    #[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    /// The `MultiLegReportingType` (442) field.
102    #[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    /// The `ResponseTransportType` (725) field.
108    #[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    /// The `ResponseDestination` (726) field.
114    #[doc(alias = "ResponseDestination")]
115    pub fn response_destination(&self) -> Result<Option<&str>, InvalidValue> {
116        self.0.get_str(Tag(726))
117    }
118
119    /// The `Text` (58) field.
120    #[doc(alias = "Text")]
121    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
122        self.0.get_str(Tag(58))
123    }
124
125    /// The `EncodedTextLen` (354) field.
126    #[doc(alias = "EncodedTextLen")]
127    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
128        self.0.get_int(Tag(354))
129    }
130
131    /// The `EncodedText` (355) field.
132    #[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}