refix_fix42/generated/messages/
market_data_request.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5 Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, MonthYear, RawMessage, Tag,
6};
7
8use super::super::components::{Header, Trailer};
9use super::super::enums::{
10 IDSource, MDEntryType, MDUpdateType, PutOrCall, SecurityType, SubscriptionRequestType,
11};
12
13pub struct MarketDataRequest(RawMessage);
15
16impl MarketDataRequest {
17 pub const MSG_TYPE: &[u8] = b"V";
18
19 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
20 static TAGS: LazyKnownTags = LazyKnownTags::new(
21 &[Tag(262), Tag(263), Tag(264), Tag(265), Tag(266), Tag(267), Tag(146)],
22 &[
23 Header::known_tags(), Trailer::known_tags(),
24 MarketDataRequestMDEntryTypes::known_tags(),
25 MarketDataRequestRelatedSym::known_tags(),
26 ],
27 );
28 &TAGS
29 }
30
31 pub fn from_raw(raw: RawMessage) -> Self {
32 Self(raw)
33 }
34
35 pub fn raw(&self) -> &RawMessage {
36 &self.0
37 }
38
39 pub fn header(&self) -> Header<'_> {
40 Header(self.0.scope())
41 }
42
43 pub fn trailer(&self) -> Trailer<'_> {
44 Trailer(self.0.scope())
45 }
46
47 #[doc(alias = "MDReqID")]
49 pub fn md_req_id(&self) -> Result<Option<&str>, InvalidValue> {
50 self.0.get_str(Tag(262))
51 }
52
53 #[doc(alias = "SubscriptionRequestType")]
55 pub fn subscription_request_type(&self) -> Result<Option<SubscriptionRequestType<'_>>, InvalidValue> {
56 Ok(self.0.get_str(Tag(263))?.map(SubscriptionRequestType::from_value))
57 }
58
59 #[doc(alias = "MarketDepth")]
61 pub fn market_depth(&self) -> Result<Option<i64>, InvalidValue> {
62 self.0.get_int(Tag(264))
63 }
64
65 #[doc(alias = "MDUpdateType")]
67 pub fn md_update_type(&self) -> Result<Option<MDUpdateType>, InvalidValue> {
68 Ok(self.0.get_int(Tag(265))?.map(MDUpdateType::from_value))
69 }
70
71 #[doc(alias = "AggregatedBook")]
73 pub fn aggregated_book(&self) -> Result<Option<bool>, InvalidValue> {
74 self.0.get_bool(Tag(266))
75 }
76
77 #[doc(alias = "NoMDEntryTypes")]
79 pub fn md_entry_types(&self) -> Result<Instances<'_, MarketDataRequestMDEntryTypes<'_>>, InvalidValue> {
80 self.0.get_group(&MarketDataRequestMDEntryTypes::TABLE, &Self::known_tags().get()).map(Instances::from)
81 }
82
83 #[doc(alias = "NoRelatedSym")]
85 pub fn related_sym(&self) -> Result<Instances<'_, MarketDataRequestRelatedSym<'_>>, InvalidValue> {
86 self.0.get_group(&MarketDataRequestRelatedSym::TABLE, &Self::known_tags().get()).map(Instances::from)
87 }
88}
89
90impl std::fmt::Debug for MarketDataRequest {
91 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
92 write!(f, "MarketDataRequest({})", self.0)
93 }
94}
95
96impl std::fmt::Display for MarketDataRequest {
97 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
98 std::fmt::Display::fmt(&self.0, f)
99 }
100}
101
102#[derive(Clone, Copy)]
104pub struct MarketDataRequestMDEntryTypes<'a>(refix_message::Scope<'a>);
105
106impl<'a> From<refix_message::Scope<'a>> for MarketDataRequestMDEntryTypes<'a> {
107 fn from(scope: refix_message::Scope<'a>) -> Self {
108 Self(scope)
109 }
110}
111
112impl<'a> MarketDataRequestMDEntryTypes<'a> {
113 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
114 Tag(267),
115 Tag(269),
116 &[Tag(269)],
117 &[],
118 );
119
120 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
121 static TAGS: LazyKnownTags = LazyKnownTags::new(&[Tag(269)], &[]);
122 &TAGS
123 }
124
125 pub fn raw(&self) -> refix_message::Scope<'a> {
126 self.0
127 }
128
129 #[doc(alias = "MDEntryType")]
131 pub fn md_entry_type(&self) -> Result<Option<MDEntryType<'a>>, InvalidValue> {
132 Ok(self.0.get_str(Tag(269))?.map(MDEntryType::from_value))
133 }
134}
135
136impl std::fmt::Debug for MarketDataRequestMDEntryTypes<'_> {
137 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
138 write!(f, "MarketDataRequestMDEntryTypes({})", self.0)
139 }
140}
141
142#[derive(Clone, Copy)]
144pub struct MarketDataRequestRelatedSym<'a>(refix_message::Scope<'a>);
145
146impl<'a> From<refix_message::Scope<'a>> for MarketDataRequestRelatedSym<'a> {
147 fn from(scope: refix_message::Scope<'a>) -> Self {
148 Self(scope)
149 }
150}
151
152impl<'a> MarketDataRequestRelatedSym<'a> {
153 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
154 Tag(146),
155 Tag(55),
156 &[
157 Tag(22), Tag(48), Tag(55), Tag(65), Tag(106), Tag(107), Tag(167), Tag(200), Tag(201),
158 Tag(202), Tag(205), Tag(206), Tag(207), Tag(223), Tag(231), Tag(336), Tag(348),
159 Tag(349), Tag(350), Tag(351),
160 ],
161 &[],
162 );
163
164 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
165 static TAGS: LazyKnownTags = LazyKnownTags::new(
166 &[
167 Tag(55), Tag(65), Tag(48), Tag(22), Tag(167), Tag(200), Tag(205), Tag(201),
168 Tag(202), Tag(206), Tag(231), Tag(223), Tag(207), Tag(106), Tag(348), Tag(349),
169 Tag(107), Tag(350), Tag(351), Tag(336),
170 ],
171 &[],
172 );
173 &TAGS
174 }
175
176 pub fn raw(&self) -> refix_message::Scope<'a> {
177 self.0
178 }
179
180 #[doc(alias = "Symbol")]
182 pub fn symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
183 self.0.get_str(Tag(55))
184 }
185
186 #[doc(alias = "SymbolSfx")]
188 pub fn symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
189 self.0.get_str(Tag(65))
190 }
191
192 #[doc(alias = "SecurityID")]
194 pub fn security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
195 self.0.get_str(Tag(48))
196 }
197
198 #[doc(alias = "IDSource")]
200 pub fn id_source(&self) -> Result<Option<IDSource<'a>>, InvalidValue> {
201 Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
202 }
203
204 #[doc(alias = "SecurityType")]
206 pub fn security_type(&self) -> Result<Option<SecurityType<'a>>, InvalidValue> {
207 Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
208 }
209
210 #[doc(alias = "MaturityMonthYear")]
212 pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
213 self.0.get_month_year(Tag(200))
214 }
215
216 #[doc(alias = "MaturityDay")]
218 pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
219 self.0.get_int(Tag(205))
220 }
221
222 #[doc(alias = "PutOrCall")]
224 pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
225 Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
226 }
227
228 #[doc(alias = "StrikePrice")]
230 pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
231 self.0.get_decimal(Tag(202))
232 }
233
234 #[doc(alias = "OptAttribute")]
236 pub fn opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
237 self.0.get_str(Tag(206))
238 }
239
240 #[doc(alias = "ContractMultiplier")]
242 pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
243 self.0.get_decimal(Tag(231))
244 }
245
246 #[doc(alias = "CouponRate")]
248 pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
249 self.0.get_decimal(Tag(223))
250 }
251
252 #[doc(alias = "SecurityExchange")]
254 pub fn security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
255 self.0.get_str(Tag(207))
256 }
257
258 #[doc(alias = "Issuer")]
260 pub fn issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
261 self.0.get_str(Tag(106))
262 }
263
264 #[doc(alias = "EncodedIssuerLen")]
266 pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
267 self.0.get_int(Tag(348))
268 }
269
270 #[doc(alias = "EncodedIssuer")]
272 pub fn encoded_issuer(&self) -> Option<&'a [u8]> {
273 self.0.get(Tag(349))
274 }
275
276 #[doc(alias = "SecurityDesc")]
278 pub fn security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
279 self.0.get_str(Tag(107))
280 }
281
282 #[doc(alias = "EncodedSecurityDescLen")]
284 pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
285 self.0.get_int(Tag(350))
286 }
287
288 #[doc(alias = "EncodedSecurityDesc")]
290 pub fn encoded_security_desc(&self) -> Option<&'a [u8]> {
291 self.0.get(Tag(351))
292 }
293
294 #[doc(alias = "TradingSessionID")]
296 pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
297 self.0.get_str(Tag(336))
298 }
299}
300
301impl std::fmt::Debug for MarketDataRequestRelatedSym<'_> {
302 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
303 write!(f, "MarketDataRequestRelatedSym({})", self.0)
304 }
305}