1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5 Date, Decimal, Instances, InvalidValue, LazyKnownTags, RawMessage, Tag, UtcTimestamp,
6};
7
8use super::super::components::{
9 FinancingDetails, Header, Instrument, LegQuotStatGrp, OrderQtyData, Parties, QuotQualGrp,
10 SpreadOrBenchmarkCurveData, Stipulations, Trailer, UndInstrmtGrp, YieldData,
11};
12use super::super::enums::{
13 AccountType, AcctIDSource, CommType, CustOrderCapacity, OrdType, PriceType, QuoteStatus,
14 QuoteType, SettlCurrFxRateCalc, SettlType, Side,
15};
16
17pub struct QuoteStatusReport(RawMessage);
19
20impl QuoteStatusReport {
21 pub const MSG_TYPE: &[u8] = b"AI";
22
23 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
24 static TAGS: LazyKnownTags = LazyKnownTags::new(
25 &[
26 Tag(649), Tag(131), Tag(117), Tag(693), Tag(537), Tag(453), Tag(336), Tag(625),
27 Tag(711), Tag(54), Tag(63), Tag(64), Tag(193), Tag(192), Tag(15), Tag(232), Tag(1),
28 Tag(660), Tag(581), Tag(555), Tag(735), Tag(126), Tag(44), Tag(423), Tag(132),
29 Tag(133), Tag(645), Tag(646), Tag(647), Tag(134), Tag(648), Tag(135), Tag(62),
30 Tag(188), Tag(190), Tag(189), Tag(191), Tag(631), Tag(632), Tag(633), Tag(634),
31 Tag(60), Tag(40), Tag(642), Tag(643), Tag(656), Tag(657), Tag(156), Tag(13),
32 Tag(12), Tag(582), Tag(100), Tag(297), Tag(58), Tag(354), Tag(355),
33 ],
34 &[
35 Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
36 Instrument::known_tags(), FinancingDetails::known_tags(),
37 UndInstrmtGrp::known_tags(), OrderQtyData::known_tags(), Stipulations::known_tags(),
38 LegQuotStatGrp::known_tags(), QuotQualGrp::known_tags(),
39 SpreadOrBenchmarkCurveData::known_tags(), YieldData::known_tags(),
40 ],
41 );
42 &TAGS
43 }
44
45 pub fn from_raw(raw: RawMessage) -> Self {
46 Self(raw)
47 }
48
49 pub fn raw(&self) -> &RawMessage {
50 &self.0
51 }
52
53 pub fn header(&self) -> Header<'_> {
54 Header(self.0.scope(), Self::known_tags().get())
55 }
56
57 pub fn trailer(&self) -> Trailer<'_> {
58 Trailer(self.0.scope())
59 }
60
61 #[doc(alias = "QuoteStatusReqID")]
63 pub fn quote_status_req_id(&self) -> Result<Option<&str>, InvalidValue> {
64 self.0.get_str(Tag(649))
65 }
66
67 #[doc(alias = "QuoteReqID")]
69 pub fn quote_req_id(&self) -> Result<Option<&str>, InvalidValue> {
70 self.0.get_str(Tag(131))
71 }
72
73 #[doc(alias = "QuoteID")]
75 pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
76 self.0.get_str(Tag(117))
77 }
78
79 #[doc(alias = "QuoteRespID")]
81 pub fn quote_resp_id(&self) -> Result<Option<&str>, InvalidValue> {
82 self.0.get_str(Tag(693))
83 }
84
85 #[doc(alias = "QuoteType")]
87 pub fn quote_type(&self) -> Result<Option<QuoteType>, InvalidValue> {
88 Ok(self.0.get_int(Tag(537))?.map(QuoteType::from_value))
89 }
90
91 #[doc(alias = "NoPartyIDs")]
93 pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
94 self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
95 }
96
97 #[doc(alias = "TradingSessionID")]
99 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
100 self.0.get_str(Tag(336))
101 }
102
103 #[doc(alias = "TradingSessionSubID")]
105 pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
106 self.0.get_str(Tag(625))
107 }
108
109 pub fn instrument(&self) -> Instrument<'_> {
111 Instrument(self.0.scope(), Self::known_tags().get())
112 }
113
114 pub fn financing_details(&self) -> FinancingDetails<'_> {
116 FinancingDetails(self.0.scope())
117 }
118
119 #[doc(alias = "NoUnderlyings")]
121 pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
122 self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
123 }
124
125 #[doc(alias = "Side")]
127 pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
128 Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
129 }
130
131 pub fn order_qty_data(&self) -> OrderQtyData<'_> {
133 OrderQtyData(self.0.scope())
134 }
135
136 #[doc(alias = "SettlType")]
138 pub fn settl_type(&self) -> Result<Option<SettlType<'_>>, InvalidValue> {
139 Ok(self.0.get_str(Tag(63))?.map(SettlType::from_value))
140 }
141
142 #[doc(alias = "SettlDate")]
144 pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
145 self.0.get_date(Tag(64))
146 }
147
148 #[doc(alias = "SettlDate2")]
150 pub fn settl_date2(&self) -> Result<Option<Date>, InvalidValue> {
151 self.0.get_date(Tag(193))
152 }
153
154 #[doc(alias = "OrderQty2")]
156 pub fn order_qty2(&self) -> Result<Option<Decimal>, InvalidValue> {
157 self.0.get_decimal(Tag(192))
158 }
159
160 #[doc(alias = "Currency")]
162 pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
163 self.0.get_str(Tag(15))
164 }
165
166 #[doc(alias = "NoStipulations")]
168 pub fn stipulations(&self) -> Result<Instances<'_, Stipulations<'_>>, InvalidValue> {
169 self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
170 }
171
172 #[doc(alias = "Account")]
174 pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
175 self.0.get_str(Tag(1))
176 }
177
178 #[doc(alias = "AcctIDSource")]
180 pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
181 Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
182 }
183
184 #[doc(alias = "AccountType")]
186 pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
187 Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
188 }
189
190 #[doc(alias = "NoLegs")]
192 pub fn legs(&self) -> Result<Instances<'_, LegQuotStatGrp<'_>>, InvalidValue> {
193 self.0.get_group(&LegQuotStatGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
194 }
195
196 #[doc(alias = "NoQuoteQualifiers")]
198 pub fn quote_qualifiers(&self) -> Result<Instances<'_, QuotQualGrp<'_>>, InvalidValue> {
199 self.0.get_group(&QuotQualGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
200 }
201
202 #[doc(alias = "ExpireTime")]
204 pub fn expire_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
205 self.0.get_utc_timestamp(Tag(126))
206 }
207
208 #[doc(alias = "Price")]
210 pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
211 self.0.get_decimal(Tag(44))
212 }
213
214 #[doc(alias = "PriceType")]
216 pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
217 Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
218 }
219
220 pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'_> {
222 SpreadOrBenchmarkCurveData(self.0.scope())
223 }
224
225 pub fn yield_data(&self) -> YieldData<'_> {
227 YieldData(self.0.scope())
228 }
229
230 #[doc(alias = "BidPx")]
232 pub fn bid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
233 self.0.get_decimal(Tag(132))
234 }
235
236 #[doc(alias = "OfferPx")]
238 pub fn offer_px(&self) -> Result<Option<Decimal>, InvalidValue> {
239 self.0.get_decimal(Tag(133))
240 }
241
242 #[doc(alias = "MktBidPx")]
244 pub fn mkt_bid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
245 self.0.get_decimal(Tag(645))
246 }
247
248 #[doc(alias = "MktOfferPx")]
250 pub fn mkt_offer_px(&self) -> Result<Option<Decimal>, InvalidValue> {
251 self.0.get_decimal(Tag(646))
252 }
253
254 #[doc(alias = "MinBidSize")]
256 pub fn min_bid_size(&self) -> Result<Option<Decimal>, InvalidValue> {
257 self.0.get_decimal(Tag(647))
258 }
259
260 #[doc(alias = "BidSize")]
262 pub fn bid_size(&self) -> Result<Option<Decimal>, InvalidValue> {
263 self.0.get_decimal(Tag(134))
264 }
265
266 #[doc(alias = "MinOfferSize")]
268 pub fn min_offer_size(&self) -> Result<Option<Decimal>, InvalidValue> {
269 self.0.get_decimal(Tag(648))
270 }
271
272 #[doc(alias = "OfferSize")]
274 pub fn offer_size(&self) -> Result<Option<Decimal>, InvalidValue> {
275 self.0.get_decimal(Tag(135))
276 }
277
278 #[doc(alias = "ValidUntilTime")]
280 pub fn valid_until_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
281 self.0.get_utc_timestamp(Tag(62))
282 }
283
284 #[doc(alias = "BidSpotRate")]
286 pub fn bid_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
287 self.0.get_decimal(Tag(188))
288 }
289
290 #[doc(alias = "OfferSpotRate")]
292 pub fn offer_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
293 self.0.get_decimal(Tag(190))
294 }
295
296 #[doc(alias = "BidForwardPoints")]
298 pub fn bid_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
299 self.0.get_decimal(Tag(189))
300 }
301
302 #[doc(alias = "OfferForwardPoints")]
304 pub fn offer_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
305 self.0.get_decimal(Tag(191))
306 }
307
308 #[doc(alias = "MidPx")]
310 pub fn mid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
311 self.0.get_decimal(Tag(631))
312 }
313
314 #[doc(alias = "BidYield")]
316 pub fn bid_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
317 self.0.get_decimal(Tag(632))
318 }
319
320 #[doc(alias = "MidYield")]
322 pub fn mid_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
323 self.0.get_decimal(Tag(633))
324 }
325
326 #[doc(alias = "OfferYield")]
328 pub fn offer_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
329 self.0.get_decimal(Tag(634))
330 }
331
332 #[doc(alias = "TransactTime")]
334 pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
335 self.0.get_utc_timestamp(Tag(60))
336 }
337
338 #[doc(alias = "OrdType")]
340 pub fn ord_type(&self) -> Result<Option<OrdType<'_>>, InvalidValue> {
341 Ok(self.0.get_str(Tag(40))?.map(OrdType::from_value))
342 }
343
344 #[doc(alias = "BidForwardPoints2")]
346 pub fn bid_forward_points2(&self) -> Result<Option<Decimal>, InvalidValue> {
347 self.0.get_decimal(Tag(642))
348 }
349
350 #[doc(alias = "OfferForwardPoints2")]
352 pub fn offer_forward_points2(&self) -> Result<Option<Decimal>, InvalidValue> {
353 self.0.get_decimal(Tag(643))
354 }
355
356 #[doc(alias = "SettlCurrBidFxRate")]
358 pub fn settl_curr_bid_fx_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
359 self.0.get_decimal(Tag(656))
360 }
361
362 #[doc(alias = "SettlCurrOfferFxRate")]
364 pub fn settl_curr_offer_fx_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
365 self.0.get_decimal(Tag(657))
366 }
367
368 #[doc(alias = "SettlCurrFxRateCalc")]
370 pub fn settl_curr_fx_rate_calc(&self) -> Result<Option<SettlCurrFxRateCalc<'_>>, InvalidValue> {
371 Ok(self.0.get_str(Tag(156))?.map(SettlCurrFxRateCalc::from_value))
372 }
373
374 #[doc(alias = "CommType")]
376 pub fn comm_type(&self) -> Result<Option<CommType<'_>>, InvalidValue> {
377 Ok(self.0.get_str(Tag(13))?.map(CommType::from_value))
378 }
379
380 #[doc(alias = "Commission")]
382 pub fn commission(&self) -> Result<Option<Decimal>, InvalidValue> {
383 self.0.get_decimal(Tag(12))
384 }
385
386 #[doc(alias = "CustOrderCapacity")]
388 pub fn cust_order_capacity(&self) -> Result<Option<CustOrderCapacity>, InvalidValue> {
389 Ok(self.0.get_int(Tag(582))?.map(CustOrderCapacity::from_value))
390 }
391
392 #[doc(alias = "ExDestination")]
394 pub fn ex_destination(&self) -> Result<Option<&str>, InvalidValue> {
395 self.0.get_str(Tag(100))
396 }
397
398 #[doc(alias = "QuoteStatus")]
400 pub fn quote_status(&self) -> Result<Option<QuoteStatus>, InvalidValue> {
401 Ok(self.0.get_int(Tag(297))?.map(QuoteStatus::from_value))
402 }
403
404 #[doc(alias = "Text")]
406 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
407 self.0.get_str(Tag(58))
408 }
409
410 #[doc(alias = "EncodedTextLen")]
412 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
413 self.0.get_int(Tag(354))
414 }
415
416 #[doc(alias = "EncodedText")]
418 pub fn encoded_text(&self) -> Option<&[u8]> {
419 self.0.get(Tag(355))
420 }
421}
422
423impl std::fmt::Debug for QuoteStatusReport {
424 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
425 write!(f, "QuoteStatusReport({})", self.0)
426 }
427}
428
429impl std::fmt::Display for QuoteStatusReport {
430 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
431 std::fmt::Display::fmt(&self.0, f)
432 }
433}