Skip to main content

refix_fix44/generated/messages/
new_order_multileg.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![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    CommissionData, DiscretionInstructions, Header, Instrument, LegOrdGrp, OrderQtyData, Parties,
11    PegInstructions, PreAllocMlegGrp, Trailer, TrdgSesGrp, UndInstrmtGrp,
12};
13use super::super::enums::{
14    AccountType, AcctIDSource, BookingType, BookingUnit, CancellationRights, CashMargin,
15    ClearingFeeIndicator, CoveredOrUncovered, CustOrderCapacity, DayBookingInst, ExecInst,
16    GTBookingInst, HandlInst, MoneyLaunderingStatus, MultiLegRptTypeReq, OrdType, OrderCapacity,
17    OrderRestrictions, PositionEffect, PreallocMethod, PriceType, ProcessCode, QtyType, SettlType,
18    Side, TargetStrategy, TimeInForce,
19};
20
21/// The `NewOrderMultileg` (35=AB) message.
22pub struct NewOrderMultileg(RawMessage);
23
24impl NewOrderMultileg {
25    pub const MSG_TYPE: &[u8] = b"AB";
26
27    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
28        static TAGS: LazyKnownTags = LazyKnownTags::new(
29            &[
30                Tag(11), Tag(526), Tag(583), Tag(453), Tag(229), Tag(75), Tag(1), Tag(660),
31                Tag(581), Tag(589), Tag(590), Tag(591), Tag(70), Tag(78), Tag(63), Tag(64),
32                Tag(544), Tag(635), Tag(21), Tag(18), Tag(110), Tag(111), Tag(100), Tag(386),
33                Tag(81), Tag(54), Tag(711), Tag(140), Tag(555), Tag(114), Tag(60), Tag(854),
34                Tag(40), Tag(423), Tag(44), Tag(99), Tag(15), Tag(376), Tag(377), Tag(23), Tag(117),
35                Tag(59), Tag(168), Tag(432), Tag(126), Tag(427), Tag(528), Tag(529), Tag(582),
36                Tag(121), Tag(120), Tag(775), Tag(58), Tag(354), Tag(355), Tag(77), Tag(203),
37                Tag(210), Tag(847), Tag(848), Tag(849), Tag(480), Tag(481), Tag(513), Tag(494),
38                Tag(563),
39            ],
40            &[
41                Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
42                PreAllocMlegGrp::known_tags(), TrdgSesGrp::known_tags(), Instrument::known_tags(),
43                UndInstrmtGrp::known_tags(), LegOrdGrp::known_tags(), OrderQtyData::known_tags(),
44                CommissionData::known_tags(), PegInstructions::known_tags(),
45                DiscretionInstructions::known_tags(),
46            ],
47        );
48        &TAGS
49    }
50
51    pub fn from_raw(raw: RawMessage) -> Self {
52        Self(raw)
53    }
54
55    pub fn raw(&self) -> &RawMessage {
56        &self.0
57    }
58
59    pub fn header(&self) -> Header<'_> {
60        Header(self.0.scope(), Self::known_tags().get())
61    }
62
63    pub fn trailer(&self) -> Trailer<'_> {
64        Trailer(self.0.scope())
65    }
66
67    /// The `ClOrdID` (11) field.
68    #[doc(alias = "ClOrdID")]
69    pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
70        self.0.get_str(Tag(11))
71    }
72
73    /// The `SecondaryClOrdID` (526) field.
74    #[doc(alias = "SecondaryClOrdID")]
75    pub fn secondary_cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
76        self.0.get_str(Tag(526))
77    }
78
79    /// The `ClOrdLinkID` (583) field.
80    #[doc(alias = "ClOrdLinkID")]
81    pub fn cl_ord_link_id(&self) -> Result<Option<&str>, InvalidValue> {
82        self.0.get_str(Tag(583))
83    }
84
85    /// The instances of the `NoPartyIDs` (453) group.
86    #[doc(alias = "NoPartyIDs")]
87    pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
88        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
89    }
90
91    /// The `TradeOriginationDate` (229) field.
92    #[doc(alias = "TradeOriginationDate")]
93    pub fn trade_origination_date(&self) -> Result<Option<Date>, InvalidValue> {
94        self.0.get_date(Tag(229))
95    }
96
97    /// The `TradeDate` (75) field.
98    #[doc(alias = "TradeDate")]
99    pub fn trade_date(&self) -> Result<Option<Date>, InvalidValue> {
100        self.0.get_date(Tag(75))
101    }
102
103    /// The `Account` (1) field.
104    #[doc(alias = "Account")]
105    pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
106        self.0.get_str(Tag(1))
107    }
108
109    /// The `AcctIDSource` (660) field.
110    #[doc(alias = "AcctIDSource")]
111    pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
112        Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
113    }
114
115    /// The `AccountType` (581) field.
116    #[doc(alias = "AccountType")]
117    pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
118        Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
119    }
120
121    /// The `DayBookingInst` (589) field.
122    #[doc(alias = "DayBookingInst")]
123    pub fn day_booking_inst(&self) -> Result<Option<DayBookingInst<'_>>, InvalidValue> {
124        Ok(self.0.get_str(Tag(589))?.map(DayBookingInst::from_value))
125    }
126
127    /// The `BookingUnit` (590) field.
128    #[doc(alias = "BookingUnit")]
129    pub fn booking_unit(&self) -> Result<Option<BookingUnit<'_>>, InvalidValue> {
130        Ok(self.0.get_str(Tag(590))?.map(BookingUnit::from_value))
131    }
132
133    /// The `PreallocMethod` (591) field.
134    #[doc(alias = "PreallocMethod")]
135    pub fn prealloc_method(&self) -> Result<Option<PreallocMethod<'_>>, InvalidValue> {
136        Ok(self.0.get_str(Tag(591))?.map(PreallocMethod::from_value))
137    }
138
139    /// The `AllocID` (70) field.
140    #[doc(alias = "AllocID")]
141    pub fn alloc_id(&self) -> Result<Option<&str>, InvalidValue> {
142        self.0.get_str(Tag(70))
143    }
144
145    /// The instances of the `NoAllocs` (78) group.
146    #[doc(alias = "NoAllocs")]
147    pub fn allocs(&self) -> Result<Instances<'_, PreAllocMlegGrp<'_>>, InvalidValue> {
148        self.0.get_group(&PreAllocMlegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
149    }
150
151    /// The `SettlType` (63) field.
152    #[doc(alias = "SettlType")]
153    pub fn settl_type(&self) -> Result<Option<SettlType<'_>>, InvalidValue> {
154        Ok(self.0.get_str(Tag(63))?.map(SettlType::from_value))
155    }
156
157    /// The `SettlDate` (64) field.
158    #[doc(alias = "SettlDate")]
159    pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
160        self.0.get_date(Tag(64))
161    }
162
163    /// The `CashMargin` (544) field.
164    #[doc(alias = "CashMargin")]
165    pub fn cash_margin(&self) -> Result<Option<CashMargin<'_>>, InvalidValue> {
166        Ok(self.0.get_str(Tag(544))?.map(CashMargin::from_value))
167    }
168
169    /// The `ClearingFeeIndicator` (635) field.
170    #[doc(alias = "ClearingFeeIndicator")]
171    pub fn clearing_fee_indicator(&self) -> Result<Option<ClearingFeeIndicator<'_>>, InvalidValue> {
172        Ok(self.0.get_str(Tag(635))?.map(ClearingFeeIndicator::from_value))
173    }
174
175    /// The `HandlInst` (21) field.
176    #[doc(alias = "HandlInst")]
177    pub fn handl_inst(&self) -> Result<Option<HandlInst<'_>>, InvalidValue> {
178        Ok(self.0.get_str(Tag(21))?.map(HandlInst::from_value))
179    }
180
181    /// The `ExecInst` (18) field.
182    #[doc(alias = "ExecInst")]
183    pub fn exec_inst(&self) -> Result<Option<MultipleValues<'_, ExecInst<'_>>>, InvalidValue> {
184        self.0.get_multiple_values(Tag(18))
185    }
186
187    /// The `MinQty` (110) field.
188    #[doc(alias = "MinQty")]
189    pub fn min_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
190        self.0.get_decimal(Tag(110))
191    }
192
193    /// The `MaxFloor` (111) field.
194    #[doc(alias = "MaxFloor")]
195    pub fn max_floor(&self) -> Result<Option<Decimal>, InvalidValue> {
196        self.0.get_decimal(Tag(111))
197    }
198
199    /// The `ExDestination` (100) field.
200    #[doc(alias = "ExDestination")]
201    pub fn ex_destination(&self) -> Result<Option<&str>, InvalidValue> {
202        self.0.get_str(Tag(100))
203    }
204
205    /// The instances of the `NoTradingSessions` (386) group.
206    #[doc(alias = "NoTradingSessions")]
207    pub fn trading_sessions(&self) -> Result<Instances<'_, TrdgSesGrp<'_>>, InvalidValue> {
208        self.0.get_group(&TrdgSesGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
209    }
210
211    /// The `ProcessCode` (81) field.
212    #[doc(alias = "ProcessCode")]
213    pub fn process_code(&self) -> Result<Option<ProcessCode<'_>>, InvalidValue> {
214        Ok(self.0.get_str(Tag(81))?.map(ProcessCode::from_value))
215    }
216
217    /// The `Side` (54) field.
218    #[doc(alias = "Side")]
219    pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
220        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
221    }
222
223    /// The `Instrument` component.
224    pub fn instrument(&self) -> Instrument<'_> {
225        Instrument(self.0.scope(), Self::known_tags().get())
226    }
227
228    /// The instances of the `NoUnderlyings` (711) group.
229    #[doc(alias = "NoUnderlyings")]
230    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
231        self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
232    }
233
234    /// The `PrevClosePx` (140) field.
235    #[doc(alias = "PrevClosePx")]
236    pub fn prev_close_px(&self) -> Result<Option<Decimal>, InvalidValue> {
237        self.0.get_decimal(Tag(140))
238    }
239
240    /// The instances of the `NoLegs` (555) group.
241    #[doc(alias = "NoLegs")]
242    pub fn legs(&self) -> Result<Instances<'_, LegOrdGrp<'_>>, InvalidValue> {
243        self.0.get_group(&LegOrdGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
244    }
245
246    /// The `LocateReqd` (114) field.
247    #[doc(alias = "LocateReqd")]
248    pub fn locate_reqd(&self) -> Result<Option<bool>, InvalidValue> {
249        self.0.get_bool(Tag(114))
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 `QtyType` (854) field.
259    #[doc(alias = "QtyType")]
260    pub fn qty_type(&self) -> Result<Option<QtyType>, InvalidValue> {
261        Ok(self.0.get_int(Tag(854))?.map(QtyType::from_value))
262    }
263
264    /// The `OrderQtyData` component.
265    pub fn order_qty_data(&self) -> OrderQtyData<'_> {
266        OrderQtyData(self.0.scope())
267    }
268
269    /// The `OrdType` (40) field.
270    #[doc(alias = "OrdType")]
271    pub fn ord_type(&self) -> Result<Option<OrdType<'_>>, InvalidValue> {
272        Ok(self.0.get_str(Tag(40))?.map(OrdType::from_value))
273    }
274
275    /// The `PriceType` (423) field.
276    #[doc(alias = "PriceType")]
277    pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
278        Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
279    }
280
281    /// The `Price` (44) field.
282    #[doc(alias = "Price")]
283    pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
284        self.0.get_decimal(Tag(44))
285    }
286
287    /// The `StopPx` (99) field.
288    #[doc(alias = "StopPx")]
289    pub fn stop_px(&self) -> Result<Option<Decimal>, InvalidValue> {
290        self.0.get_decimal(Tag(99))
291    }
292
293    /// The `Currency` (15) field.
294    #[doc(alias = "Currency")]
295    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
296        self.0.get_str(Tag(15))
297    }
298
299    /// The `ComplianceID` (376) field.
300    #[doc(alias = "ComplianceID")]
301    pub fn compliance_id(&self) -> Result<Option<&str>, InvalidValue> {
302        self.0.get_str(Tag(376))
303    }
304
305    /// The `SolicitedFlag` (377) field.
306    #[doc(alias = "SolicitedFlag")]
307    pub fn solicited_flag(&self) -> Result<Option<bool>, InvalidValue> {
308        self.0.get_bool(Tag(377))
309    }
310
311    /// The `IOIID` (23) field.
312    #[doc(alias = "IOIID")]
313    pub fn ioiid(&self) -> Result<Option<&str>, InvalidValue> {
314        self.0.get_str(Tag(23))
315    }
316
317    /// The `QuoteID` (117) field.
318    #[doc(alias = "QuoteID")]
319    pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
320        self.0.get_str(Tag(117))
321    }
322
323    /// The `TimeInForce` (59) field.
324    #[doc(alias = "TimeInForce")]
325    pub fn time_in_force(&self) -> Result<Option<TimeInForce<'_>>, InvalidValue> {
326        Ok(self.0.get_str(Tag(59))?.map(TimeInForce::from_value))
327    }
328
329    /// The `EffectiveTime` (168) field.
330    #[doc(alias = "EffectiveTime")]
331    pub fn effective_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
332        self.0.get_utc_timestamp(Tag(168))
333    }
334
335    /// The `ExpireDate` (432) field.
336    #[doc(alias = "ExpireDate")]
337    pub fn expire_date(&self) -> Result<Option<Date>, InvalidValue> {
338        self.0.get_date(Tag(432))
339    }
340
341    /// The `ExpireTime` (126) field.
342    #[doc(alias = "ExpireTime")]
343    pub fn expire_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
344        self.0.get_utc_timestamp(Tag(126))
345    }
346
347    /// The `GTBookingInst` (427) field.
348    #[doc(alias = "GTBookingInst")]
349    pub fn gt_booking_inst(&self) -> Result<Option<GTBookingInst>, InvalidValue> {
350        Ok(self.0.get_int(Tag(427))?.map(GTBookingInst::from_value))
351    }
352
353    /// The `CommissionData` component.
354    pub fn commission_data(&self) -> CommissionData<'_> {
355        CommissionData(self.0.scope())
356    }
357
358    /// The `OrderCapacity` (528) field.
359    #[doc(alias = "OrderCapacity")]
360    pub fn order_capacity(&self) -> Result<Option<OrderCapacity<'_>>, InvalidValue> {
361        Ok(self.0.get_str(Tag(528))?.map(OrderCapacity::from_value))
362    }
363
364    /// The `OrderRestrictions` (529) field.
365    #[doc(alias = "OrderRestrictions")]
366    pub fn order_restrictions(&self) -> Result<Option<MultipleValues<'_, OrderRestrictions<'_>>>, InvalidValue> {
367        self.0.get_multiple_values(Tag(529))
368    }
369
370    /// The `CustOrderCapacity` (582) field.
371    #[doc(alias = "CustOrderCapacity")]
372    pub fn cust_order_capacity(&self) -> Result<Option<CustOrderCapacity>, InvalidValue> {
373        Ok(self.0.get_int(Tag(582))?.map(CustOrderCapacity::from_value))
374    }
375
376    /// The `ForexReq` (121) field.
377    #[doc(alias = "ForexReq")]
378    pub fn forex_req(&self) -> Result<Option<bool>, InvalidValue> {
379        self.0.get_bool(Tag(121))
380    }
381
382    /// The `SettlCurrency` (120) field.
383    #[doc(alias = "SettlCurrency")]
384    pub fn settl_currency(&self) -> Result<Option<&str>, InvalidValue> {
385        self.0.get_str(Tag(120))
386    }
387
388    /// The `BookingType` (775) field.
389    #[doc(alias = "BookingType")]
390    pub fn booking_type(&self) -> Result<Option<BookingType>, InvalidValue> {
391        Ok(self.0.get_int(Tag(775))?.map(BookingType::from_value))
392    }
393
394    /// The `Text` (58) field.
395    #[doc(alias = "Text")]
396    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
397        self.0.get_str(Tag(58))
398    }
399
400    /// The `EncodedTextLen` (354) field.
401    #[doc(alias = "EncodedTextLen")]
402    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
403        self.0.get_int(Tag(354))
404    }
405
406    /// The `EncodedText` (355) field.
407    #[doc(alias = "EncodedText")]
408    pub fn encoded_text(&self) -> Option<&[u8]> {
409        self.0.get(Tag(355))
410    }
411
412    /// The `PositionEffect` (77) field.
413    #[doc(alias = "PositionEffect")]
414    pub fn position_effect(&self) -> Result<Option<PositionEffect<'_>>, InvalidValue> {
415        Ok(self.0.get_str(Tag(77))?.map(PositionEffect::from_value))
416    }
417
418    /// The `CoveredOrUncovered` (203) field.
419    #[doc(alias = "CoveredOrUncovered")]
420    pub fn covered_or_uncovered(&self) -> Result<Option<CoveredOrUncovered>, InvalidValue> {
421        Ok(self.0.get_int(Tag(203))?.map(CoveredOrUncovered::from_value))
422    }
423
424    /// The `MaxShow` (210) field.
425    #[doc(alias = "MaxShow")]
426    pub fn max_show(&self) -> Result<Option<Decimal>, InvalidValue> {
427        self.0.get_decimal(Tag(210))
428    }
429
430    /// The `PegInstructions` component.
431    pub fn peg_instructions(&self) -> PegInstructions<'_> {
432        PegInstructions(self.0.scope())
433    }
434
435    /// The `DiscretionInstructions` component.
436    pub fn discretion_instructions(&self) -> DiscretionInstructions<'_> {
437        DiscretionInstructions(self.0.scope())
438    }
439
440    /// The `TargetStrategy` (847) field.
441    #[doc(alias = "TargetStrategy")]
442    pub fn target_strategy(&self) -> Result<Option<TargetStrategy>, InvalidValue> {
443        Ok(self.0.get_int(Tag(847))?.map(TargetStrategy::from_value))
444    }
445
446    /// The `TargetStrategyParameters` (848) field.
447    #[doc(alias = "TargetStrategyParameters")]
448    pub fn target_strategy_parameters(&self) -> Result<Option<&str>, InvalidValue> {
449        self.0.get_str(Tag(848))
450    }
451
452    /// The `ParticipationRate` (849) field.
453    #[doc(alias = "ParticipationRate")]
454    pub fn participation_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
455        self.0.get_decimal(Tag(849))
456    }
457
458    /// The `CancellationRights` (480) field.
459    #[doc(alias = "CancellationRights")]
460    pub fn cancellation_rights(&self) -> Result<Option<CancellationRights<'_>>, InvalidValue> {
461        Ok(self.0.get_str(Tag(480))?.map(CancellationRights::from_value))
462    }
463
464    /// The `MoneyLaunderingStatus` (481) field.
465    #[doc(alias = "MoneyLaunderingStatus")]
466    pub fn money_laundering_status(&self) -> Result<Option<MoneyLaunderingStatus<'_>>, InvalidValue> {
467        Ok(self.0.get_str(Tag(481))?.map(MoneyLaunderingStatus::from_value))
468    }
469
470    /// The `RegistID` (513) field.
471    #[doc(alias = "RegistID")]
472    pub fn regist_id(&self) -> Result<Option<&str>, InvalidValue> {
473        self.0.get_str(Tag(513))
474    }
475
476    /// The `Designation` (494) field.
477    #[doc(alias = "Designation")]
478    pub fn designation(&self) -> Result<Option<&str>, InvalidValue> {
479        self.0.get_str(Tag(494))
480    }
481
482    /// The `MultiLegRptTypeReq` (563) field.
483    #[doc(alias = "MultiLegRptTypeReq")]
484    pub fn multi_leg_rpt_type_req(&self) -> Result<Option<MultiLegRptTypeReq>, InvalidValue> {
485        Ok(self.0.get_int(Tag(563))?.map(MultiLegRptTypeReq::from_value))
486    }
487}
488
489impl std::fmt::Debug for NewOrderMultileg {
490    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
491        write!(f, "NewOrderMultileg({})", self.0)
492    }
493}
494
495impl std::fmt::Display for NewOrderMultileg {
496    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
497        std::fmt::Display::fmt(&self.0, f)
498    }
499}