Skip to main content

refix_fix42/generated/messages/
ioi.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    UtcTimestamp,
7};
8
9use super::super::components::{Header, Trailer};
10use super::super::enums::{
11    Benchmark, IDSource, IOIQltyInd, IOIQualifier, IOIShares, IOITransType, PutOrCall, RoutingType,
12    SecurityType, Side,
13};
14
15/// The `IOI` (35=6) message.
16pub struct IOI(RawMessage);
17
18impl IOI {
19    pub const MSG_TYPE: &[u8] = b"6";
20
21    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
22        static TAGS: LazyKnownTags = LazyKnownTags::new(
23            &[
24                Tag(23), Tag(28), Tag(26), Tag(55), Tag(65), Tag(48), Tag(22), Tag(167), Tag(200),
25                Tag(205), Tag(201), Tag(202), Tag(206), Tag(231), Tag(223), Tag(207), Tag(106),
26                Tag(348), Tag(349), Tag(107), Tag(350), Tag(351), Tag(54), Tag(27), Tag(44),
27                Tag(15), Tag(62), Tag(25), Tag(130), Tag(199), Tag(58), Tag(354), Tag(355), Tag(60),
28                Tag(149), Tag(215), Tag(218), Tag(219),
29            ],
30            &[
31                Header::known_tags(), Trailer::known_tags(), IOIIOIQualifiers::known_tags(),
32                IOIRoutingIDs::known_tags(),
33            ],
34        );
35        &TAGS
36    }
37
38    pub fn from_raw(raw: RawMessage) -> Self {
39        Self(raw)
40    }
41
42    pub fn raw(&self) -> &RawMessage {
43        &self.0
44    }
45
46    pub fn header(&self) -> Header<'_> {
47        Header(self.0.scope())
48    }
49
50    pub fn trailer(&self) -> Trailer<'_> {
51        Trailer(self.0.scope())
52    }
53
54    /// The `IOIid` (23) field.
55    #[doc(alias = "IOIid")]
56    pub fn io_iid(&self) -> Result<Option<&str>, InvalidValue> {
57        self.0.get_str(Tag(23))
58    }
59
60    /// The `IOITransType` (28) field.
61    #[doc(alias = "IOITransType")]
62    pub fn ioi_trans_type(&self) -> Result<Option<IOITransType<'_>>, InvalidValue> {
63        Ok(self.0.get_str(Tag(28))?.map(IOITransType::from_value))
64    }
65
66    /// The `IOIRefID` (26) field.
67    #[doc(alias = "IOIRefID")]
68    pub fn ioi_ref_id(&self) -> Result<Option<&str>, InvalidValue> {
69        self.0.get_str(Tag(26))
70    }
71
72    /// The `Symbol` (55) field.
73    #[doc(alias = "Symbol")]
74    pub fn symbol(&self) -> Result<Option<&str>, InvalidValue> {
75        self.0.get_str(Tag(55))
76    }
77
78    /// The `SymbolSfx` (65) field.
79    #[doc(alias = "SymbolSfx")]
80    pub fn symbol_sfx(&self) -> Result<Option<&str>, InvalidValue> {
81        self.0.get_str(Tag(65))
82    }
83
84    /// The `SecurityID` (48) field.
85    #[doc(alias = "SecurityID")]
86    pub fn security_id(&self) -> Result<Option<&str>, InvalidValue> {
87        self.0.get_str(Tag(48))
88    }
89
90    /// The `IDSource` (22) field.
91    #[doc(alias = "IDSource")]
92    pub fn id_source(&self) -> Result<Option<IDSource<'_>>, InvalidValue> {
93        Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
94    }
95
96    /// The `SecurityType` (167) field.
97    #[doc(alias = "SecurityType")]
98    pub fn security_type(&self) -> Result<Option<SecurityType<'_>>, InvalidValue> {
99        Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
100    }
101
102    /// The `MaturityMonthYear` (200) field.
103    #[doc(alias = "MaturityMonthYear")]
104    pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
105        self.0.get_month_year(Tag(200))
106    }
107
108    /// The `MaturityDay` (205) field.
109    #[doc(alias = "MaturityDay")]
110    pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
111        self.0.get_int(Tag(205))
112    }
113
114    /// The `PutOrCall` (201) field.
115    #[doc(alias = "PutOrCall")]
116    pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
117        Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
118    }
119
120    /// The `StrikePrice` (202) field.
121    #[doc(alias = "StrikePrice")]
122    pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
123        self.0.get_decimal(Tag(202))
124    }
125
126    /// The `OptAttribute` (206) field.
127    #[doc(alias = "OptAttribute")]
128    pub fn opt_attribute(&self) -> Result<Option<&str>, InvalidValue> {
129        self.0.get_str(Tag(206))
130    }
131
132    /// The `ContractMultiplier` (231) field.
133    #[doc(alias = "ContractMultiplier")]
134    pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
135        self.0.get_decimal(Tag(231))
136    }
137
138    /// The `CouponRate` (223) field.
139    #[doc(alias = "CouponRate")]
140    pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
141        self.0.get_decimal(Tag(223))
142    }
143
144    /// The `SecurityExchange` (207) field.
145    #[doc(alias = "SecurityExchange")]
146    pub fn security_exchange(&self) -> Result<Option<&str>, InvalidValue> {
147        self.0.get_str(Tag(207))
148    }
149
150    /// The `Issuer` (106) field.
151    #[doc(alias = "Issuer")]
152    pub fn issuer(&self) -> Result<Option<&str>, InvalidValue> {
153        self.0.get_str(Tag(106))
154    }
155
156    /// The `EncodedIssuerLen` (348) field.
157    #[doc(alias = "EncodedIssuerLen")]
158    pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
159        self.0.get_int(Tag(348))
160    }
161
162    /// The `EncodedIssuer` (349) field.
163    #[doc(alias = "EncodedIssuer")]
164    pub fn encoded_issuer(&self) -> Option<&[u8]> {
165        self.0.get(Tag(349))
166    }
167
168    /// The `SecurityDesc` (107) field.
169    #[doc(alias = "SecurityDesc")]
170    pub fn security_desc(&self) -> Result<Option<&str>, InvalidValue> {
171        self.0.get_str(Tag(107))
172    }
173
174    /// The `EncodedSecurityDescLen` (350) field.
175    #[doc(alias = "EncodedSecurityDescLen")]
176    pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
177        self.0.get_int(Tag(350))
178    }
179
180    /// The `EncodedSecurityDesc` (351) field.
181    #[doc(alias = "EncodedSecurityDesc")]
182    pub fn encoded_security_desc(&self) -> Option<&[u8]> {
183        self.0.get(Tag(351))
184    }
185
186    /// The `Side` (54) field.
187    #[doc(alias = "Side")]
188    pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
189        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
190    }
191
192    /// The `IOIShares` (27) field.
193    #[doc(alias = "IOIShares")]
194    pub fn ioi_shares(&self) -> Result<Option<IOIShares<'_>>, InvalidValue> {
195        Ok(self.0.get_str(Tag(27))?.map(IOIShares::from_value))
196    }
197
198    /// The `Price` (44) field.
199    #[doc(alias = "Price")]
200    pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
201        self.0.get_decimal(Tag(44))
202    }
203
204    /// The `Currency` (15) field.
205    #[doc(alias = "Currency")]
206    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
207        self.0.get_str(Tag(15))
208    }
209
210    /// The `ValidUntilTime` (62) field.
211    #[doc(alias = "ValidUntilTime")]
212    pub fn valid_until_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
213        self.0.get_utc_timestamp(Tag(62))
214    }
215
216    /// The `IOIQltyInd` (25) field.
217    #[doc(alias = "IOIQltyInd")]
218    pub fn ioi_qlty_ind(&self) -> Result<Option<IOIQltyInd<'_>>, InvalidValue> {
219        Ok(self.0.get_str(Tag(25))?.map(IOIQltyInd::from_value))
220    }
221
222    /// The `IOINaturalFlag` (130) field.
223    #[doc(alias = "IOINaturalFlag")]
224    pub fn ioi_natural_flag(&self) -> Result<Option<bool>, InvalidValue> {
225        self.0.get_bool(Tag(130))
226    }
227
228    /// The instances of the `NoIOIQualifiers` (199) group.
229    #[doc(alias = "NoIOIQualifiers")]
230    pub fn ioi_qualifiers(&self) -> Result<Instances<'_, IOIIOIQualifiers<'_>>, InvalidValue> {
231        self.0.get_group(&IOIIOIQualifiers::TABLE, &Self::known_tags().get()).map(Instances::from)
232    }
233
234    /// The `Text` (58) field.
235    #[doc(alias = "Text")]
236    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
237        self.0.get_str(Tag(58))
238    }
239
240    /// The `EncodedTextLen` (354) field.
241    #[doc(alias = "EncodedTextLen")]
242    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
243        self.0.get_int(Tag(354))
244    }
245
246    /// The `EncodedText` (355) field.
247    #[doc(alias = "EncodedText")]
248    pub fn encoded_text(&self) -> Option<&[u8]> {
249        self.0.get(Tag(355))
250    }
251
252    /// The `TransactTime` (60) field.
253    #[doc(alias = "TransactTime")]
254    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
255        self.0.get_utc_timestamp(Tag(60))
256    }
257
258    /// The `URLLink` (149) field.
259    #[doc(alias = "URLLink")]
260    pub fn url_link(&self) -> Result<Option<&str>, InvalidValue> {
261        self.0.get_str(Tag(149))
262    }
263
264    /// The instances of the `NoRoutingIDs` (215) group.
265    #[doc(alias = "NoRoutingIDs")]
266    pub fn routing_ids(&self) -> Result<Instances<'_, IOIRoutingIDs<'_>>, InvalidValue> {
267        self.0.get_group(&IOIRoutingIDs::TABLE, &Self::known_tags().get()).map(Instances::from)
268    }
269
270    /// The `SpreadToBenchmark` (218) field.
271    #[doc(alias = "SpreadToBenchmark")]
272    pub fn spread_to_benchmark(&self) -> Result<Option<Decimal>, InvalidValue> {
273        self.0.get_decimal(Tag(218))
274    }
275
276    /// The `Benchmark` (219) field.
277    #[doc(alias = "Benchmark")]
278    pub fn benchmark(&self) -> Result<Option<Benchmark<'_>>, InvalidValue> {
279        Ok(self.0.get_str(Tag(219))?.map(Benchmark::from_value))
280    }
281}
282
283impl std::fmt::Debug for IOI {
284    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
285        write!(f, "IOI({})", self.0)
286    }
287}
288
289impl std::fmt::Display for IOI {
290    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
291        std::fmt::Display::fmt(&self.0, f)
292    }
293}
294
295/// An instance of the `NoIOIQualifiers` (199) group.
296#[derive(Clone, Copy)]
297pub struct IOIIOIQualifiers<'a>(refix_message::Scope<'a>);
298
299impl<'a> From<refix_message::Scope<'a>> for IOIIOIQualifiers<'a> {
300    fn from(scope: refix_message::Scope<'a>) -> Self {
301        Self(scope)
302    }
303}
304
305impl<'a> IOIIOIQualifiers<'a> {
306    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
307        Tag(199),
308        Tag(104),
309        &[Tag(104)],
310        &[],
311    );
312
313    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
314        static TAGS: LazyKnownTags = LazyKnownTags::new(&[Tag(104)], &[]);
315        &TAGS
316    }
317
318    pub fn raw(&self) -> refix_message::Scope<'a> {
319        self.0
320    }
321
322    /// The `IOIQualifier` (104) field.
323    #[doc(alias = "IOIQualifier")]
324    pub fn ioi_qualifier(&self) -> Result<Option<IOIQualifier<'a>>, InvalidValue> {
325        Ok(self.0.get_str(Tag(104))?.map(IOIQualifier::from_value))
326    }
327}
328
329impl std::fmt::Debug for IOIIOIQualifiers<'_> {
330    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
331        write!(f, "IOIIOIQualifiers({})", self.0)
332    }
333}
334
335/// An instance of the `NoRoutingIDs` (215) group.
336#[derive(Clone, Copy)]
337pub struct IOIRoutingIDs<'a>(refix_message::Scope<'a>);
338
339impl<'a> From<refix_message::Scope<'a>> for IOIRoutingIDs<'a> {
340    fn from(scope: refix_message::Scope<'a>) -> Self {
341        Self(scope)
342    }
343}
344
345impl<'a> IOIRoutingIDs<'a> {
346    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
347        Tag(215),
348        Tag(216),
349        &[Tag(216), Tag(217)],
350        &[],
351    );
352
353    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
354        static TAGS: LazyKnownTags = LazyKnownTags::new(&[Tag(216), Tag(217)], &[]);
355        &TAGS
356    }
357
358    pub fn raw(&self) -> refix_message::Scope<'a> {
359        self.0
360    }
361
362    /// The `RoutingType` (216) field.
363    #[doc(alias = "RoutingType")]
364    pub fn routing_type(&self) -> Result<Option<RoutingType>, InvalidValue> {
365        Ok(self.0.get_int(Tag(216))?.map(RoutingType::from_value))
366    }
367
368    /// The `RoutingID` (217) field.
369    #[doc(alias = "RoutingID")]
370    pub fn routing_id(&self) -> Result<Option<&'a str>, InvalidValue> {
371        self.0.get_str(Tag(217))
372    }
373}
374
375impl std::fmt::Debug for IOIRoutingIDs<'_> {
376    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
377        write!(f, "IOIRoutingIDs({})", self.0)
378    }
379}