Skip to main content

refix_fix44/generated/messages/
market_data_snapshot_full_refresh.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5    Decimal, Instances, InvalidValue, LazyKnownTags, MultipleValues, RawMessage, Tag,
6};
7
8use super::super::components::{
9    Header, InstrmtLegGrp, Instrument, MDFullGrp, Trailer, UndInstrmtGrp,
10};
11use super::super::enums::{ApplQueueResolution, CorporateAction, FinancialStatus};
12
13/// The `MarketDataSnapshotFullRefresh` (35=W) message.
14pub struct MarketDataSnapshotFullRefresh(RawMessage);
15
16impl MarketDataSnapshotFullRefresh {
17    pub const MSG_TYPE: &[u8] = b"W";
18
19    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
20        static TAGS: LazyKnownTags = LazyKnownTags::new(
21            &[
22                Tag(262), Tag(711), Tag(555), Tag(291), Tag(292), Tag(451), Tag(268), Tag(813),
23                Tag(814),
24            ],
25            &[
26                Header::known_tags(), Trailer::known_tags(), Instrument::known_tags(),
27                UndInstrmtGrp::known_tags(), InstrmtLegGrp::known_tags(), MDFullGrp::known_tags(),
28            ],
29        );
30        &TAGS
31    }
32
33    pub fn from_raw(raw: RawMessage) -> Self {
34        Self(raw)
35    }
36
37    pub fn raw(&self) -> &RawMessage {
38        &self.0
39    }
40
41    pub fn header(&self) -> Header<'_> {
42        Header(self.0.scope(), Self::known_tags().get())
43    }
44
45    pub fn trailer(&self) -> Trailer<'_> {
46        Trailer(self.0.scope())
47    }
48
49    /// The `MDReqID` (262) field.
50    #[doc(alias = "MDReqID")]
51    pub fn md_req_id(&self) -> Result<Option<&str>, InvalidValue> {
52        self.0.get_str(Tag(262))
53    }
54
55    /// The `Instrument` component.
56    pub fn instrument(&self) -> Instrument<'_> {
57        Instrument(self.0.scope(), Self::known_tags().get())
58    }
59
60    /// The instances of the `NoUnderlyings` (711) group.
61    #[doc(alias = "NoUnderlyings")]
62    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
63        self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
64    }
65
66    /// The instances of the `NoLegs` (555) group.
67    #[doc(alias = "NoLegs")]
68    pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
69        self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
70    }
71
72    /// The `FinancialStatus` (291) field.
73    #[doc(alias = "FinancialStatus")]
74    pub fn financial_status(&self) -> Result<Option<MultipleValues<'_, FinancialStatus<'_>>>, InvalidValue> {
75        self.0.get_multiple_values(Tag(291))
76    }
77
78    /// The `CorporateAction` (292) field.
79    #[doc(alias = "CorporateAction")]
80    pub fn corporate_action(&self) -> Result<Option<MultipleValues<'_, CorporateAction<'_>>>, InvalidValue> {
81        self.0.get_multiple_values(Tag(292))
82    }
83
84    /// The `NetChgPrevDay` (451) field.
85    #[doc(alias = "NetChgPrevDay")]
86    pub fn net_chg_prev_day(&self) -> Result<Option<Decimal>, InvalidValue> {
87        self.0.get_decimal(Tag(451))
88    }
89
90    /// The instances of the `NoMDEntries` (268) group.
91    #[doc(alias = "NoMDEntries")]
92    pub fn md_entries(&self) -> Result<Instances<'_, MDFullGrp<'_>>, InvalidValue> {
93        self.0.get_group(&MDFullGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
94    }
95
96    /// The `ApplQueueDepth` (813) field.
97    #[doc(alias = "ApplQueueDepth")]
98    pub fn appl_queue_depth(&self) -> Result<Option<i64>, InvalidValue> {
99        self.0.get_int(Tag(813))
100    }
101
102    /// The `ApplQueueResolution` (814) field.
103    #[doc(alias = "ApplQueueResolution")]
104    pub fn appl_queue_resolution(&self) -> Result<Option<ApplQueueResolution>, InvalidValue> {
105        Ok(self.0.get_int(Tag(814))?.map(ApplQueueResolution::from_value))
106    }
107}
108
109impl std::fmt::Debug for MarketDataSnapshotFullRefresh {
110    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
111        write!(f, "MarketDataSnapshotFullRefresh({})", self.0)
112    }
113}
114
115impl std::fmt::Display for MarketDataSnapshotFullRefresh {
116    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
117        std::fmt::Display::fmt(&self.0, f)
118    }
119}