refix_fix44/generated/messages/
new_order_cross.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5 Date, Decimal, Instances, InvalidValue, LazyKnownTags, MultipleValues, RawMessage, Tag,
6 UtcTimestamp,
7};
8
9use super::super::components::{
10 DiscretionInstructions, Header, InstrmtLegGrp, Instrument, PegInstructions, SideCrossOrdModGrp,
11 SpreadOrBenchmarkCurveData, Stipulations, Trailer, TrdgSesGrp, UndInstrmtGrp, YieldData,
12};
13use super::super::enums::{
14 CancellationRights, CrossPrioritization, CrossType, ExecInst, GTBookingInst, HandlInst,
15 MoneyLaunderingStatus, OrdType, PriceType, ProcessCode, SettlType, TargetStrategy, TimeInForce,
16};
17
18pub struct NewOrderCross(RawMessage);
20
21impl NewOrderCross {
22 pub const MSG_TYPE: &[u8] = b"s";
23
24 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
25 static TAGS: LazyKnownTags = LazyKnownTags::new(
26 &[
27 Tag(548), Tag(549), Tag(550), Tag(552), Tag(711), Tag(555), Tag(63), Tag(64),
28 Tag(21), Tag(18), Tag(110), Tag(111), Tag(100), Tag(386), Tag(81), Tag(140),
29 Tag(114), Tag(60), Tag(232), Tag(40), Tag(423), Tag(44), Tag(99), Tag(15), Tag(376),
30 Tag(23), Tag(117), Tag(59), Tag(168), Tag(432), Tag(126), Tag(427), Tag(210),
31 Tag(847), Tag(848), Tag(849), Tag(480), Tag(481), Tag(513), Tag(494),
32 ],
33 &[
34 Header::known_tags(), Trailer::known_tags(), SideCrossOrdModGrp::known_tags(),
35 Instrument::known_tags(), UndInstrmtGrp::known_tags(), InstrmtLegGrp::known_tags(),
36 TrdgSesGrp::known_tags(), Stipulations::known_tags(),
37 SpreadOrBenchmarkCurveData::known_tags(), YieldData::known_tags(),
38 PegInstructions::known_tags(), DiscretionInstructions::known_tags(),
39 ],
40 );
41 &TAGS
42 }
43
44 pub fn from_raw(raw: RawMessage) -> Self {
45 Self(raw)
46 }
47
48 pub fn raw(&self) -> &RawMessage {
49 &self.0
50 }
51
52 pub fn header(&self) -> Header<'_> {
53 Header(self.0.scope(), Self::known_tags().get())
54 }
55
56 pub fn trailer(&self) -> Trailer<'_> {
57 Trailer(self.0.scope())
58 }
59
60 #[doc(alias = "CrossID")]
62 pub fn cross_id(&self) -> Result<Option<&str>, InvalidValue> {
63 self.0.get_str(Tag(548))
64 }
65
66 #[doc(alias = "CrossType")]
68 pub fn cross_type(&self) -> Result<Option<CrossType>, InvalidValue> {
69 Ok(self.0.get_int(Tag(549))?.map(CrossType::from_value))
70 }
71
72 #[doc(alias = "CrossPrioritization")]
74 pub fn cross_prioritization(&self) -> Result<Option<CrossPrioritization>, InvalidValue> {
75 Ok(self.0.get_int(Tag(550))?.map(CrossPrioritization::from_value))
76 }
77
78 #[doc(alias = "NoSides")]
80 pub fn sides(&self) -> Result<Instances<'_, SideCrossOrdModGrp<'_>>, InvalidValue> {
81 self.0.get_group(&SideCrossOrdModGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
82 }
83
84 pub fn instrument(&self) -> Instrument<'_> {
86 Instrument(self.0.scope(), Self::known_tags().get())
87 }
88
89 #[doc(alias = "NoUnderlyings")]
91 pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
92 self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
93 }
94
95 #[doc(alias = "NoLegs")]
97 pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
98 self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
99 }
100
101 #[doc(alias = "SettlType")]
103 pub fn settl_type(&self) -> Result<Option<SettlType<'_>>, InvalidValue> {
104 Ok(self.0.get_str(Tag(63))?.map(SettlType::from_value))
105 }
106
107 #[doc(alias = "SettlDate")]
109 pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
110 self.0.get_date(Tag(64))
111 }
112
113 #[doc(alias = "HandlInst")]
115 pub fn handl_inst(&self) -> Result<Option<HandlInst<'_>>, InvalidValue> {
116 Ok(self.0.get_str(Tag(21))?.map(HandlInst::from_value))
117 }
118
119 #[doc(alias = "ExecInst")]
121 pub fn exec_inst(&self) -> Result<Option<MultipleValues<'_, ExecInst<'_>>>, InvalidValue> {
122 self.0.get_multiple_values(Tag(18))
123 }
124
125 #[doc(alias = "MinQty")]
127 pub fn min_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
128 self.0.get_decimal(Tag(110))
129 }
130
131 #[doc(alias = "MaxFloor")]
133 pub fn max_floor(&self) -> Result<Option<Decimal>, InvalidValue> {
134 self.0.get_decimal(Tag(111))
135 }
136
137 #[doc(alias = "ExDestination")]
139 pub fn ex_destination(&self) -> Result<Option<&str>, InvalidValue> {
140 self.0.get_str(Tag(100))
141 }
142
143 #[doc(alias = "NoTradingSessions")]
145 pub fn trading_sessions(&self) -> Result<Instances<'_, TrdgSesGrp<'_>>, InvalidValue> {
146 self.0.get_group(&TrdgSesGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
147 }
148
149 #[doc(alias = "ProcessCode")]
151 pub fn process_code(&self) -> Result<Option<ProcessCode<'_>>, InvalidValue> {
152 Ok(self.0.get_str(Tag(81))?.map(ProcessCode::from_value))
153 }
154
155 #[doc(alias = "PrevClosePx")]
157 pub fn prev_close_px(&self) -> Result<Option<Decimal>, InvalidValue> {
158 self.0.get_decimal(Tag(140))
159 }
160
161 #[doc(alias = "LocateReqd")]
163 pub fn locate_reqd(&self) -> Result<Option<bool>, InvalidValue> {
164 self.0.get_bool(Tag(114))
165 }
166
167 #[doc(alias = "TransactTime")]
169 pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
170 self.0.get_utc_timestamp(Tag(60))
171 }
172
173 #[doc(alias = "NoStipulations")]
175 pub fn stipulations(&self) -> Result<Instances<'_, Stipulations<'_>>, InvalidValue> {
176 self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
177 }
178
179 #[doc(alias = "OrdType")]
181 pub fn ord_type(&self) -> Result<Option<OrdType<'_>>, InvalidValue> {
182 Ok(self.0.get_str(Tag(40))?.map(OrdType::from_value))
183 }
184
185 #[doc(alias = "PriceType")]
187 pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
188 Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
189 }
190
191 #[doc(alias = "Price")]
193 pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
194 self.0.get_decimal(Tag(44))
195 }
196
197 #[doc(alias = "StopPx")]
199 pub fn stop_px(&self) -> Result<Option<Decimal>, InvalidValue> {
200 self.0.get_decimal(Tag(99))
201 }
202
203 pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'_> {
205 SpreadOrBenchmarkCurveData(self.0.scope())
206 }
207
208 pub fn yield_data(&self) -> YieldData<'_> {
210 YieldData(self.0.scope())
211 }
212
213 #[doc(alias = "Currency")]
215 pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
216 self.0.get_str(Tag(15))
217 }
218
219 #[doc(alias = "ComplianceID")]
221 pub fn compliance_id(&self) -> Result<Option<&str>, InvalidValue> {
222 self.0.get_str(Tag(376))
223 }
224
225 #[doc(alias = "IOIID")]
227 pub fn ioiid(&self) -> Result<Option<&str>, InvalidValue> {
228 self.0.get_str(Tag(23))
229 }
230
231 #[doc(alias = "QuoteID")]
233 pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
234 self.0.get_str(Tag(117))
235 }
236
237 #[doc(alias = "TimeInForce")]
239 pub fn time_in_force(&self) -> Result<Option<TimeInForce<'_>>, InvalidValue> {
240 Ok(self.0.get_str(Tag(59))?.map(TimeInForce::from_value))
241 }
242
243 #[doc(alias = "EffectiveTime")]
245 pub fn effective_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
246 self.0.get_utc_timestamp(Tag(168))
247 }
248
249 #[doc(alias = "ExpireDate")]
251 pub fn expire_date(&self) -> Result<Option<Date>, InvalidValue> {
252 self.0.get_date(Tag(432))
253 }
254
255 #[doc(alias = "ExpireTime")]
257 pub fn expire_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
258 self.0.get_utc_timestamp(Tag(126))
259 }
260
261 #[doc(alias = "GTBookingInst")]
263 pub fn gt_booking_inst(&self) -> Result<Option<GTBookingInst>, InvalidValue> {
264 Ok(self.0.get_int(Tag(427))?.map(GTBookingInst::from_value))
265 }
266
267 #[doc(alias = "MaxShow")]
269 pub fn max_show(&self) -> Result<Option<Decimal>, InvalidValue> {
270 self.0.get_decimal(Tag(210))
271 }
272
273 pub fn peg_instructions(&self) -> PegInstructions<'_> {
275 PegInstructions(self.0.scope())
276 }
277
278 pub fn discretion_instructions(&self) -> DiscretionInstructions<'_> {
280 DiscretionInstructions(self.0.scope())
281 }
282
283 #[doc(alias = "TargetStrategy")]
285 pub fn target_strategy(&self) -> Result<Option<TargetStrategy>, InvalidValue> {
286 Ok(self.0.get_int(Tag(847))?.map(TargetStrategy::from_value))
287 }
288
289 #[doc(alias = "TargetStrategyParameters")]
291 pub fn target_strategy_parameters(&self) -> Result<Option<&str>, InvalidValue> {
292 self.0.get_str(Tag(848))
293 }
294
295 #[doc(alias = "ParticipationRate")]
297 pub fn participation_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
298 self.0.get_decimal(Tag(849))
299 }
300
301 #[doc(alias = "CancellationRights")]
303 pub fn cancellation_rights(&self) -> Result<Option<CancellationRights<'_>>, InvalidValue> {
304 Ok(self.0.get_str(Tag(480))?.map(CancellationRights::from_value))
305 }
306
307 #[doc(alias = "MoneyLaunderingStatus")]
309 pub fn money_laundering_status(&self) -> Result<Option<MoneyLaunderingStatus<'_>>, InvalidValue> {
310 Ok(self.0.get_str(Tag(481))?.map(MoneyLaunderingStatus::from_value))
311 }
312
313 #[doc(alias = "RegistID")]
315 pub fn regist_id(&self) -> Result<Option<&str>, InvalidValue> {
316 self.0.get_str(Tag(513))
317 }
318
319 #[doc(alias = "Designation")]
321 pub fn designation(&self) -> Result<Option<&str>, InvalidValue> {
322 self.0.get_str(Tag(494))
323 }
324}
325
326impl std::fmt::Debug for NewOrderCross {
327 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
328 write!(f, "NewOrderCross({})", self.0)
329 }
330}
331
332impl std::fmt::Display for NewOrderCross {
333 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
334 std::fmt::Display::fmt(&self.0, f)
335 }
336}