Skip to main content

refix_fix44/generated/messages/
collateral_inquiry_ack.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Date, Decimal, Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{
7    CollInqQualGrp, ExecCollGrp, FinancingDetails, Header, InstrmtLegGrp, Instrument, Parties,
8    Trailer, TrdCollGrp, UndInstrmtGrp,
9};
10use super::super::enums::{
11    AccountType, CollInquiryResult, CollInquiryStatus, QtyType, ResponseTransportType, SettlSessID,
12};
13
14/// The `CollateralInquiryAck` (35=BG) message.
15pub struct CollateralInquiryAck(RawMessage);
16
17impl CollateralInquiryAck {
18    pub const MSG_TYPE: &[u8] = b"BG";
19
20    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
21        static TAGS: LazyKnownTags = LazyKnownTags::new(
22            &[
23                Tag(909), Tag(945), Tag(946), Tag(938), Tag(911), Tag(453), Tag(1), Tag(581),
24                Tag(11), Tag(37), Tag(198), Tag(526), Tag(124), Tag(897), Tag(64), Tag(53),
25                Tag(854), Tag(15), Tag(555), Tag(711), Tag(336), Tag(625), Tag(716), Tag(717),
26                Tag(715), Tag(725), Tag(726), Tag(58), Tag(354), Tag(355),
27            ],
28            &[
29                Header::known_tags(), Trailer::known_tags(), CollInqQualGrp::known_tags(),
30                Parties::known_tags(), ExecCollGrp::known_tags(), TrdCollGrp::known_tags(),
31                Instrument::known_tags(), FinancingDetails::known_tags(),
32                InstrmtLegGrp::known_tags(), UndInstrmtGrp::known_tags(),
33            ],
34        );
35        &TAGS
36    }
37
38    pub fn from_raw(raw: RawMessage) -> Self {
39        Self(raw)
40    }
41
42    pub fn raw(&self) -> &RawMessage {
43        &self.0
44    }
45
46    pub fn header(&self) -> Header<'_> {
47        Header(self.0.scope(), Self::known_tags().get())
48    }
49
50    pub fn trailer(&self) -> Trailer<'_> {
51        Trailer(self.0.scope())
52    }
53
54    /// The `CollInquiryID` (909) field.
55    #[doc(alias = "CollInquiryID")]
56    pub fn coll_inquiry_id(&self) -> Result<Option<&str>, InvalidValue> {
57        self.0.get_str(Tag(909))
58    }
59
60    /// The `CollInquiryStatus` (945) field.
61    #[doc(alias = "CollInquiryStatus")]
62    pub fn coll_inquiry_status(&self) -> Result<Option<CollInquiryStatus>, InvalidValue> {
63        Ok(self.0.get_int(Tag(945))?.map(CollInquiryStatus::from_value))
64    }
65
66    /// The `CollInquiryResult` (946) field.
67    #[doc(alias = "CollInquiryResult")]
68    pub fn coll_inquiry_result(&self) -> Result<Option<CollInquiryResult>, InvalidValue> {
69        Ok(self.0.get_int(Tag(946))?.map(CollInquiryResult::from_value))
70    }
71
72    /// The instances of the `NoCollInquiryQualifier` (938) group.
73    #[doc(alias = "NoCollInquiryQualifier")]
74    pub fn coll_inquiry_qualifier(&self) -> Result<Instances<'_, CollInqQualGrp<'_>>, InvalidValue> {
75        self.0.get_group(&CollInqQualGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
76    }
77
78    /// The `TotNumReports` (911) field.
79    #[doc(alias = "TotNumReports")]
80    pub fn tot_num_reports(&self) -> Result<Option<i64>, InvalidValue> {
81        self.0.get_int(Tag(911))
82    }
83
84    /// The instances of the `NoPartyIDs` (453) group.
85    #[doc(alias = "NoPartyIDs")]
86    pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
87        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
88    }
89
90    /// The `Account` (1) field.
91    #[doc(alias = "Account")]
92    pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
93        self.0.get_str(Tag(1))
94    }
95
96    /// The `AccountType` (581) field.
97    #[doc(alias = "AccountType")]
98    pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
99        Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
100    }
101
102    /// The `ClOrdID` (11) field.
103    #[doc(alias = "ClOrdID")]
104    pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
105        self.0.get_str(Tag(11))
106    }
107
108    /// The `OrderID` (37) field.
109    #[doc(alias = "OrderID")]
110    pub fn order_id(&self) -> Result<Option<&str>, InvalidValue> {
111        self.0.get_str(Tag(37))
112    }
113
114    /// The `SecondaryOrderID` (198) field.
115    #[doc(alias = "SecondaryOrderID")]
116    pub fn secondary_order_id(&self) -> Result<Option<&str>, InvalidValue> {
117        self.0.get_str(Tag(198))
118    }
119
120    /// The `SecondaryClOrdID` (526) field.
121    #[doc(alias = "SecondaryClOrdID")]
122    pub fn secondary_cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
123        self.0.get_str(Tag(526))
124    }
125
126    /// The instances of the `NoExecs` (124) group.
127    #[doc(alias = "NoExecs")]
128    pub fn execs(&self) -> Result<Instances<'_, ExecCollGrp<'_>>, InvalidValue> {
129        self.0.get_group(&ExecCollGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
130    }
131
132    /// The instances of the `NoTrades` (897) group.
133    #[doc(alias = "NoTrades")]
134    pub fn trades(&self) -> Result<Instances<'_, TrdCollGrp<'_>>, InvalidValue> {
135        self.0.get_group(&TrdCollGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
136    }
137
138    /// The `Instrument` component.
139    pub fn instrument(&self) -> Instrument<'_> {
140        Instrument(self.0.scope(), Self::known_tags().get())
141    }
142
143    /// The `FinancingDetails` component.
144    pub fn financing_details(&self) -> FinancingDetails<'_> {
145        FinancingDetails(self.0.scope())
146    }
147
148    /// The `SettlDate` (64) field.
149    #[doc(alias = "SettlDate")]
150    pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
151        self.0.get_date(Tag(64))
152    }
153
154    /// The `Quantity` (53) field.
155    #[doc(alias = "Quantity")]
156    pub fn quantity(&self) -> Result<Option<Decimal>, InvalidValue> {
157        self.0.get_decimal(Tag(53))
158    }
159
160    /// The `QtyType` (854) field.
161    #[doc(alias = "QtyType")]
162    pub fn qty_type(&self) -> Result<Option<QtyType>, InvalidValue> {
163        Ok(self.0.get_int(Tag(854))?.map(QtyType::from_value))
164    }
165
166    /// The `Currency` (15) field.
167    #[doc(alias = "Currency")]
168    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
169        self.0.get_str(Tag(15))
170    }
171
172    /// The instances of the `NoLegs` (555) group.
173    #[doc(alias = "NoLegs")]
174    pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
175        self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
176    }
177
178    /// The instances of the `NoUnderlyings` (711) group.
179    #[doc(alias = "NoUnderlyings")]
180    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
181        self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
182    }
183
184    /// The `TradingSessionID` (336) field.
185    #[doc(alias = "TradingSessionID")]
186    pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
187        self.0.get_str(Tag(336))
188    }
189
190    /// The `TradingSessionSubID` (625) field.
191    #[doc(alias = "TradingSessionSubID")]
192    pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
193        self.0.get_str(Tag(625))
194    }
195
196    /// The `SettlSessID` (716) field.
197    #[doc(alias = "SettlSessID")]
198    pub fn settl_sess_id(&self) -> Result<Option<SettlSessID<'_>>, InvalidValue> {
199        Ok(self.0.get_str(Tag(716))?.map(SettlSessID::from_value))
200    }
201
202    /// The `SettlSessSubID` (717) field.
203    #[doc(alias = "SettlSessSubID")]
204    pub fn settl_sess_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
205        self.0.get_str(Tag(717))
206    }
207
208    /// The `ClearingBusinessDate` (715) field.
209    #[doc(alias = "ClearingBusinessDate")]
210    pub fn clearing_business_date(&self) -> Result<Option<Date>, InvalidValue> {
211        self.0.get_date(Tag(715))
212    }
213
214    /// The `ResponseTransportType` (725) field.
215    #[doc(alias = "ResponseTransportType")]
216    pub fn response_transport_type(&self) -> Result<Option<ResponseTransportType>, InvalidValue> {
217        Ok(self.0.get_int(Tag(725))?.map(ResponseTransportType::from_value))
218    }
219
220    /// The `ResponseDestination` (726) field.
221    #[doc(alias = "ResponseDestination")]
222    pub fn response_destination(&self) -> Result<Option<&str>, InvalidValue> {
223        self.0.get_str(Tag(726))
224    }
225
226    /// The `Text` (58) field.
227    #[doc(alias = "Text")]
228    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
229        self.0.get_str(Tag(58))
230    }
231
232    /// The `EncodedTextLen` (354) field.
233    #[doc(alias = "EncodedTextLen")]
234    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
235        self.0.get_int(Tag(354))
236    }
237
238    /// The `EncodedText` (355) field.
239    #[doc(alias = "EncodedText")]
240    pub fn encoded_text(&self) -> Option<&[u8]> {
241        self.0.get(Tag(355))
242    }
243}
244
245impl std::fmt::Debug for CollateralInquiryAck {
246    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
247        write!(f, "CollateralInquiryAck({})", self.0)
248    }
249}
250
251impl std::fmt::Display for CollateralInquiryAck {
252    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
253        std::fmt::Display::fmt(&self.0, f)
254    }
255}