Skip to main content

refix_fix42/generated/messages/
quote_cancel.rs

1// @generated by refix codegen from FIX42.xml. Do not edit.
2#![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::{IDSource, PutOrCall, QuoteCancelType, QuoteResponseLevel, SecurityType};
10
11/// The `QuoteCancel` (35=Z) message.
12pub struct QuoteCancel(RawMessage);
13
14impl QuoteCancel {
15    pub const MSG_TYPE: &[u8] = b"Z";
16
17    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
18        static TAGS: LazyKnownTags = LazyKnownTags::new(
19            &[Tag(131), Tag(117), Tag(298), Tag(301), Tag(336), Tag(295)],
20            &[Header::known_tags(), Trailer::known_tags(), QuoteCancelQuoteEntries::known_tags()],
21        );
22        &TAGS
23    }
24
25    pub fn from_raw(raw: RawMessage) -> Self {
26        Self(raw)
27    }
28
29    pub fn raw(&self) -> &RawMessage {
30        &self.0
31    }
32
33    pub fn header(&self) -> Header<'_> {
34        Header(self.0.scope())
35    }
36
37    pub fn trailer(&self) -> Trailer<'_> {
38        Trailer(self.0.scope())
39    }
40
41    /// The `QuoteReqID` (131) field.
42    #[doc(alias = "QuoteReqID")]
43    pub fn quote_req_id(&self) -> Result<Option<&str>, InvalidValue> {
44        self.0.get_str(Tag(131))
45    }
46
47    /// The `QuoteID` (117) field.
48    #[doc(alias = "QuoteID")]
49    pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
50        self.0.get_str(Tag(117))
51    }
52
53    /// The `QuoteCancelType` (298) field.
54    #[doc(alias = "QuoteCancelType")]
55    pub fn quote_cancel_type(&self) -> Result<Option<QuoteCancelType>, InvalidValue> {
56        Ok(self.0.get_int(Tag(298))?.map(QuoteCancelType::from_value))
57    }
58
59    /// The `QuoteResponseLevel` (301) field.
60    #[doc(alias = "QuoteResponseLevel")]
61    pub fn quote_response_level(&self) -> Result<Option<QuoteResponseLevel>, InvalidValue> {
62        Ok(self.0.get_int(Tag(301))?.map(QuoteResponseLevel::from_value))
63    }
64
65    /// The `TradingSessionID` (336) field.
66    #[doc(alias = "TradingSessionID")]
67    pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
68        self.0.get_str(Tag(336))
69    }
70
71    /// The instances of the `NoQuoteEntries` (295) group.
72    #[doc(alias = "NoQuoteEntries")]
73    pub fn quote_entries(&self) -> Result<Instances<'_, QuoteCancelQuoteEntries<'_>>, InvalidValue> {
74        self.0.get_group(&QuoteCancelQuoteEntries::TABLE, &Self::known_tags().get()).map(Instances::from)
75    }
76}
77
78impl std::fmt::Debug for QuoteCancel {
79    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
80        write!(f, "QuoteCancel({})", self.0)
81    }
82}
83
84impl std::fmt::Display for QuoteCancel {
85    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
86        std::fmt::Display::fmt(&self.0, f)
87    }
88}
89
90/// An instance of the `NoQuoteEntries` (295) group.
91#[derive(Clone, Copy)]
92pub struct QuoteCancelQuoteEntries<'a>(refix_message::Scope<'a>);
93
94impl<'a> From<refix_message::Scope<'a>> for QuoteCancelQuoteEntries<'a> {
95    fn from(scope: refix_message::Scope<'a>) -> Self {
96        Self(scope)
97    }
98}
99
100impl<'a> QuoteCancelQuoteEntries<'a> {
101    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
102        Tag(295),
103        Tag(55),
104        &[
105            Tag(22), Tag(48), Tag(55), Tag(65), Tag(106), Tag(107), Tag(167), Tag(200), Tag(201),
106            Tag(202), Tag(205), Tag(206), Tag(207), Tag(223), Tag(231), Tag(311), Tag(348),
107            Tag(349), Tag(350), Tag(351),
108        ],
109        &[],
110    );
111
112    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
113        static TAGS: LazyKnownTags = LazyKnownTags::new(
114            &[
115                Tag(55), Tag(65), Tag(48), Tag(22), Tag(167), Tag(200), Tag(205), Tag(201),
116                Tag(202), Tag(206), Tag(231), Tag(223), Tag(207), Tag(106), Tag(348), Tag(349),
117                Tag(107), Tag(350), Tag(351), Tag(311),
118            ],
119            &[],
120        );
121        &TAGS
122    }
123
124    pub fn raw(&self) -> refix_message::Scope<'a> {
125        self.0
126    }
127
128    /// The `Symbol` (55) field.
129    #[doc(alias = "Symbol")]
130    pub fn symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
131        self.0.get_str(Tag(55))
132    }
133
134    /// The `SymbolSfx` (65) field.
135    #[doc(alias = "SymbolSfx")]
136    pub fn symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
137        self.0.get_str(Tag(65))
138    }
139
140    /// The `SecurityID` (48) field.
141    #[doc(alias = "SecurityID")]
142    pub fn security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
143        self.0.get_str(Tag(48))
144    }
145
146    /// The `IDSource` (22) field.
147    #[doc(alias = "IDSource")]
148    pub fn id_source(&self) -> Result<Option<IDSource<'a>>, InvalidValue> {
149        Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
150    }
151
152    /// The `SecurityType` (167) field.
153    #[doc(alias = "SecurityType")]
154    pub fn security_type(&self) -> Result<Option<SecurityType<'a>>, InvalidValue> {
155        Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
156    }
157
158    /// The `MaturityMonthYear` (200) field.
159    #[doc(alias = "MaturityMonthYear")]
160    pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
161        self.0.get_month_year(Tag(200))
162    }
163
164    /// The `MaturityDay` (205) field.
165    #[doc(alias = "MaturityDay")]
166    pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
167        self.0.get_int(Tag(205))
168    }
169
170    /// The `PutOrCall` (201) field.
171    #[doc(alias = "PutOrCall")]
172    pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
173        Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
174    }
175
176    /// The `StrikePrice` (202) field.
177    #[doc(alias = "StrikePrice")]
178    pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
179        self.0.get_decimal(Tag(202))
180    }
181
182    /// The `OptAttribute` (206) field.
183    #[doc(alias = "OptAttribute")]
184    pub fn opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
185        self.0.get_str(Tag(206))
186    }
187
188    /// The `ContractMultiplier` (231) field.
189    #[doc(alias = "ContractMultiplier")]
190    pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
191        self.0.get_decimal(Tag(231))
192    }
193
194    /// The `CouponRate` (223) field.
195    #[doc(alias = "CouponRate")]
196    pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
197        self.0.get_decimal(Tag(223))
198    }
199
200    /// The `SecurityExchange` (207) field.
201    #[doc(alias = "SecurityExchange")]
202    pub fn security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
203        self.0.get_str(Tag(207))
204    }
205
206    /// The `Issuer` (106) field.
207    #[doc(alias = "Issuer")]
208    pub fn issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
209        self.0.get_str(Tag(106))
210    }
211
212    /// The `EncodedIssuerLen` (348) field.
213    #[doc(alias = "EncodedIssuerLen")]
214    pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
215        self.0.get_int(Tag(348))
216    }
217
218    /// The `EncodedIssuer` (349) field.
219    #[doc(alias = "EncodedIssuer")]
220    pub fn encoded_issuer(&self) -> Option<&'a [u8]> {
221        self.0.get(Tag(349))
222    }
223
224    /// The `SecurityDesc` (107) field.
225    #[doc(alias = "SecurityDesc")]
226    pub fn security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
227        self.0.get_str(Tag(107))
228    }
229
230    /// The `EncodedSecurityDescLen` (350) field.
231    #[doc(alias = "EncodedSecurityDescLen")]
232    pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
233        self.0.get_int(Tag(350))
234    }
235
236    /// The `EncodedSecurityDesc` (351) field.
237    #[doc(alias = "EncodedSecurityDesc")]
238    pub fn encoded_security_desc(&self) -> Option<&'a [u8]> {
239        self.0.get(Tag(351))
240    }
241
242    /// The `UnderlyingSymbol` (311) field.
243    #[doc(alias = "UnderlyingSymbol")]
244    pub fn underlying_symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
245        self.0.get_str(Tag(311))
246    }
247}
248
249impl std::fmt::Debug for QuoteCancelQuoteEntries<'_> {
250    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
251        write!(f, "QuoteCancelQuoteEntries({})", self.0)
252    }
253}