Skip to main content

refix_fix42/generated/messages/
market_data_snapshot_full_refresh.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, MultipleValues,
6    RawMessage, Tag, Time, UtcTimestamp,
7};
8
9use super::super::components::{Header, Trailer};
10use super::super::enums::{
11    CorporateAction, ExecInst, FinancialStatus, IDSource, MDEntryType, OpenCloseSettleFlag,
12    PutOrCall, QuoteCondition, SecurityType, TickDirection, TimeInForce, TradeCondition,
13};
14
15/// The `MarketDataSnapshotFullRefresh` (35=W) message.
16pub struct MarketDataSnapshotFullRefresh(RawMessage);
17
18impl MarketDataSnapshotFullRefresh {
19    pub const MSG_TYPE: &[u8] = b"W";
20
21    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
22        static TAGS: LazyKnownTags = LazyKnownTags::new(
23            &[
24                Tag(262), Tag(55), Tag(65), Tag(48), Tag(22), Tag(167), Tag(200), Tag(205),
25                Tag(201), Tag(202), Tag(206), Tag(231), Tag(223), Tag(207), Tag(106), Tag(348),
26                Tag(349), Tag(107), Tag(350), Tag(351), Tag(291), Tag(292), Tag(387), Tag(268),
27            ],
28            &[
29                Header::known_tags(), Trailer::known_tags(),
30                MarketDataSnapshotFullRefreshMDEntries::known_tags(),
31            ],
32        );
33        &TAGS
34    }
35
36    pub fn from_raw(raw: RawMessage) -> Self {
37        Self(raw)
38    }
39
40    pub fn raw(&self) -> &RawMessage {
41        &self.0
42    }
43
44    pub fn header(&self) -> Header<'_> {
45        Header(self.0.scope())
46    }
47
48    pub fn trailer(&self) -> Trailer<'_> {
49        Trailer(self.0.scope())
50    }
51
52    /// The `MDReqID` (262) field.
53    #[doc(alias = "MDReqID")]
54    pub fn md_req_id(&self) -> Result<Option<&str>, InvalidValue> {
55        self.0.get_str(Tag(262))
56    }
57
58    /// The `Symbol` (55) field.
59    #[doc(alias = "Symbol")]
60    pub fn symbol(&self) -> Result<Option<&str>, InvalidValue> {
61        self.0.get_str(Tag(55))
62    }
63
64    /// The `SymbolSfx` (65) field.
65    #[doc(alias = "SymbolSfx")]
66    pub fn symbol_sfx(&self) -> Result<Option<&str>, InvalidValue> {
67        self.0.get_str(Tag(65))
68    }
69
70    /// The `SecurityID` (48) field.
71    #[doc(alias = "SecurityID")]
72    pub fn security_id(&self) -> Result<Option<&str>, InvalidValue> {
73        self.0.get_str(Tag(48))
74    }
75
76    /// The `IDSource` (22) field.
77    #[doc(alias = "IDSource")]
78    pub fn id_source(&self) -> Result<Option<IDSource<'_>>, InvalidValue> {
79        Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
80    }
81
82    /// The `SecurityType` (167) field.
83    #[doc(alias = "SecurityType")]
84    pub fn security_type(&self) -> Result<Option<SecurityType<'_>>, InvalidValue> {
85        Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
86    }
87
88    /// The `MaturityMonthYear` (200) field.
89    #[doc(alias = "MaturityMonthYear")]
90    pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
91        self.0.get_month_year(Tag(200))
92    }
93
94    /// The `MaturityDay` (205) field.
95    #[doc(alias = "MaturityDay")]
96    pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
97        self.0.get_int(Tag(205))
98    }
99
100    /// The `PutOrCall` (201) field.
101    #[doc(alias = "PutOrCall")]
102    pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
103        Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
104    }
105
106    /// The `StrikePrice` (202) field.
107    #[doc(alias = "StrikePrice")]
108    pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
109        self.0.get_decimal(Tag(202))
110    }
111
112    /// The `OptAttribute` (206) field.
113    #[doc(alias = "OptAttribute")]
114    pub fn opt_attribute(&self) -> Result<Option<&str>, InvalidValue> {
115        self.0.get_str(Tag(206))
116    }
117
118    /// The `ContractMultiplier` (231) field.
119    #[doc(alias = "ContractMultiplier")]
120    pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
121        self.0.get_decimal(Tag(231))
122    }
123
124    /// The `CouponRate` (223) field.
125    #[doc(alias = "CouponRate")]
126    pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
127        self.0.get_decimal(Tag(223))
128    }
129
130    /// The `SecurityExchange` (207) field.
131    #[doc(alias = "SecurityExchange")]
132    pub fn security_exchange(&self) -> Result<Option<&str>, InvalidValue> {
133        self.0.get_str(Tag(207))
134    }
135
136    /// The `Issuer` (106) field.
137    #[doc(alias = "Issuer")]
138    pub fn issuer(&self) -> Result<Option<&str>, InvalidValue> {
139        self.0.get_str(Tag(106))
140    }
141
142    /// The `EncodedIssuerLen` (348) field.
143    #[doc(alias = "EncodedIssuerLen")]
144    pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
145        self.0.get_int(Tag(348))
146    }
147
148    /// The `EncodedIssuer` (349) field.
149    #[doc(alias = "EncodedIssuer")]
150    pub fn encoded_issuer(&self) -> Option<&[u8]> {
151        self.0.get(Tag(349))
152    }
153
154    /// The `SecurityDesc` (107) field.
155    #[doc(alias = "SecurityDesc")]
156    pub fn security_desc(&self) -> Result<Option<&str>, InvalidValue> {
157        self.0.get_str(Tag(107))
158    }
159
160    /// The `EncodedSecurityDescLen` (350) field.
161    #[doc(alias = "EncodedSecurityDescLen")]
162    pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
163        self.0.get_int(Tag(350))
164    }
165
166    /// The `EncodedSecurityDesc` (351) field.
167    #[doc(alias = "EncodedSecurityDesc")]
168    pub fn encoded_security_desc(&self) -> Option<&[u8]> {
169        self.0.get(Tag(351))
170    }
171
172    /// The `FinancialStatus` (291) field.
173    #[doc(alias = "FinancialStatus")]
174    pub fn financial_status(&self) -> Result<Option<FinancialStatus<'_>>, InvalidValue> {
175        Ok(self.0.get_str(Tag(291))?.map(FinancialStatus::from_value))
176    }
177
178    /// The `CorporateAction` (292) field.
179    #[doc(alias = "CorporateAction")]
180    pub fn corporate_action(&self) -> Result<Option<CorporateAction<'_>>, InvalidValue> {
181        Ok(self.0.get_str(Tag(292))?.map(CorporateAction::from_value))
182    }
183
184    /// The `TotalVolumeTraded` (387) field.
185    #[doc(alias = "TotalVolumeTraded")]
186    pub fn total_volume_traded(&self) -> Result<Option<Decimal>, InvalidValue> {
187        self.0.get_decimal(Tag(387))
188    }
189
190    /// The instances of the `NoMDEntries` (268) group.
191    #[doc(alias = "NoMDEntries")]
192    pub fn md_entries(&self) -> Result<Instances<'_, MarketDataSnapshotFullRefreshMDEntries<'_>>, InvalidValue> {
193        self.0.get_group(&MarketDataSnapshotFullRefreshMDEntries::TABLE, &Self::known_tags().get()).map(Instances::from)
194    }
195}
196
197impl std::fmt::Debug for MarketDataSnapshotFullRefresh {
198    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
199        write!(f, "MarketDataSnapshotFullRefresh({})", self.0)
200    }
201}
202
203impl std::fmt::Display for MarketDataSnapshotFullRefresh {
204    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
205        std::fmt::Display::fmt(&self.0, f)
206    }
207}
208
209/// An instance of the `NoMDEntries` (268) group.
210#[derive(Clone, Copy)]
211pub struct MarketDataSnapshotFullRefreshMDEntries<'a>(refix_message::Scope<'a>);
212
213impl<'a> From<refix_message::Scope<'a>> for MarketDataSnapshotFullRefreshMDEntries<'a> {
214    fn from(scope: refix_message::Scope<'a>) -> Self {
215        Self(scope)
216    }
217}
218
219impl<'a> MarketDataSnapshotFullRefreshMDEntries<'a> {
220    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
221        Tag(268),
222        Tag(269),
223        &[
224            Tag(15), Tag(18), Tag(37), Tag(58), Tag(59), Tag(110), Tag(126), Tag(269), Tag(270),
225            Tag(271), Tag(272), Tag(273), Tag(274), Tag(275), Tag(276), Tag(277), Tag(282),
226            Tag(283), Tag(284), Tag(286), Tag(287), Tag(288), Tag(289), Tag(290), Tag(299),
227            Tag(336), Tag(346), Tag(354), Tag(355), Tag(432),
228        ],
229        &[],
230    );
231
232    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
233        static TAGS: LazyKnownTags = LazyKnownTags::new(
234            &[
235                Tag(269), Tag(270), Tag(15), Tag(271), Tag(272), Tag(273), Tag(274), Tag(275),
236                Tag(336), Tag(276), Tag(277), Tag(282), Tag(283), Tag(284), Tag(286), Tag(59),
237                Tag(432), Tag(126), Tag(110), Tag(18), Tag(287), Tag(37), Tag(299), Tag(288),
238                Tag(289), Tag(346), Tag(290), Tag(58), Tag(354), Tag(355),
239            ],
240            &[],
241        );
242        &TAGS
243    }
244
245    pub fn raw(&self) -> refix_message::Scope<'a> {
246        self.0
247    }
248
249    /// The `MDEntryType` (269) field.
250    #[doc(alias = "MDEntryType")]
251    pub fn md_entry_type(&self) -> Result<Option<MDEntryType<'a>>, InvalidValue> {
252        Ok(self.0.get_str(Tag(269))?.map(MDEntryType::from_value))
253    }
254
255    /// The `MDEntryPx` (270) field.
256    #[doc(alias = "MDEntryPx")]
257    pub fn md_entry_px(&self) -> Result<Option<Decimal>, InvalidValue> {
258        self.0.get_decimal(Tag(270))
259    }
260
261    /// The `Currency` (15) field.
262    #[doc(alias = "Currency")]
263    pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
264        self.0.get_str(Tag(15))
265    }
266
267    /// The `MDEntrySize` (271) field.
268    #[doc(alias = "MDEntrySize")]
269    pub fn md_entry_size(&self) -> Result<Option<Decimal>, InvalidValue> {
270        self.0.get_decimal(Tag(271))
271    }
272
273    /// The `MDEntryDate` (272) field.
274    #[doc(alias = "MDEntryDate")]
275    pub fn md_entry_date(&self) -> Result<Option<Date>, InvalidValue> {
276        self.0.get_date(Tag(272))
277    }
278
279    /// The `MDEntryTime` (273) field.
280    #[doc(alias = "MDEntryTime")]
281    pub fn md_entry_time(&self) -> Result<Option<Time>, InvalidValue> {
282        self.0.get_time(Tag(273))
283    }
284
285    /// The `TickDirection` (274) field.
286    #[doc(alias = "TickDirection")]
287    pub fn tick_direction(&self) -> Result<Option<TickDirection<'a>>, InvalidValue> {
288        Ok(self.0.get_str(Tag(274))?.map(TickDirection::from_value))
289    }
290
291    /// The `MDMkt` (275) field.
292    #[doc(alias = "MDMkt")]
293    pub fn md_mkt(&self) -> Result<Option<&'a str>, InvalidValue> {
294        self.0.get_str(Tag(275))
295    }
296
297    /// The `TradingSessionID` (336) field.
298    #[doc(alias = "TradingSessionID")]
299    pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
300        self.0.get_str(Tag(336))
301    }
302
303    /// The `QuoteCondition` (276) field.
304    #[doc(alias = "QuoteCondition")]
305    pub fn quote_condition(&self) -> Result<Option<MultipleValues<'a, QuoteCondition<'a>>>, InvalidValue> {
306        self.0.get_multiple_values(Tag(276))
307    }
308
309    /// The `TradeCondition` (277) field.
310    #[doc(alias = "TradeCondition")]
311    pub fn trade_condition(&self) -> Result<Option<MultipleValues<'a, TradeCondition<'a>>>, InvalidValue> {
312        self.0.get_multiple_values(Tag(277))
313    }
314
315    /// The `MDEntryOriginator` (282) field.
316    #[doc(alias = "MDEntryOriginator")]
317    pub fn md_entry_originator(&self) -> Result<Option<&'a str>, InvalidValue> {
318        self.0.get_str(Tag(282))
319    }
320
321    /// The `LocationID` (283) field.
322    #[doc(alias = "LocationID")]
323    pub fn location_id(&self) -> Result<Option<&'a str>, InvalidValue> {
324        self.0.get_str(Tag(283))
325    }
326
327    /// The `DeskID` (284) field.
328    #[doc(alias = "DeskID")]
329    pub fn desk_id(&self) -> Result<Option<&'a str>, InvalidValue> {
330        self.0.get_str(Tag(284))
331    }
332
333    /// The `OpenCloseSettleFlag` (286) field.
334    #[doc(alias = "OpenCloseSettleFlag")]
335    pub fn open_close_settle_flag(&self) -> Result<Option<OpenCloseSettleFlag<'a>>, InvalidValue> {
336        Ok(self.0.get_str(Tag(286))?.map(OpenCloseSettleFlag::from_value))
337    }
338
339    /// The `TimeInForce` (59) field.
340    #[doc(alias = "TimeInForce")]
341    pub fn time_in_force(&self) -> Result<Option<TimeInForce<'a>>, InvalidValue> {
342        Ok(self.0.get_str(Tag(59))?.map(TimeInForce::from_value))
343    }
344
345    /// The `ExpireDate` (432) field.
346    #[doc(alias = "ExpireDate")]
347    pub fn expire_date(&self) -> Result<Option<Date>, InvalidValue> {
348        self.0.get_date(Tag(432))
349    }
350
351    /// The `ExpireTime` (126) field.
352    #[doc(alias = "ExpireTime")]
353    pub fn expire_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
354        self.0.get_utc_timestamp(Tag(126))
355    }
356
357    /// The `MinQty` (110) field.
358    #[doc(alias = "MinQty")]
359    pub fn min_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
360        self.0.get_decimal(Tag(110))
361    }
362
363    /// The `ExecInst` (18) field.
364    #[doc(alias = "ExecInst")]
365    pub fn exec_inst(&self) -> Result<Option<MultipleValues<'a, ExecInst<'a>>>, InvalidValue> {
366        self.0.get_multiple_values(Tag(18))
367    }
368
369    /// The `SellerDays` (287) field.
370    #[doc(alias = "SellerDays")]
371    pub fn seller_days(&self) -> Result<Option<i64>, InvalidValue> {
372        self.0.get_int(Tag(287))
373    }
374
375    /// The `OrderID` (37) field.
376    #[doc(alias = "OrderID")]
377    pub fn order_id(&self) -> Result<Option<&'a str>, InvalidValue> {
378        self.0.get_str(Tag(37))
379    }
380
381    /// The `QuoteEntryID` (299) field.
382    #[doc(alias = "QuoteEntryID")]
383    pub fn quote_entry_id(&self) -> Result<Option<&'a str>, InvalidValue> {
384        self.0.get_str(Tag(299))
385    }
386
387    /// The `MDEntryBuyer` (288) field.
388    #[doc(alias = "MDEntryBuyer")]
389    pub fn md_entry_buyer(&self) -> Result<Option<&'a str>, InvalidValue> {
390        self.0.get_str(Tag(288))
391    }
392
393    /// The `MDEntrySeller` (289) field.
394    #[doc(alias = "MDEntrySeller")]
395    pub fn md_entry_seller(&self) -> Result<Option<&'a str>, InvalidValue> {
396        self.0.get_str(Tag(289))
397    }
398
399    /// The `NumberOfOrders` (346) field.
400    #[doc(alias = "NumberOfOrders")]
401    pub fn number_of_orders(&self) -> Result<Option<i64>, InvalidValue> {
402        self.0.get_int(Tag(346))
403    }
404
405    /// The `MDEntryPositionNo` (290) field.
406    #[doc(alias = "MDEntryPositionNo")]
407    pub fn md_entry_position_no(&self) -> Result<Option<i64>, InvalidValue> {
408        self.0.get_int(Tag(290))
409    }
410
411    /// The `Text` (58) field.
412    #[doc(alias = "Text")]
413    pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
414        self.0.get_str(Tag(58))
415    }
416
417    /// The `EncodedTextLen` (354) field.
418    #[doc(alias = "EncodedTextLen")]
419    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
420        self.0.get_int(Tag(354))
421    }
422
423    /// The `EncodedText` (355) field.
424    #[doc(alias = "EncodedText")]
425    pub fn encoded_text(&self) -> Option<&'a [u8]> {
426        self.0.get(Tag(355))
427    }
428}
429
430impl std::fmt::Debug for MarketDataSnapshotFullRefreshMDEntries<'_> {
431    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
432        write!(f, "MarketDataSnapshotFullRefreshMDEntries({})", self.0)
433    }
434}