Skip to main content

refix_fix44/generated/messages/
new_order_cross.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    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
18/// The `NewOrderCross` (35=s) message.
19pub 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    /// The `CrossID` (548) field.
61    #[doc(alias = "CrossID")]
62    pub fn cross_id(&self) -> Result<Option<&str>, InvalidValue> {
63        self.0.get_str(Tag(548))
64    }
65
66    /// The `CrossType` (549) field.
67    #[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    /// The `CrossPrioritization` (550) field.
73    #[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    /// The instances of the `NoSides` (552) group.
79    #[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    /// The `Instrument` component.
85    pub fn instrument(&self) -> Instrument<'_> {
86        Instrument(self.0.scope(), Self::known_tags().get())
87    }
88
89    /// The instances of the `NoUnderlyings` (711) group.
90    #[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    /// The instances of the `NoLegs` (555) group.
96    #[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    /// The `SettlType` (63) field.
102    #[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    /// The `SettlDate` (64) field.
108    #[doc(alias = "SettlDate")]
109    pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
110        self.0.get_date(Tag(64))
111    }
112
113    /// The `HandlInst` (21) field.
114    #[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    /// The `ExecInst` (18) field.
120    #[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    /// The `MinQty` (110) field.
126    #[doc(alias = "MinQty")]
127    pub fn min_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
128        self.0.get_decimal(Tag(110))
129    }
130
131    /// The `MaxFloor` (111) field.
132    #[doc(alias = "MaxFloor")]
133    pub fn max_floor(&self) -> Result<Option<Decimal>, InvalidValue> {
134        self.0.get_decimal(Tag(111))
135    }
136
137    /// The `ExDestination` (100) field.
138    #[doc(alias = "ExDestination")]
139    pub fn ex_destination(&self) -> Result<Option<&str>, InvalidValue> {
140        self.0.get_str(Tag(100))
141    }
142
143    /// The instances of the `NoTradingSessions` (386) group.
144    #[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    /// The `ProcessCode` (81) field.
150    #[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    /// The `PrevClosePx` (140) field.
156    #[doc(alias = "PrevClosePx")]
157    pub fn prev_close_px(&self) -> Result<Option<Decimal>, InvalidValue> {
158        self.0.get_decimal(Tag(140))
159    }
160
161    /// The `LocateReqd` (114) field.
162    #[doc(alias = "LocateReqd")]
163    pub fn locate_reqd(&self) -> Result<Option<bool>, InvalidValue> {
164        self.0.get_bool(Tag(114))
165    }
166
167    /// The `TransactTime` (60) field.
168    #[doc(alias = "TransactTime")]
169    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
170        self.0.get_utc_timestamp(Tag(60))
171    }
172
173    /// The instances of the `NoStipulations` (232) group.
174    #[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    /// The `OrdType` (40) field.
180    #[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    /// The `PriceType` (423) field.
186    #[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    /// The `Price` (44) field.
192    #[doc(alias = "Price")]
193    pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
194        self.0.get_decimal(Tag(44))
195    }
196
197    /// The `StopPx` (99) field.
198    #[doc(alias = "StopPx")]
199    pub fn stop_px(&self) -> Result<Option<Decimal>, InvalidValue> {
200        self.0.get_decimal(Tag(99))
201    }
202
203    /// The `SpreadOrBenchmarkCurveData` component.
204    pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'_> {
205        SpreadOrBenchmarkCurveData(self.0.scope())
206    }
207
208    /// The `YieldData` component.
209    pub fn yield_data(&self) -> YieldData<'_> {
210        YieldData(self.0.scope())
211    }
212
213    /// The `Currency` (15) field.
214    #[doc(alias = "Currency")]
215    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
216        self.0.get_str(Tag(15))
217    }
218
219    /// The `ComplianceID` (376) field.
220    #[doc(alias = "ComplianceID")]
221    pub fn compliance_id(&self) -> Result<Option<&str>, InvalidValue> {
222        self.0.get_str(Tag(376))
223    }
224
225    /// The `IOIID` (23) field.
226    #[doc(alias = "IOIID")]
227    pub fn ioiid(&self) -> Result<Option<&str>, InvalidValue> {
228        self.0.get_str(Tag(23))
229    }
230
231    /// The `QuoteID` (117) field.
232    #[doc(alias = "QuoteID")]
233    pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
234        self.0.get_str(Tag(117))
235    }
236
237    /// The `TimeInForce` (59) field.
238    #[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    /// The `EffectiveTime` (168) field.
244    #[doc(alias = "EffectiveTime")]
245    pub fn effective_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
246        self.0.get_utc_timestamp(Tag(168))
247    }
248
249    /// The `ExpireDate` (432) field.
250    #[doc(alias = "ExpireDate")]
251    pub fn expire_date(&self) -> Result<Option<Date>, InvalidValue> {
252        self.0.get_date(Tag(432))
253    }
254
255    /// The `ExpireTime` (126) field.
256    #[doc(alias = "ExpireTime")]
257    pub fn expire_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
258        self.0.get_utc_timestamp(Tag(126))
259    }
260
261    /// The `GTBookingInst` (427) field.
262    #[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    /// The `MaxShow` (210) field.
268    #[doc(alias = "MaxShow")]
269    pub fn max_show(&self) -> Result<Option<Decimal>, InvalidValue> {
270        self.0.get_decimal(Tag(210))
271    }
272
273    /// The `PegInstructions` component.
274    pub fn peg_instructions(&self) -> PegInstructions<'_> {
275        PegInstructions(self.0.scope())
276    }
277
278    /// The `DiscretionInstructions` component.
279    pub fn discretion_instructions(&self) -> DiscretionInstructions<'_> {
280        DiscretionInstructions(self.0.scope())
281    }
282
283    /// The `TargetStrategy` (847) field.
284    #[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    /// The `TargetStrategyParameters` (848) field.
290    #[doc(alias = "TargetStrategyParameters")]
291    pub fn target_strategy_parameters(&self) -> Result<Option<&str>, InvalidValue> {
292        self.0.get_str(Tag(848))
293    }
294
295    /// The `ParticipationRate` (849) field.
296    #[doc(alias = "ParticipationRate")]
297    pub fn participation_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
298        self.0.get_decimal(Tag(849))
299    }
300
301    /// The `CancellationRights` (480) field.
302    #[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    /// The `MoneyLaunderingStatus` (481) field.
308    #[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    /// The `RegistID` (513) field.
314    #[doc(alias = "RegistID")]
315    pub fn regist_id(&self) -> Result<Option<&str>, InvalidValue> {
316        self.0.get_str(Tag(513))
317    }
318
319    /// The `Designation` (494) field.
320    #[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}