Skip to main content

refix_fix44/generated/messages/
quote_response.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![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, LegQuotGrp, OrderQtyData, Parties, QuotQualGrp,
10    SpreadOrBenchmarkCurveData, Stipulations, Trailer, UndInstrmtGrp, YieldData,
11};
12use super::super::enums::{
13    AccountType, AcctIDSource, CommType, CustOrderCapacity, OrdType, OrderCapacity, PriceType,
14    QuoteRespType, QuoteType, SettlCurrFxRateCalc, SettlType, Side,
15};
16
17/// The `QuoteResponse` (35=AJ) message.
18pub struct QuoteResponse(RawMessage);
19
20impl QuoteResponse {
21    pub const MSG_TYPE: &[u8] = b"AJ";
22
23    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
24        static TAGS: LazyKnownTags = LazyKnownTags::new(
25            &[
26                Tag(693), Tag(117), Tag(694), Tag(11), Tag(528), Tag(23), Tag(537), Tag(735),
27                Tag(453), Tag(336), Tag(625), Tag(711), Tag(54), Tag(63), Tag(64), Tag(193),
28                Tag(192), Tag(15), Tag(232), Tag(1), Tag(660), Tag(581), Tag(555), 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(12),
32                Tag(13), Tag(582), Tag(100), Tag(58), Tag(354), Tag(355), Tag(44), Tag(423),
33            ],
34            &[
35                Header::known_tags(), Trailer::known_tags(), QuotQualGrp::known_tags(),
36                Parties::known_tags(), Instrument::known_tags(), FinancingDetails::known_tags(),
37                UndInstrmtGrp::known_tags(), OrderQtyData::known_tags(), Stipulations::known_tags(),
38                LegQuotGrp::known_tags(), SpreadOrBenchmarkCurveData::known_tags(),
39                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    /// The `QuoteRespID` (693) field.
62    #[doc(alias = "QuoteRespID")]
63    pub fn quote_resp_id(&self) -> Result<Option<&str>, InvalidValue> {
64        self.0.get_str(Tag(693))
65    }
66
67    /// The `QuoteID` (117) field.
68    #[doc(alias = "QuoteID")]
69    pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
70        self.0.get_str(Tag(117))
71    }
72
73    /// The `QuoteRespType` (694) field.
74    #[doc(alias = "QuoteRespType")]
75    pub fn quote_resp_type(&self) -> Result<Option<QuoteRespType>, InvalidValue> {
76        Ok(self.0.get_int(Tag(694))?.map(QuoteRespType::from_value))
77    }
78
79    /// The `ClOrdID` (11) field.
80    #[doc(alias = "ClOrdID")]
81    pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
82        self.0.get_str(Tag(11))
83    }
84
85    /// The `OrderCapacity` (528) field.
86    #[doc(alias = "OrderCapacity")]
87    pub fn order_capacity(&self) -> Result<Option<OrderCapacity<'_>>, InvalidValue> {
88        Ok(self.0.get_str(Tag(528))?.map(OrderCapacity::from_value))
89    }
90
91    /// The `IOIID` (23) field.
92    #[doc(alias = "IOIID")]
93    pub fn ioiid(&self) -> Result<Option<&str>, InvalidValue> {
94        self.0.get_str(Tag(23))
95    }
96
97    /// The `QuoteType` (537) field.
98    #[doc(alias = "QuoteType")]
99    pub fn quote_type(&self) -> Result<Option<QuoteType>, InvalidValue> {
100        Ok(self.0.get_int(Tag(537))?.map(QuoteType::from_value))
101    }
102
103    /// The instances of the `NoQuoteQualifiers` (735) group.
104    #[doc(alias = "NoQuoteQualifiers")]
105    pub fn quote_qualifiers(&self) -> Result<Instances<'_, QuotQualGrp<'_>>, InvalidValue> {
106        self.0.get_group(&QuotQualGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
107    }
108
109    /// The instances of the `NoPartyIDs` (453) group.
110    #[doc(alias = "NoPartyIDs")]
111    pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
112        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
113    }
114
115    /// The `TradingSessionID` (336) field.
116    #[doc(alias = "TradingSessionID")]
117    pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
118        self.0.get_str(Tag(336))
119    }
120
121    /// The `TradingSessionSubID` (625) field.
122    #[doc(alias = "TradingSessionSubID")]
123    pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
124        self.0.get_str(Tag(625))
125    }
126
127    /// The `Instrument` component.
128    pub fn instrument(&self) -> Instrument<'_> {
129        Instrument(self.0.scope(), Self::known_tags().get())
130    }
131
132    /// The `FinancingDetails` component.
133    pub fn financing_details(&self) -> FinancingDetails<'_> {
134        FinancingDetails(self.0.scope())
135    }
136
137    /// The instances of the `NoUnderlyings` (711) group.
138    #[doc(alias = "NoUnderlyings")]
139    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
140        self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
141    }
142
143    /// The `Side` (54) field.
144    #[doc(alias = "Side")]
145    pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
146        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
147    }
148
149    /// The `OrderQtyData` component.
150    pub fn order_qty_data(&self) -> OrderQtyData<'_> {
151        OrderQtyData(self.0.scope())
152    }
153
154    /// The `SettlType` (63) field.
155    #[doc(alias = "SettlType")]
156    pub fn settl_type(&self) -> Result<Option<SettlType<'_>>, InvalidValue> {
157        Ok(self.0.get_str(Tag(63))?.map(SettlType::from_value))
158    }
159
160    /// The `SettlDate` (64) field.
161    #[doc(alias = "SettlDate")]
162    pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
163        self.0.get_date(Tag(64))
164    }
165
166    /// The `SettlDate2` (193) field.
167    #[doc(alias = "SettlDate2")]
168    pub fn settl_date2(&self) -> Result<Option<Date>, InvalidValue> {
169        self.0.get_date(Tag(193))
170    }
171
172    /// The `OrderQty2` (192) field.
173    #[doc(alias = "OrderQty2")]
174    pub fn order_qty2(&self) -> Result<Option<Decimal>, InvalidValue> {
175        self.0.get_decimal(Tag(192))
176    }
177
178    /// The `Currency` (15) field.
179    #[doc(alias = "Currency")]
180    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
181        self.0.get_str(Tag(15))
182    }
183
184    /// The instances of the `NoStipulations` (232) group.
185    #[doc(alias = "NoStipulations")]
186    pub fn stipulations(&self) -> Result<Instances<'_, Stipulations<'_>>, InvalidValue> {
187        self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
188    }
189
190    /// The `Account` (1) field.
191    #[doc(alias = "Account")]
192    pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
193        self.0.get_str(Tag(1))
194    }
195
196    /// The `AcctIDSource` (660) field.
197    #[doc(alias = "AcctIDSource")]
198    pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
199        Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
200    }
201
202    /// The `AccountType` (581) field.
203    #[doc(alias = "AccountType")]
204    pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
205        Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
206    }
207
208    /// The instances of the `NoLegs` (555) group.
209    #[doc(alias = "NoLegs")]
210    pub fn legs(&self) -> Result<Instances<'_, LegQuotGrp<'_>>, InvalidValue> {
211        self.0.get_group(&LegQuotGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
212    }
213
214    /// The `BidPx` (132) field.
215    #[doc(alias = "BidPx")]
216    pub fn bid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
217        self.0.get_decimal(Tag(132))
218    }
219
220    /// The `OfferPx` (133) field.
221    #[doc(alias = "OfferPx")]
222    pub fn offer_px(&self) -> Result<Option<Decimal>, InvalidValue> {
223        self.0.get_decimal(Tag(133))
224    }
225
226    /// The `MktBidPx` (645) field.
227    #[doc(alias = "MktBidPx")]
228    pub fn mkt_bid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
229        self.0.get_decimal(Tag(645))
230    }
231
232    /// The `MktOfferPx` (646) field.
233    #[doc(alias = "MktOfferPx")]
234    pub fn mkt_offer_px(&self) -> Result<Option<Decimal>, InvalidValue> {
235        self.0.get_decimal(Tag(646))
236    }
237
238    /// The `MinBidSize` (647) field.
239    #[doc(alias = "MinBidSize")]
240    pub fn min_bid_size(&self) -> Result<Option<Decimal>, InvalidValue> {
241        self.0.get_decimal(Tag(647))
242    }
243
244    /// The `BidSize` (134) field.
245    #[doc(alias = "BidSize")]
246    pub fn bid_size(&self) -> Result<Option<Decimal>, InvalidValue> {
247        self.0.get_decimal(Tag(134))
248    }
249
250    /// The `MinOfferSize` (648) field.
251    #[doc(alias = "MinOfferSize")]
252    pub fn min_offer_size(&self) -> Result<Option<Decimal>, InvalidValue> {
253        self.0.get_decimal(Tag(648))
254    }
255
256    /// The `OfferSize` (135) field.
257    #[doc(alias = "OfferSize")]
258    pub fn offer_size(&self) -> Result<Option<Decimal>, InvalidValue> {
259        self.0.get_decimal(Tag(135))
260    }
261
262    /// The `ValidUntilTime` (62) field.
263    #[doc(alias = "ValidUntilTime")]
264    pub fn valid_until_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
265        self.0.get_utc_timestamp(Tag(62))
266    }
267
268    /// The `BidSpotRate` (188) field.
269    #[doc(alias = "BidSpotRate")]
270    pub fn bid_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
271        self.0.get_decimal(Tag(188))
272    }
273
274    /// The `OfferSpotRate` (190) field.
275    #[doc(alias = "OfferSpotRate")]
276    pub fn offer_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
277        self.0.get_decimal(Tag(190))
278    }
279
280    /// The `BidForwardPoints` (189) field.
281    #[doc(alias = "BidForwardPoints")]
282    pub fn bid_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
283        self.0.get_decimal(Tag(189))
284    }
285
286    /// The `OfferForwardPoints` (191) field.
287    #[doc(alias = "OfferForwardPoints")]
288    pub fn offer_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
289        self.0.get_decimal(Tag(191))
290    }
291
292    /// The `MidPx` (631) field.
293    #[doc(alias = "MidPx")]
294    pub fn mid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
295        self.0.get_decimal(Tag(631))
296    }
297
298    /// The `BidYield` (632) field.
299    #[doc(alias = "BidYield")]
300    pub fn bid_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
301        self.0.get_decimal(Tag(632))
302    }
303
304    /// The `MidYield` (633) field.
305    #[doc(alias = "MidYield")]
306    pub fn mid_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
307        self.0.get_decimal(Tag(633))
308    }
309
310    /// The `OfferYield` (634) field.
311    #[doc(alias = "OfferYield")]
312    pub fn offer_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
313        self.0.get_decimal(Tag(634))
314    }
315
316    /// The `TransactTime` (60) field.
317    #[doc(alias = "TransactTime")]
318    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
319        self.0.get_utc_timestamp(Tag(60))
320    }
321
322    /// The `OrdType` (40) field.
323    #[doc(alias = "OrdType")]
324    pub fn ord_type(&self) -> Result<Option<OrdType<'_>>, InvalidValue> {
325        Ok(self.0.get_str(Tag(40))?.map(OrdType::from_value))
326    }
327
328    /// The `BidForwardPoints2` (642) field.
329    #[doc(alias = "BidForwardPoints2")]
330    pub fn bid_forward_points2(&self) -> Result<Option<Decimal>, InvalidValue> {
331        self.0.get_decimal(Tag(642))
332    }
333
334    /// The `OfferForwardPoints2` (643) field.
335    #[doc(alias = "OfferForwardPoints2")]
336    pub fn offer_forward_points2(&self) -> Result<Option<Decimal>, InvalidValue> {
337        self.0.get_decimal(Tag(643))
338    }
339
340    /// The `SettlCurrBidFxRate` (656) field.
341    #[doc(alias = "SettlCurrBidFxRate")]
342    pub fn settl_curr_bid_fx_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
343        self.0.get_decimal(Tag(656))
344    }
345
346    /// The `SettlCurrOfferFxRate` (657) field.
347    #[doc(alias = "SettlCurrOfferFxRate")]
348    pub fn settl_curr_offer_fx_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
349        self.0.get_decimal(Tag(657))
350    }
351
352    /// The `SettlCurrFxRateCalc` (156) field.
353    #[doc(alias = "SettlCurrFxRateCalc")]
354    pub fn settl_curr_fx_rate_calc(&self) -> Result<Option<SettlCurrFxRateCalc<'_>>, InvalidValue> {
355        Ok(self.0.get_str(Tag(156))?.map(SettlCurrFxRateCalc::from_value))
356    }
357
358    /// The `Commission` (12) field.
359    #[doc(alias = "Commission")]
360    pub fn commission(&self) -> Result<Option<Decimal>, InvalidValue> {
361        self.0.get_decimal(Tag(12))
362    }
363
364    /// The `CommType` (13) field.
365    #[doc(alias = "CommType")]
366    pub fn comm_type(&self) -> Result<Option<CommType<'_>>, InvalidValue> {
367        Ok(self.0.get_str(Tag(13))?.map(CommType::from_value))
368    }
369
370    /// The `CustOrderCapacity` (582) field.
371    #[doc(alias = "CustOrderCapacity")]
372    pub fn cust_order_capacity(&self) -> Result<Option<CustOrderCapacity>, InvalidValue> {
373        Ok(self.0.get_int(Tag(582))?.map(CustOrderCapacity::from_value))
374    }
375
376    /// The `ExDestination` (100) field.
377    #[doc(alias = "ExDestination")]
378    pub fn ex_destination(&self) -> Result<Option<&str>, InvalidValue> {
379        self.0.get_str(Tag(100))
380    }
381
382    /// The `Text` (58) field.
383    #[doc(alias = "Text")]
384    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
385        self.0.get_str(Tag(58))
386    }
387
388    /// The `EncodedTextLen` (354) field.
389    #[doc(alias = "EncodedTextLen")]
390    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
391        self.0.get_int(Tag(354))
392    }
393
394    /// The `EncodedText` (355) field.
395    #[doc(alias = "EncodedText")]
396    pub fn encoded_text(&self) -> Option<&[u8]> {
397        self.0.get(Tag(355))
398    }
399
400    /// The `Price` (44) field.
401    #[doc(alias = "Price")]
402    pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
403        self.0.get_decimal(Tag(44))
404    }
405
406    /// The `PriceType` (423) field.
407    #[doc(alias = "PriceType")]
408    pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
409        Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
410    }
411
412    /// The `SpreadOrBenchmarkCurveData` component.
413    pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'_> {
414        SpreadOrBenchmarkCurveData(self.0.scope())
415    }
416
417    /// The `YieldData` component.
418    pub fn yield_data(&self) -> YieldData<'_> {
419        YieldData(self.0.scope())
420    }
421}
422
423impl std::fmt::Debug for QuoteResponse {
424    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
425        write!(f, "QuoteResponse({})", self.0)
426    }
427}
428
429impl std::fmt::Display for QuoteResponse {
430    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
431        std::fmt::Display::fmt(&self.0, f)
432    }
433}