refix_fix44/generated/messages/
ioi.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, Instances, InvalidValue, LazyKnownTags, RawMessage, Tag, UtcTimestamp};
5
6use super::super::components::{
7 FinancingDetails, Header, IOIQualGrp, InstrmtLegIOIGrp, Instrument, OrderQtyData, RoutingGrp,
8 SpreadOrBenchmarkCurveData, Stipulations, Trailer, UndInstrmtGrp, YieldData,
9};
10use super::super::enums::{IOIQltyInd, IOIQty, IOITransType, PriceType, QtyType, Side};
11
12pub struct IOI(RawMessage);
14
15impl IOI {
16 pub const MSG_TYPE: &[u8] = b"6";
17
18 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
19 static TAGS: LazyKnownTags = LazyKnownTags::new(
20 &[
21 Tag(23), Tag(28), Tag(26), Tag(711), Tag(54), Tag(854), Tag(27), Tag(15), Tag(232),
22 Tag(555), Tag(423), Tag(44), Tag(62), Tag(25), Tag(130), Tag(199), Tag(58),
23 Tag(354), Tag(355), Tag(60), Tag(149), Tag(215),
24 ],
25 &[
26 Header::known_tags(), Trailer::known_tags(), Instrument::known_tags(),
27 FinancingDetails::known_tags(), UndInstrmtGrp::known_tags(),
28 OrderQtyData::known_tags(), Stipulations::known_tags(),
29 InstrmtLegIOIGrp::known_tags(), IOIQualGrp::known_tags(), RoutingGrp::known_tags(),
30 SpreadOrBenchmarkCurveData::known_tags(), YieldData::known_tags(),
31 ],
32 );
33 &TAGS
34 }
35
36 pub fn from_raw(raw: RawMessage) -> Self {
37 Self(raw)
38 }
39
40 pub fn raw(&self) -> &RawMessage {
41 &self.0
42 }
43
44 pub fn header(&self) -> Header<'_> {
45 Header(self.0.scope(), Self::known_tags().get())
46 }
47
48 pub fn trailer(&self) -> Trailer<'_> {
49 Trailer(self.0.scope())
50 }
51
52 #[doc(alias = "IOIID")]
54 pub fn ioiid(&self) -> Result<Option<&str>, InvalidValue> {
55 self.0.get_str(Tag(23))
56 }
57
58 #[doc(alias = "IOITransType")]
60 pub fn ioi_trans_type(&self) -> Result<Option<IOITransType<'_>>, InvalidValue> {
61 Ok(self.0.get_str(Tag(28))?.map(IOITransType::from_value))
62 }
63
64 #[doc(alias = "IOIRefID")]
66 pub fn ioi_ref_id(&self) -> Result<Option<&str>, InvalidValue> {
67 self.0.get_str(Tag(26))
68 }
69
70 pub fn instrument(&self) -> Instrument<'_> {
72 Instrument(self.0.scope(), Self::known_tags().get())
73 }
74
75 pub fn financing_details(&self) -> FinancingDetails<'_> {
77 FinancingDetails(self.0.scope())
78 }
79
80 #[doc(alias = "NoUnderlyings")]
82 pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
83 self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
84 }
85
86 #[doc(alias = "Side")]
88 pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
89 Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
90 }
91
92 #[doc(alias = "QtyType")]
94 pub fn qty_type(&self) -> Result<Option<QtyType>, InvalidValue> {
95 Ok(self.0.get_int(Tag(854))?.map(QtyType::from_value))
96 }
97
98 pub fn order_qty_data(&self) -> OrderQtyData<'_> {
100 OrderQtyData(self.0.scope())
101 }
102
103 #[doc(alias = "IOIQty")]
105 pub fn ioi_qty(&self) -> Result<Option<IOIQty<'_>>, InvalidValue> {
106 Ok(self.0.get_str(Tag(27))?.map(IOIQty::from_value))
107 }
108
109 #[doc(alias = "Currency")]
111 pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
112 self.0.get_str(Tag(15))
113 }
114
115 #[doc(alias = "NoStipulations")]
117 pub fn stipulations(&self) -> Result<Instances<'_, Stipulations<'_>>, InvalidValue> {
118 self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
119 }
120
121 #[doc(alias = "NoLegs")]
123 pub fn legs(&self) -> Result<Instances<'_, InstrmtLegIOIGrp<'_>>, InvalidValue> {
124 self.0.get_group(&InstrmtLegIOIGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
125 }
126
127 #[doc(alias = "PriceType")]
129 pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
130 Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
131 }
132
133 #[doc(alias = "Price")]
135 pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
136 self.0.get_decimal(Tag(44))
137 }
138
139 #[doc(alias = "ValidUntilTime")]
141 pub fn valid_until_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
142 self.0.get_utc_timestamp(Tag(62))
143 }
144
145 #[doc(alias = "IOIQltyInd")]
147 pub fn ioi_qlty_ind(&self) -> Result<Option<IOIQltyInd<'_>>, InvalidValue> {
148 Ok(self.0.get_str(Tag(25))?.map(IOIQltyInd::from_value))
149 }
150
151 #[doc(alias = "IOINaturalFlag")]
153 pub fn ioi_natural_flag(&self) -> Result<Option<bool>, InvalidValue> {
154 self.0.get_bool(Tag(130))
155 }
156
157 #[doc(alias = "NoIOIQualifiers")]
159 pub fn ioi_qualifiers(&self) -> Result<Instances<'_, IOIQualGrp<'_>>, InvalidValue> {
160 self.0.get_group(&IOIQualGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
161 }
162
163 #[doc(alias = "Text")]
165 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
166 self.0.get_str(Tag(58))
167 }
168
169 #[doc(alias = "EncodedTextLen")]
171 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
172 self.0.get_int(Tag(354))
173 }
174
175 #[doc(alias = "EncodedText")]
177 pub fn encoded_text(&self) -> Option<&[u8]> {
178 self.0.get(Tag(355))
179 }
180
181 #[doc(alias = "TransactTime")]
183 pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
184 self.0.get_utc_timestamp(Tag(60))
185 }
186
187 #[doc(alias = "URLLink")]
189 pub fn url_link(&self) -> Result<Option<&str>, InvalidValue> {
190 self.0.get_str(Tag(149))
191 }
192
193 #[doc(alias = "NoRoutingIDs")]
195 pub fn routing_ids(&self) -> Result<Instances<'_, RoutingGrp<'_>>, InvalidValue> {
196 self.0.get_group(&RoutingGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
197 }
198
199 pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'_> {
201 SpreadOrBenchmarkCurveData(self.0.scope())
202 }
203
204 pub fn yield_data(&self) -> YieldData<'_> {
206 YieldData(self.0.scope())
207 }
208}
209
210impl std::fmt::Debug for IOI {
211 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
212 write!(f, "IOI({})", self.0)
213 }
214}
215
216impl std::fmt::Display for IOI {
217 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
218 std::fmt::Display::fmt(&self.0, f)
219 }
220}