1#![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, PutOrCall, QuoteEntryRejectReason, QuoteRejectReason, QuoteResponseLevel, QuoteStatus,
11 SecurityType,
12};
13
14pub struct QuoteAcknowledgement(RawMessage);
16
17impl QuoteAcknowledgement {
18 pub const MSG_TYPE: &[u8] = b"b";
19
20 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
21 static TAGS: LazyKnownTags = LazyKnownTags::new(
22 &[Tag(131), Tag(117), Tag(297), Tag(300), Tag(301), Tag(336), Tag(58), Tag(296)],
23 &[
24 Header::known_tags(), Trailer::known_tags(),
25 QuoteAcknowledgementQuoteSets::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 = "QuoteReqID")]
49 pub fn quote_req_id(&self) -> Result<Option<&str>, InvalidValue> {
50 self.0.get_str(Tag(131))
51 }
52
53 #[doc(alias = "QuoteID")]
55 pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
56 self.0.get_str(Tag(117))
57 }
58
59 #[doc(alias = "QuoteStatus")]
61 pub fn quote_status(&self) -> Result<Option<QuoteStatus>, InvalidValue> {
62 Ok(self.0.get_int(Tag(297))?.map(QuoteStatus::from_value))
63 }
64
65 #[doc(alias = "QuoteRejectReason")]
67 pub fn quote_reject_reason(&self) -> Result<Option<QuoteRejectReason>, InvalidValue> {
68 Ok(self.0.get_int(Tag(300))?.map(QuoteRejectReason::from_value))
69 }
70
71 #[doc(alias = "QuoteResponseLevel")]
73 pub fn quote_response_level(&self) -> Result<Option<QuoteResponseLevel>, InvalidValue> {
74 Ok(self.0.get_int(Tag(301))?.map(QuoteResponseLevel::from_value))
75 }
76
77 #[doc(alias = "TradingSessionID")]
79 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
80 self.0.get_str(Tag(336))
81 }
82
83 #[doc(alias = "Text")]
85 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
86 self.0.get_str(Tag(58))
87 }
88
89 #[doc(alias = "NoQuoteSets")]
91 pub fn quote_sets(&self) -> Result<Instances<'_, QuoteAcknowledgementQuoteSets<'_>>, InvalidValue> {
92 self.0.get_group(&QuoteAcknowledgementQuoteSets::TABLE, &Self::known_tags().get()).map(Instances::from)
93 }
94}
95
96impl std::fmt::Debug for QuoteAcknowledgement {
97 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
98 write!(f, "QuoteAcknowledgement({})", self.0)
99 }
100}
101
102impl std::fmt::Display for QuoteAcknowledgement {
103 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
104 std::fmt::Display::fmt(&self.0, f)
105 }
106}
107
108#[derive(Clone, Copy)]
110pub struct QuoteAcknowledgementQuoteSets<'a>(refix_message::Scope<'a>);
111
112impl<'a> From<refix_message::Scope<'a>> for QuoteAcknowledgementQuoteSets<'a> {
113 fn from(scope: refix_message::Scope<'a>) -> Self {
114 Self(scope)
115 }
116}
117
118impl<'a> QuoteAcknowledgementQuoteSets<'a> {
119 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
120 Tag(296),
121 Tag(302),
122 &[
123 Tag(295), Tag(302), Tag(304), Tag(305), Tag(306), Tag(307), Tag(308), Tag(309),
124 Tag(310), Tag(311), Tag(312), Tag(313), Tag(314), Tag(315), Tag(316), Tag(317),
125 Tag(362), Tag(363), Tag(364), Tag(365), Tag(435), Tag(436),
126 ],
127 &[QuoteAcknowledgementQuoteSetsQuoteEntries::TABLE],
128 );
129
130 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
131 static TAGS: LazyKnownTags = LazyKnownTags::new(
132 &[
133 Tag(302), Tag(311), Tag(312), Tag(309), Tag(305), Tag(310), Tag(313), Tag(314),
134 Tag(315), Tag(316), Tag(317), Tag(436), Tag(435), Tag(308), Tag(306), Tag(362),
135 Tag(363), Tag(307), Tag(364), Tag(365), Tag(304), Tag(295),
136 ],
137 &[QuoteAcknowledgementQuoteSetsQuoteEntries::known_tags()],
138 );
139 &TAGS
140 }
141
142 pub fn raw(&self) -> refix_message::Scope<'a> {
143 self.0
144 }
145
146 #[doc(alias = "QuoteSetID")]
148 pub fn quote_set_id(&self) -> Result<Option<&'a str>, InvalidValue> {
149 self.0.get_str(Tag(302))
150 }
151
152 #[doc(alias = "UnderlyingSymbol")]
154 pub fn underlying_symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
155 self.0.get_str(Tag(311))
156 }
157
158 #[doc(alias = "UnderlyingSymbolSfx")]
160 pub fn underlying_symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
161 self.0.get_str(Tag(312))
162 }
163
164 #[doc(alias = "UnderlyingSecurityID")]
166 pub fn underlying_security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
167 self.0.get_str(Tag(309))
168 }
169
170 #[doc(alias = "UnderlyingIDSource")]
172 pub fn underlying_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
173 self.0.get_str(Tag(305))
174 }
175
176 #[doc(alias = "UnderlyingSecurityType")]
178 pub fn underlying_security_type(&self) -> Result<Option<&'a str>, InvalidValue> {
179 self.0.get_str(Tag(310))
180 }
181
182 #[doc(alias = "UnderlyingMaturityMonthYear")]
184 pub fn underlying_maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
185 self.0.get_month_year(Tag(313))
186 }
187
188 #[doc(alias = "UnderlyingMaturityDay")]
190 pub fn underlying_maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
191 self.0.get_int(Tag(314))
192 }
193
194 #[doc(alias = "UnderlyingPutOrCall")]
196 pub fn underlying_put_or_call(&self) -> Result<Option<i64>, InvalidValue> {
197 self.0.get_int(Tag(315))
198 }
199
200 #[doc(alias = "UnderlyingStrikePrice")]
202 pub fn underlying_strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
203 self.0.get_decimal(Tag(316))
204 }
205
206 #[doc(alias = "UnderlyingOptAttribute")]
208 pub fn underlying_opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
209 self.0.get_str(Tag(317))
210 }
211
212 #[doc(alias = "UnderlyingContractMultiplier")]
214 pub fn underlying_contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
215 self.0.get_decimal(Tag(436))
216 }
217
218 #[doc(alias = "UnderlyingCouponRate")]
220 pub fn underlying_coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
221 self.0.get_decimal(Tag(435))
222 }
223
224 #[doc(alias = "UnderlyingSecurityExchange")]
226 pub fn underlying_security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
227 self.0.get_str(Tag(308))
228 }
229
230 #[doc(alias = "UnderlyingIssuer")]
232 pub fn underlying_issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
233 self.0.get_str(Tag(306))
234 }
235
236 #[doc(alias = "EncodedUnderlyingIssuerLen")]
238 pub fn encoded_underlying_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
239 self.0.get_int(Tag(362))
240 }
241
242 #[doc(alias = "EncodedUnderlyingIssuer")]
244 pub fn encoded_underlying_issuer(&self) -> Option<&'a [u8]> {
245 self.0.get(Tag(363))
246 }
247
248 #[doc(alias = "UnderlyingSecurityDesc")]
250 pub fn underlying_security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
251 self.0.get_str(Tag(307))
252 }
253
254 #[doc(alias = "EncodedUnderlyingSecurityDescLen")]
256 pub fn encoded_underlying_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
257 self.0.get_int(Tag(364))
258 }
259
260 #[doc(alias = "EncodedUnderlyingSecurityDesc")]
262 pub fn encoded_underlying_security_desc(&self) -> Option<&'a [u8]> {
263 self.0.get(Tag(365))
264 }
265
266 #[doc(alias = "TotQuoteEntries")]
268 pub fn tot_quote_entries(&self) -> Result<Option<i64>, InvalidValue> {
269 self.0.get_int(Tag(304))
270 }
271
272 #[doc(alias = "NoQuoteEntries")]
274 pub fn quote_entries(&self) -> Result<Instances<'a, QuoteAcknowledgementQuoteSetsQuoteEntries<'a>>, InvalidValue> {
275 self.0.get_group(&QuoteAcknowledgementQuoteSetsQuoteEntries::TABLE, &Self::known_tags().get()).map(Instances::from)
276 }
277}
278
279impl std::fmt::Debug for QuoteAcknowledgementQuoteSets<'_> {
280 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
281 write!(f, "QuoteAcknowledgementQuoteSets({})", self.0)
282 }
283}
284
285#[derive(Clone, Copy)]
287pub struct QuoteAcknowledgementQuoteSetsQuoteEntries<'a>(refix_message::Scope<'a>);
288
289impl<'a> From<refix_message::Scope<'a>> for QuoteAcknowledgementQuoteSetsQuoteEntries<'a> {
290 fn from(scope: refix_message::Scope<'a>) -> Self {
291 Self(scope)
292 }
293}
294
295impl<'a> QuoteAcknowledgementQuoteSetsQuoteEntries<'a> {
296 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
297 Tag(295),
298 Tag(299),
299 &[
300 Tag(22), Tag(48), Tag(55), Tag(65), Tag(106), Tag(107), Tag(167), Tag(200), Tag(201),
301 Tag(202), Tag(205), Tag(206), Tag(207), Tag(223), Tag(231), Tag(299), Tag(348),
302 Tag(349), Tag(350), Tag(351), Tag(368),
303 ],
304 &[],
305 );
306
307 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
308 static TAGS: LazyKnownTags = LazyKnownTags::new(
309 &[
310 Tag(299), Tag(55), Tag(65), Tag(48), Tag(22), Tag(167), Tag(200), Tag(205),
311 Tag(201), Tag(202), Tag(206), Tag(231), Tag(223), Tag(207), Tag(106), Tag(348),
312 Tag(349), Tag(107), Tag(350), Tag(351), Tag(368),
313 ],
314 &[],
315 );
316 &TAGS
317 }
318
319 pub fn raw(&self) -> refix_message::Scope<'a> {
320 self.0
321 }
322
323 #[doc(alias = "QuoteEntryID")]
325 pub fn quote_entry_id(&self) -> Result<Option<&'a str>, InvalidValue> {
326 self.0.get_str(Tag(299))
327 }
328
329 #[doc(alias = "Symbol")]
331 pub fn symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
332 self.0.get_str(Tag(55))
333 }
334
335 #[doc(alias = "SymbolSfx")]
337 pub fn symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
338 self.0.get_str(Tag(65))
339 }
340
341 #[doc(alias = "SecurityID")]
343 pub fn security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
344 self.0.get_str(Tag(48))
345 }
346
347 #[doc(alias = "IDSource")]
349 pub fn id_source(&self) -> Result<Option<IDSource<'a>>, InvalidValue> {
350 Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
351 }
352
353 #[doc(alias = "SecurityType")]
355 pub fn security_type(&self) -> Result<Option<SecurityType<'a>>, InvalidValue> {
356 Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
357 }
358
359 #[doc(alias = "MaturityMonthYear")]
361 pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
362 self.0.get_month_year(Tag(200))
363 }
364
365 #[doc(alias = "MaturityDay")]
367 pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
368 self.0.get_int(Tag(205))
369 }
370
371 #[doc(alias = "PutOrCall")]
373 pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
374 Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
375 }
376
377 #[doc(alias = "StrikePrice")]
379 pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
380 self.0.get_decimal(Tag(202))
381 }
382
383 #[doc(alias = "OptAttribute")]
385 pub fn opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
386 self.0.get_str(Tag(206))
387 }
388
389 #[doc(alias = "ContractMultiplier")]
391 pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
392 self.0.get_decimal(Tag(231))
393 }
394
395 #[doc(alias = "CouponRate")]
397 pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
398 self.0.get_decimal(Tag(223))
399 }
400
401 #[doc(alias = "SecurityExchange")]
403 pub fn security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
404 self.0.get_str(Tag(207))
405 }
406
407 #[doc(alias = "Issuer")]
409 pub fn issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
410 self.0.get_str(Tag(106))
411 }
412
413 #[doc(alias = "EncodedIssuerLen")]
415 pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
416 self.0.get_int(Tag(348))
417 }
418
419 #[doc(alias = "EncodedIssuer")]
421 pub fn encoded_issuer(&self) -> Option<&'a [u8]> {
422 self.0.get(Tag(349))
423 }
424
425 #[doc(alias = "SecurityDesc")]
427 pub fn security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
428 self.0.get_str(Tag(107))
429 }
430
431 #[doc(alias = "EncodedSecurityDescLen")]
433 pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
434 self.0.get_int(Tag(350))
435 }
436
437 #[doc(alias = "EncodedSecurityDesc")]
439 pub fn encoded_security_desc(&self) -> Option<&'a [u8]> {
440 self.0.get(Tag(351))
441 }
442
443 #[doc(alias = "QuoteEntryRejectReason")]
445 pub fn quote_entry_reject_reason(&self) -> Result<Option<QuoteEntryRejectReason>, InvalidValue> {
446 Ok(self.0.get_int(Tag(368))?.map(QuoteEntryRejectReason::from_value))
447 }
448}
449
450impl std::fmt::Debug for QuoteAcknowledgementQuoteSetsQuoteEntries<'_> {
451 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
452 write!(f, "QuoteAcknowledgementQuoteSetsQuoteEntries({})", self.0)
453 }
454}