Skip to main content

refix_fix42/generated/messages/
mass_quote.rs

1// @generated by refix codegen from FIX42.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5    Date, Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, MonthYear, RawMessage, Tag,
6    UtcTimestamp,
7};
8
9use super::super::components::{Header, Trailer};
10use super::super::enums::{IDSource, OrdType, PutOrCall, QuoteResponseLevel, SecurityType};
11
12/// The `MassQuote` (35=i) message.
13pub struct MassQuote(RawMessage);
14
15impl MassQuote {
16    pub const MSG_TYPE: &[u8] = b"i";
17
18    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
19        static TAGS: LazyKnownTags = LazyKnownTags::new(
20            &[Tag(131), Tag(117), Tag(301), Tag(293), Tag(294), Tag(296)],
21            &[Header::known_tags(), Trailer::known_tags(), MassQuoteQuoteSets::known_tags()],
22        );
23        &TAGS
24    }
25
26    pub fn from_raw(raw: RawMessage) -> Self {
27        Self(raw)
28    }
29
30    pub fn raw(&self) -> &RawMessage {
31        &self.0
32    }
33
34    pub fn header(&self) -> Header<'_> {
35        Header(self.0.scope())
36    }
37
38    pub fn trailer(&self) -> Trailer<'_> {
39        Trailer(self.0.scope())
40    }
41
42    /// The `QuoteReqID` (131) field.
43    #[doc(alias = "QuoteReqID")]
44    pub fn quote_req_id(&self) -> Result<Option<&str>, InvalidValue> {
45        self.0.get_str(Tag(131))
46    }
47
48    /// The `QuoteID` (117) field.
49    #[doc(alias = "QuoteID")]
50    pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
51        self.0.get_str(Tag(117))
52    }
53
54    /// The `QuoteResponseLevel` (301) field.
55    #[doc(alias = "QuoteResponseLevel")]
56    pub fn quote_response_level(&self) -> Result<Option<QuoteResponseLevel>, InvalidValue> {
57        Ok(self.0.get_int(Tag(301))?.map(QuoteResponseLevel::from_value))
58    }
59
60    /// The `DefBidSize` (293) field.
61    #[doc(alias = "DefBidSize")]
62    pub fn def_bid_size(&self) -> Result<Option<Decimal>, InvalidValue> {
63        self.0.get_decimal(Tag(293))
64    }
65
66    /// The `DefOfferSize` (294) field.
67    #[doc(alias = "DefOfferSize")]
68    pub fn def_offer_size(&self) -> Result<Option<Decimal>, InvalidValue> {
69        self.0.get_decimal(Tag(294))
70    }
71
72    /// The instances of the `NoQuoteSets` (296) group.
73    #[doc(alias = "NoQuoteSets")]
74    pub fn quote_sets(&self) -> Result<Instances<'_, MassQuoteQuoteSets<'_>>, InvalidValue> {
75        self.0.get_group(&MassQuoteQuoteSets::TABLE, &Self::known_tags().get()).map(Instances::from)
76    }
77}
78
79impl std::fmt::Debug for MassQuote {
80    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
81        write!(f, "MassQuote({})", self.0)
82    }
83}
84
85impl std::fmt::Display for MassQuote {
86    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
87        std::fmt::Display::fmt(&self.0, f)
88    }
89}
90
91/// An instance of the `NoQuoteSets` (296) group.
92#[derive(Clone, Copy)]
93pub struct MassQuoteQuoteSets<'a>(refix_message::Scope<'a>);
94
95impl<'a> From<refix_message::Scope<'a>> for MassQuoteQuoteSets<'a> {
96    fn from(scope: refix_message::Scope<'a>) -> Self {
97        Self(scope)
98    }
99}
100
101impl<'a> MassQuoteQuoteSets<'a> {
102    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
103        Tag(296),
104        Tag(302),
105        &[
106            Tag(295), Tag(302), Tag(304), Tag(305), Tag(306), Tag(307), Tag(308), Tag(309),
107            Tag(310), Tag(311), Tag(312), Tag(313), Tag(314), Tag(315), Tag(316), Tag(317),
108            Tag(362), Tag(363), Tag(364), Tag(365), Tag(367), Tag(435), Tag(436),
109        ],
110        &[MassQuoteQuoteSetsQuoteEntries::TABLE],
111    );
112
113    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
114        static TAGS: LazyKnownTags = LazyKnownTags::new(
115            &[
116                Tag(302), Tag(311), Tag(312), Tag(309), Tag(305), Tag(310), Tag(313), Tag(314),
117                Tag(315), Tag(316), Tag(317), Tag(436), Tag(435), Tag(308), Tag(306), Tag(362),
118                Tag(363), Tag(307), Tag(364), Tag(365), Tag(367), Tag(304), Tag(295),
119            ],
120            &[MassQuoteQuoteSetsQuoteEntries::known_tags()],
121        );
122        &TAGS
123    }
124
125    pub fn raw(&self) -> refix_message::Scope<'a> {
126        self.0
127    }
128
129    /// The `QuoteSetID` (302) field.
130    #[doc(alias = "QuoteSetID")]
131    pub fn quote_set_id(&self) -> Result<Option<&'a str>, InvalidValue> {
132        self.0.get_str(Tag(302))
133    }
134
135    /// The `UnderlyingSymbol` (311) field.
136    #[doc(alias = "UnderlyingSymbol")]
137    pub fn underlying_symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
138        self.0.get_str(Tag(311))
139    }
140
141    /// The `UnderlyingSymbolSfx` (312) field.
142    #[doc(alias = "UnderlyingSymbolSfx")]
143    pub fn underlying_symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
144        self.0.get_str(Tag(312))
145    }
146
147    /// The `UnderlyingSecurityID` (309) field.
148    #[doc(alias = "UnderlyingSecurityID")]
149    pub fn underlying_security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
150        self.0.get_str(Tag(309))
151    }
152
153    /// The `UnderlyingIDSource` (305) field.
154    #[doc(alias = "UnderlyingIDSource")]
155    pub fn underlying_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
156        self.0.get_str(Tag(305))
157    }
158
159    /// The `UnderlyingSecurityType` (310) field.
160    #[doc(alias = "UnderlyingSecurityType")]
161    pub fn underlying_security_type(&self) -> Result<Option<&'a str>, InvalidValue> {
162        self.0.get_str(Tag(310))
163    }
164
165    /// The `UnderlyingMaturityMonthYear` (313) field.
166    #[doc(alias = "UnderlyingMaturityMonthYear")]
167    pub fn underlying_maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
168        self.0.get_month_year(Tag(313))
169    }
170
171    /// The `UnderlyingMaturityDay` (314) field.
172    #[doc(alias = "UnderlyingMaturityDay")]
173    pub fn underlying_maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
174        self.0.get_int(Tag(314))
175    }
176
177    /// The `UnderlyingPutOrCall` (315) field.
178    #[doc(alias = "UnderlyingPutOrCall")]
179    pub fn underlying_put_or_call(&self) -> Result<Option<i64>, InvalidValue> {
180        self.0.get_int(Tag(315))
181    }
182
183    /// The `UnderlyingStrikePrice` (316) field.
184    #[doc(alias = "UnderlyingStrikePrice")]
185    pub fn underlying_strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
186        self.0.get_decimal(Tag(316))
187    }
188
189    /// The `UnderlyingOptAttribute` (317) field.
190    #[doc(alias = "UnderlyingOptAttribute")]
191    pub fn underlying_opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
192        self.0.get_str(Tag(317))
193    }
194
195    /// The `UnderlyingContractMultiplier` (436) field.
196    #[doc(alias = "UnderlyingContractMultiplier")]
197    pub fn underlying_contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
198        self.0.get_decimal(Tag(436))
199    }
200
201    /// The `UnderlyingCouponRate` (435) field.
202    #[doc(alias = "UnderlyingCouponRate")]
203    pub fn underlying_coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
204        self.0.get_decimal(Tag(435))
205    }
206
207    /// The `UnderlyingSecurityExchange` (308) field.
208    #[doc(alias = "UnderlyingSecurityExchange")]
209    pub fn underlying_security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
210        self.0.get_str(Tag(308))
211    }
212
213    /// The `UnderlyingIssuer` (306) field.
214    #[doc(alias = "UnderlyingIssuer")]
215    pub fn underlying_issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
216        self.0.get_str(Tag(306))
217    }
218
219    /// The `EncodedUnderlyingIssuerLen` (362) field.
220    #[doc(alias = "EncodedUnderlyingIssuerLen")]
221    pub fn encoded_underlying_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
222        self.0.get_int(Tag(362))
223    }
224
225    /// The `EncodedUnderlyingIssuer` (363) field.
226    #[doc(alias = "EncodedUnderlyingIssuer")]
227    pub fn encoded_underlying_issuer(&self) -> Option<&'a [u8]> {
228        self.0.get(Tag(363))
229    }
230
231    /// The `UnderlyingSecurityDesc` (307) field.
232    #[doc(alias = "UnderlyingSecurityDesc")]
233    pub fn underlying_security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
234        self.0.get_str(Tag(307))
235    }
236
237    /// The `EncodedUnderlyingSecurityDescLen` (364) field.
238    #[doc(alias = "EncodedUnderlyingSecurityDescLen")]
239    pub fn encoded_underlying_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
240        self.0.get_int(Tag(364))
241    }
242
243    /// The `EncodedUnderlyingSecurityDesc` (365) field.
244    #[doc(alias = "EncodedUnderlyingSecurityDesc")]
245    pub fn encoded_underlying_security_desc(&self) -> Option<&'a [u8]> {
246        self.0.get(Tag(365))
247    }
248
249    /// The `QuoteSetValidUntilTime` (367) field.
250    #[doc(alias = "QuoteSetValidUntilTime")]
251    pub fn quote_set_valid_until_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
252        self.0.get_utc_timestamp(Tag(367))
253    }
254
255    /// The `TotQuoteEntries` (304) field.
256    #[doc(alias = "TotQuoteEntries")]
257    pub fn tot_quote_entries(&self) -> Result<Option<i64>, InvalidValue> {
258        self.0.get_int(Tag(304))
259    }
260
261    /// The instances of the `NoQuoteEntries` (295) group.
262    #[doc(alias = "NoQuoteEntries")]
263    pub fn quote_entries(&self) -> Result<Instances<'a, MassQuoteQuoteSetsQuoteEntries<'a>>, InvalidValue> {
264        self.0.get_group(&MassQuoteQuoteSetsQuoteEntries::TABLE, &Self::known_tags().get()).map(Instances::from)
265    }
266}
267
268impl std::fmt::Debug for MassQuoteQuoteSets<'_> {
269    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
270        write!(f, "MassQuoteQuoteSets({})", self.0)
271    }
272}
273
274/// An instance of the `NoQuoteEntries` (295) group.
275#[derive(Clone, Copy)]
276pub struct MassQuoteQuoteSetsQuoteEntries<'a>(refix_message::Scope<'a>);
277
278impl<'a> From<refix_message::Scope<'a>> for MassQuoteQuoteSetsQuoteEntries<'a> {
279    fn from(scope: refix_message::Scope<'a>) -> Self {
280        Self(scope)
281    }
282}
283
284impl<'a> MassQuoteQuoteSetsQuoteEntries<'a> {
285    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
286        Tag(295),
287        Tag(299),
288        &[
289            Tag(15), Tag(22), Tag(40), Tag(48), Tag(55), Tag(60), Tag(62), Tag(64), Tag(65),
290            Tag(106), Tag(107), Tag(132), Tag(133), Tag(134), Tag(135), Tag(167), Tag(188),
291            Tag(189), Tag(190), Tag(191), Tag(192), Tag(193), Tag(200), Tag(201), Tag(202),
292            Tag(205), Tag(206), Tag(207), Tag(223), Tag(231), Tag(299), Tag(336), Tag(348),
293            Tag(349), Tag(350), Tag(351),
294        ],
295        &[],
296    );
297
298    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
299        static TAGS: LazyKnownTags = LazyKnownTags::new(
300            &[
301                Tag(299), Tag(55), Tag(65), Tag(48), Tag(22), Tag(167), Tag(200), Tag(205),
302                Tag(201), Tag(202), Tag(206), Tag(231), Tag(223), Tag(207), Tag(106), Tag(348),
303                Tag(349), Tag(107), Tag(350), Tag(351), Tag(132), Tag(133), Tag(134), Tag(135),
304                Tag(62), Tag(188), Tag(190), Tag(189), Tag(191), Tag(60), Tag(336), Tag(64),
305                Tag(40), Tag(193), Tag(192), Tag(15),
306            ],
307            &[],
308        );
309        &TAGS
310    }
311
312    pub fn raw(&self) -> refix_message::Scope<'a> {
313        self.0
314    }
315
316    /// The `QuoteEntryID` (299) field.
317    #[doc(alias = "QuoteEntryID")]
318    pub fn quote_entry_id(&self) -> Result<Option<&'a str>, InvalidValue> {
319        self.0.get_str(Tag(299))
320    }
321
322    /// The `Symbol` (55) field.
323    #[doc(alias = "Symbol")]
324    pub fn symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
325        self.0.get_str(Tag(55))
326    }
327
328    /// The `SymbolSfx` (65) field.
329    #[doc(alias = "SymbolSfx")]
330    pub fn symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
331        self.0.get_str(Tag(65))
332    }
333
334    /// The `SecurityID` (48) field.
335    #[doc(alias = "SecurityID")]
336    pub fn security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
337        self.0.get_str(Tag(48))
338    }
339
340    /// The `IDSource` (22) field.
341    #[doc(alias = "IDSource")]
342    pub fn id_source(&self) -> Result<Option<IDSource<'a>>, InvalidValue> {
343        Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
344    }
345
346    /// The `SecurityType` (167) field.
347    #[doc(alias = "SecurityType")]
348    pub fn security_type(&self) -> Result<Option<SecurityType<'a>>, InvalidValue> {
349        Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
350    }
351
352    /// The `MaturityMonthYear` (200) field.
353    #[doc(alias = "MaturityMonthYear")]
354    pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
355        self.0.get_month_year(Tag(200))
356    }
357
358    /// The `MaturityDay` (205) field.
359    #[doc(alias = "MaturityDay")]
360    pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
361        self.0.get_int(Tag(205))
362    }
363
364    /// The `PutOrCall` (201) field.
365    #[doc(alias = "PutOrCall")]
366    pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
367        Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
368    }
369
370    /// The `StrikePrice` (202) field.
371    #[doc(alias = "StrikePrice")]
372    pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
373        self.0.get_decimal(Tag(202))
374    }
375
376    /// The `OptAttribute` (206) field.
377    #[doc(alias = "OptAttribute")]
378    pub fn opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
379        self.0.get_str(Tag(206))
380    }
381
382    /// The `ContractMultiplier` (231) field.
383    #[doc(alias = "ContractMultiplier")]
384    pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
385        self.0.get_decimal(Tag(231))
386    }
387
388    /// The `CouponRate` (223) field.
389    #[doc(alias = "CouponRate")]
390    pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
391        self.0.get_decimal(Tag(223))
392    }
393
394    /// The `SecurityExchange` (207) field.
395    #[doc(alias = "SecurityExchange")]
396    pub fn security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
397        self.0.get_str(Tag(207))
398    }
399
400    /// The `Issuer` (106) field.
401    #[doc(alias = "Issuer")]
402    pub fn issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
403        self.0.get_str(Tag(106))
404    }
405
406    /// The `EncodedIssuerLen` (348) field.
407    #[doc(alias = "EncodedIssuerLen")]
408    pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
409        self.0.get_int(Tag(348))
410    }
411
412    /// The `EncodedIssuer` (349) field.
413    #[doc(alias = "EncodedIssuer")]
414    pub fn encoded_issuer(&self) -> Option<&'a [u8]> {
415        self.0.get(Tag(349))
416    }
417
418    /// The `SecurityDesc` (107) field.
419    #[doc(alias = "SecurityDesc")]
420    pub fn security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
421        self.0.get_str(Tag(107))
422    }
423
424    /// The `EncodedSecurityDescLen` (350) field.
425    #[doc(alias = "EncodedSecurityDescLen")]
426    pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
427        self.0.get_int(Tag(350))
428    }
429
430    /// The `EncodedSecurityDesc` (351) field.
431    #[doc(alias = "EncodedSecurityDesc")]
432    pub fn encoded_security_desc(&self) -> Option<&'a [u8]> {
433        self.0.get(Tag(351))
434    }
435
436    /// The `BidPx` (132) field.
437    #[doc(alias = "BidPx")]
438    pub fn bid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
439        self.0.get_decimal(Tag(132))
440    }
441
442    /// The `OfferPx` (133) field.
443    #[doc(alias = "OfferPx")]
444    pub fn offer_px(&self) -> Result<Option<Decimal>, InvalidValue> {
445        self.0.get_decimal(Tag(133))
446    }
447
448    /// The `BidSize` (134) field.
449    #[doc(alias = "BidSize")]
450    pub fn bid_size(&self) -> Result<Option<Decimal>, InvalidValue> {
451        self.0.get_decimal(Tag(134))
452    }
453
454    /// The `OfferSize` (135) field.
455    #[doc(alias = "OfferSize")]
456    pub fn offer_size(&self) -> Result<Option<Decimal>, InvalidValue> {
457        self.0.get_decimal(Tag(135))
458    }
459
460    /// The `ValidUntilTime` (62) field.
461    #[doc(alias = "ValidUntilTime")]
462    pub fn valid_until_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
463        self.0.get_utc_timestamp(Tag(62))
464    }
465
466    /// The `BidSpotRate` (188) field.
467    #[doc(alias = "BidSpotRate")]
468    pub fn bid_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
469        self.0.get_decimal(Tag(188))
470    }
471
472    /// The `OfferSpotRate` (190) field.
473    #[doc(alias = "OfferSpotRate")]
474    pub fn offer_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
475        self.0.get_decimal(Tag(190))
476    }
477
478    /// The `BidForwardPoints` (189) field.
479    #[doc(alias = "BidForwardPoints")]
480    pub fn bid_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
481        self.0.get_decimal(Tag(189))
482    }
483
484    /// The `OfferForwardPoints` (191) field.
485    #[doc(alias = "OfferForwardPoints")]
486    pub fn offer_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
487        self.0.get_decimal(Tag(191))
488    }
489
490    /// The `TransactTime` (60) field.
491    #[doc(alias = "TransactTime")]
492    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
493        self.0.get_utc_timestamp(Tag(60))
494    }
495
496    /// The `TradingSessionID` (336) field.
497    #[doc(alias = "TradingSessionID")]
498    pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
499        self.0.get_str(Tag(336))
500    }
501
502    /// The `FutSettDate` (64) field.
503    #[doc(alias = "FutSettDate")]
504    pub fn fut_sett_date(&self) -> Result<Option<Date>, InvalidValue> {
505        self.0.get_date(Tag(64))
506    }
507
508    /// The `OrdType` (40) field.
509    #[doc(alias = "OrdType")]
510    pub fn ord_type(&self) -> Result<Option<OrdType<'a>>, InvalidValue> {
511        Ok(self.0.get_str(Tag(40))?.map(OrdType::from_value))
512    }
513
514    /// The `FutSettDate2` (193) field.
515    #[doc(alias = "FutSettDate2")]
516    pub fn fut_sett_date2(&self) -> Result<Option<Date>, InvalidValue> {
517        self.0.get_date(Tag(193))
518    }
519
520    /// The `OrderQty2` (192) field.
521    #[doc(alias = "OrderQty2")]
522    pub fn order_qty2(&self) -> Result<Option<Decimal>, InvalidValue> {
523        self.0.get_decimal(Tag(192))
524    }
525
526    /// The `Currency` (15) field.
527    #[doc(alias = "Currency")]
528    pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
529        self.0.get_str(Tag(15))
530    }
531}
532
533impl std::fmt::Debug for MassQuoteQuoteSetsQuoteEntries<'_> {
534    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
535        write!(f, "MassQuoteQuoteSetsQuoteEntries({})", self.0)
536    }
537}