Skip to main content

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