refix_fix42/generated/messages/
list_strike_price.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::{IDSource, PutOrCall, SecurityType, Side};
10
11pub struct ListStrikePrice(RawMessage);
13
14impl ListStrikePrice {
15 pub const MSG_TYPE: &[u8] = b"m";
16
17 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
18 static TAGS: LazyKnownTags = LazyKnownTags::new(
19 &[Tag(66), Tag(422), Tag(428)],
20 &[Header::known_tags(), Trailer::known_tags(), ListStrikePriceStrikes::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 #[doc(alias = "ListID")]
43 pub fn list_id(&self) -> Result<Option<&str>, InvalidValue> {
44 self.0.get_str(Tag(66))
45 }
46
47 #[doc(alias = "TotNoStrikes")]
49 pub fn tot_no_strikes(&self) -> Result<Option<i64>, InvalidValue> {
50 self.0.get_int(Tag(422))
51 }
52
53 #[doc(alias = "NoStrikes")]
55 pub fn strikes(&self) -> Result<Instances<'_, ListStrikePriceStrikes<'_>>, InvalidValue> {
56 self.0.get_group(&ListStrikePriceStrikes::TABLE, &Self::known_tags().get()).map(Instances::from)
57 }
58}
59
60impl std::fmt::Debug for ListStrikePrice {
61 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
62 write!(f, "ListStrikePrice({})", self.0)
63 }
64}
65
66impl std::fmt::Display for ListStrikePrice {
67 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
68 std::fmt::Display::fmt(&self.0, f)
69 }
70}
71
72#[derive(Clone, Copy)]
74pub struct ListStrikePriceStrikes<'a>(refix_message::Scope<'a>);
75
76impl<'a> From<refix_message::Scope<'a>> for ListStrikePriceStrikes<'a> {
77 fn from(scope: refix_message::Scope<'a>) -> Self {
78 Self(scope)
79 }
80}
81
82impl<'a> ListStrikePriceStrikes<'a> {
83 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
84 Tag(428),
85 Tag(55),
86 &[
87 Tag(11), Tag(15), Tag(22), Tag(44), Tag(48), Tag(54), Tag(55), Tag(58), Tag(65),
88 Tag(106), Tag(107), Tag(140), Tag(167), Tag(200), Tag(201), Tag(202), Tag(205),
89 Tag(206), Tag(207), Tag(223), Tag(231), Tag(348), Tag(349), Tag(350), Tag(351),
90 Tag(354), Tag(355),
91 ],
92 &[],
93 );
94
95 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
96 static TAGS: LazyKnownTags = LazyKnownTags::new(
97 &[
98 Tag(55), Tag(65), Tag(48), Tag(22), Tag(167), Tag(200), Tag(205), Tag(201),
99 Tag(202), Tag(206), Tag(231), Tag(223), Tag(207), Tag(106), Tag(348), Tag(349),
100 Tag(107), Tag(350), Tag(351), Tag(140), Tag(11), Tag(54), Tag(44), Tag(15), Tag(58),
101 Tag(354), Tag(355),
102 ],
103 &[],
104 );
105 &TAGS
106 }
107
108 pub fn raw(&self) -> refix_message::Scope<'a> {
109 self.0
110 }
111
112 #[doc(alias = "Symbol")]
114 pub fn symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
115 self.0.get_str(Tag(55))
116 }
117
118 #[doc(alias = "SymbolSfx")]
120 pub fn symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
121 self.0.get_str(Tag(65))
122 }
123
124 #[doc(alias = "SecurityID")]
126 pub fn security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
127 self.0.get_str(Tag(48))
128 }
129
130 #[doc(alias = "IDSource")]
132 pub fn id_source(&self) -> Result<Option<IDSource<'a>>, InvalidValue> {
133 Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
134 }
135
136 #[doc(alias = "SecurityType")]
138 pub fn security_type(&self) -> Result<Option<SecurityType<'a>>, InvalidValue> {
139 Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
140 }
141
142 #[doc(alias = "MaturityMonthYear")]
144 pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
145 self.0.get_month_year(Tag(200))
146 }
147
148 #[doc(alias = "MaturityDay")]
150 pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
151 self.0.get_int(Tag(205))
152 }
153
154 #[doc(alias = "PutOrCall")]
156 pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
157 Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
158 }
159
160 #[doc(alias = "StrikePrice")]
162 pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
163 self.0.get_decimal(Tag(202))
164 }
165
166 #[doc(alias = "OptAttribute")]
168 pub fn opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
169 self.0.get_str(Tag(206))
170 }
171
172 #[doc(alias = "ContractMultiplier")]
174 pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
175 self.0.get_decimal(Tag(231))
176 }
177
178 #[doc(alias = "CouponRate")]
180 pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
181 self.0.get_decimal(Tag(223))
182 }
183
184 #[doc(alias = "SecurityExchange")]
186 pub fn security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
187 self.0.get_str(Tag(207))
188 }
189
190 #[doc(alias = "Issuer")]
192 pub fn issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
193 self.0.get_str(Tag(106))
194 }
195
196 #[doc(alias = "EncodedIssuerLen")]
198 pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
199 self.0.get_int(Tag(348))
200 }
201
202 #[doc(alias = "EncodedIssuer")]
204 pub fn encoded_issuer(&self) -> Option<&'a [u8]> {
205 self.0.get(Tag(349))
206 }
207
208 #[doc(alias = "SecurityDesc")]
210 pub fn security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
211 self.0.get_str(Tag(107))
212 }
213
214 #[doc(alias = "EncodedSecurityDescLen")]
216 pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
217 self.0.get_int(Tag(350))
218 }
219
220 #[doc(alias = "EncodedSecurityDesc")]
222 pub fn encoded_security_desc(&self) -> Option<&'a [u8]> {
223 self.0.get(Tag(351))
224 }
225
226 #[doc(alias = "PrevClosePx")]
228 pub fn prev_close_px(&self) -> Result<Option<Decimal>, InvalidValue> {
229 self.0.get_decimal(Tag(140))
230 }
231
232 #[doc(alias = "ClOrdID")]
234 pub fn cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
235 self.0.get_str(Tag(11))
236 }
237
238 #[doc(alias = "Side")]
240 pub fn side(&self) -> Result<Option<Side<'a>>, InvalidValue> {
241 Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
242 }
243
244 #[doc(alias = "Price")]
246 pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
247 self.0.get_decimal(Tag(44))
248 }
249
250 #[doc(alias = "Currency")]
252 pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
253 self.0.get_str(Tag(15))
254 }
255
256 #[doc(alias = "Text")]
258 pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
259 self.0.get_str(Tag(58))
260 }
261
262 #[doc(alias = "EncodedTextLen")]
264 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
265 self.0.get_int(Tag(354))
266 }
267
268 #[doc(alias = "EncodedText")]
270 pub fn encoded_text(&self) -> Option<&'a [u8]> {
271 self.0.get(Tag(355))
272 }
273}
274
275impl std::fmt::Debug for ListStrikePriceStrikes<'_> {
276 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
277 write!(f, "ListStrikePriceStrikes({})", self.0)
278 }
279}