Skip to main content

refix_fix44/generated/messages/
confirmation.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, RawMessage, Tag, UtcTimestamp,
6};
7
8use super::super::components::{
9    CommissionData, CpctyConfGrp, FinancingDetails, Header, InstrmtLegGrp, Instrument,
10    InstrumentExtension, MiscFeesGrp, OrdAllocGrp, Parties, SettlInstructionsData,
11    SpreadOrBenchmarkCurveData, Stipulations, Trailer, TrdRegTimestamps, UndInstrmtGrp, YieldData,
12};
13use super::super::enums::{
14    AllocAccountType, ConfirmStatus, ConfirmTransType, ConfirmType, PriceType, ProcessCode, QtyType,
15    SettlCurrFxRateCalc, SettlType, Side,
16};
17
18/// The `Confirmation` (35=AK) message.
19pub struct Confirmation(RawMessage);
20
21impl Confirmation {
22    pub const MSG_TYPE: &[u8] = b"AK";
23
24    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
25        static TAGS: LazyKnownTags = LazyKnownTags::new(
26            &[
27                Tag(664), Tag(772), Tag(859), Tag(666), Tag(773), Tag(797), Tag(650), Tag(665),
28                Tag(453), Tag(73), Tag(70), Tag(793), Tag(467), Tag(60), Tag(75), Tag(768),
29                Tag(711), Tag(555), Tag(80), Tag(854), Tag(54), Tag(15), Tag(30), Tag(862), Tag(79),
30                Tag(661), Tag(798), Tag(6), Tag(74), Tag(423), Tag(860), Tag(861), Tag(58),
31                Tag(354), Tag(355), Tag(81), Tag(381), Tag(157), Tag(230), Tag(158), Tag(159),
32                Tag(738), Tag(920), Tag(921), Tag(922), Tag(238), Tag(237), Tag(118), Tag(890),
33                Tag(119), Tag(120), Tag(155), Tag(156), Tag(63), Tag(64), Tag(858), Tag(232),
34                Tag(136),
35            ],
36            &[
37                Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
38                OrdAllocGrp::known_tags(), TrdRegTimestamps::known_tags(), Instrument::known_tags(),
39                InstrumentExtension::known_tags(), FinancingDetails::known_tags(),
40                UndInstrmtGrp::known_tags(), InstrmtLegGrp::known_tags(), YieldData::known_tags(),
41                CpctyConfGrp::known_tags(), SpreadOrBenchmarkCurveData::known_tags(),
42                SettlInstructionsData::known_tags(), CommissionData::known_tags(),
43                Stipulations::known_tags(), MiscFeesGrp::known_tags(),
44            ],
45        );
46        &TAGS
47    }
48
49    pub fn from_raw(raw: RawMessage) -> Self {
50        Self(raw)
51    }
52
53    pub fn raw(&self) -> &RawMessage {
54        &self.0
55    }
56
57    pub fn header(&self) -> Header<'_> {
58        Header(self.0.scope(), Self::known_tags().get())
59    }
60
61    pub fn trailer(&self) -> Trailer<'_> {
62        Trailer(self.0.scope())
63    }
64
65    /// The `ConfirmID` (664) field.
66    #[doc(alias = "ConfirmID")]
67    pub fn confirm_id(&self) -> Result<Option<&str>, InvalidValue> {
68        self.0.get_str(Tag(664))
69    }
70
71    /// The `ConfirmRefID` (772) field.
72    #[doc(alias = "ConfirmRefID")]
73    pub fn confirm_ref_id(&self) -> Result<Option<&str>, InvalidValue> {
74        self.0.get_str(Tag(772))
75    }
76
77    /// The `ConfirmReqID` (859) field.
78    #[doc(alias = "ConfirmReqID")]
79    pub fn confirm_req_id(&self) -> Result<Option<&str>, InvalidValue> {
80        self.0.get_str(Tag(859))
81    }
82
83    /// The `ConfirmTransType` (666) field.
84    #[doc(alias = "ConfirmTransType")]
85    pub fn confirm_trans_type(&self) -> Result<Option<ConfirmTransType>, InvalidValue> {
86        Ok(self.0.get_int(Tag(666))?.map(ConfirmTransType::from_value))
87    }
88
89    /// The `ConfirmType` (773) field.
90    #[doc(alias = "ConfirmType")]
91    pub fn confirm_type(&self) -> Result<Option<ConfirmType>, InvalidValue> {
92        Ok(self.0.get_int(Tag(773))?.map(ConfirmType::from_value))
93    }
94
95    /// The `CopyMsgIndicator` (797) field.
96    #[doc(alias = "CopyMsgIndicator")]
97    pub fn copy_msg_indicator(&self) -> Result<Option<bool>, InvalidValue> {
98        self.0.get_bool(Tag(797))
99    }
100
101    /// The `LegalConfirm` (650) field.
102    #[doc(alias = "LegalConfirm")]
103    pub fn legal_confirm(&self) -> Result<Option<bool>, InvalidValue> {
104        self.0.get_bool(Tag(650))
105    }
106
107    /// The `ConfirmStatus` (665) field.
108    #[doc(alias = "ConfirmStatus")]
109    pub fn confirm_status(&self) -> Result<Option<ConfirmStatus>, InvalidValue> {
110        Ok(self.0.get_int(Tag(665))?.map(ConfirmStatus::from_value))
111    }
112
113    /// The instances of the `NoPartyIDs` (453) group.
114    #[doc(alias = "NoPartyIDs")]
115    pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
116        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
117    }
118
119    /// The instances of the `NoOrders` (73) group.
120    #[doc(alias = "NoOrders")]
121    pub fn orders(&self) -> Result<Instances<'_, OrdAllocGrp<'_>>, InvalidValue> {
122        self.0.get_group(&OrdAllocGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
123    }
124
125    /// The `AllocID` (70) field.
126    #[doc(alias = "AllocID")]
127    pub fn alloc_id(&self) -> Result<Option<&str>, InvalidValue> {
128        self.0.get_str(Tag(70))
129    }
130
131    /// The `SecondaryAllocID` (793) field.
132    #[doc(alias = "SecondaryAllocID")]
133    pub fn secondary_alloc_id(&self) -> Result<Option<&str>, InvalidValue> {
134        self.0.get_str(Tag(793))
135    }
136
137    /// The `IndividualAllocID` (467) field.
138    #[doc(alias = "IndividualAllocID")]
139    pub fn individual_alloc_id(&self) -> Result<Option<&str>, InvalidValue> {
140        self.0.get_str(Tag(467))
141    }
142
143    /// The `TransactTime` (60) field.
144    #[doc(alias = "TransactTime")]
145    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
146        self.0.get_utc_timestamp(Tag(60))
147    }
148
149    /// The `TradeDate` (75) field.
150    #[doc(alias = "TradeDate")]
151    pub fn trade_date(&self) -> Result<Option<Date>, InvalidValue> {
152        self.0.get_date(Tag(75))
153    }
154
155    /// The instances of the `NoTrdRegTimestamps` (768) group.
156    #[doc(alias = "NoTrdRegTimestamps")]
157    pub fn trd_reg_timestamps(&self) -> Result<Instances<'_, TrdRegTimestamps<'_>>, InvalidValue> {
158        self.0.get_group(&TrdRegTimestamps::TABLE, &Self::known_tags().get()).map(Instances::from)
159    }
160
161    /// The `Instrument` component.
162    pub fn instrument(&self) -> Instrument<'_> {
163        Instrument(self.0.scope(), Self::known_tags().get())
164    }
165
166    /// The `InstrumentExtension` component.
167    pub fn instrument_extension(&self) -> InstrumentExtension<'_> {
168        InstrumentExtension(self.0.scope(), Self::known_tags().get())
169    }
170
171    /// The `FinancingDetails` component.
172    pub fn financing_details(&self) -> FinancingDetails<'_> {
173        FinancingDetails(self.0.scope())
174    }
175
176    /// The instances of the `NoUnderlyings` (711) group.
177    #[doc(alias = "NoUnderlyings")]
178    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
179        self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
180    }
181
182    /// The instances of the `NoLegs` (555) group.
183    #[doc(alias = "NoLegs")]
184    pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
185        self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
186    }
187
188    /// The `YieldData` component.
189    pub fn yield_data(&self) -> YieldData<'_> {
190        YieldData(self.0.scope())
191    }
192
193    /// The `AllocQty` (80) field.
194    #[doc(alias = "AllocQty")]
195    pub fn alloc_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
196        self.0.get_decimal(Tag(80))
197    }
198
199    /// The `QtyType` (854) field.
200    #[doc(alias = "QtyType")]
201    pub fn qty_type(&self) -> Result<Option<QtyType>, InvalidValue> {
202        Ok(self.0.get_int(Tag(854))?.map(QtyType::from_value))
203    }
204
205    /// The `Side` (54) field.
206    #[doc(alias = "Side")]
207    pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
208        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
209    }
210
211    /// The `Currency` (15) field.
212    #[doc(alias = "Currency")]
213    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
214        self.0.get_str(Tag(15))
215    }
216
217    /// The `LastMkt` (30) field.
218    #[doc(alias = "LastMkt")]
219    pub fn last_mkt(&self) -> Result<Option<&str>, InvalidValue> {
220        self.0.get_str(Tag(30))
221    }
222
223    /// The instances of the `NoCapacities` (862) group.
224    #[doc(alias = "NoCapacities")]
225    pub fn capacities(&self) -> Result<Instances<'_, CpctyConfGrp<'_>>, InvalidValue> {
226        self.0.get_group(&CpctyConfGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
227    }
228
229    /// The `AllocAccount` (79) field.
230    #[doc(alias = "AllocAccount")]
231    pub fn alloc_account(&self) -> Result<Option<&str>, InvalidValue> {
232        self.0.get_str(Tag(79))
233    }
234
235    /// The `AllocAcctIDSource` (661) field.
236    #[doc(alias = "AllocAcctIDSource")]
237    pub fn alloc_acct_id_source(&self) -> Result<Option<i64>, InvalidValue> {
238        self.0.get_int(Tag(661))
239    }
240
241    /// The `AllocAccountType` (798) field.
242    #[doc(alias = "AllocAccountType")]
243    pub fn alloc_account_type(&self) -> Result<Option<AllocAccountType>, InvalidValue> {
244        Ok(self.0.get_int(Tag(798))?.map(AllocAccountType::from_value))
245    }
246
247    /// The `AvgPx` (6) field.
248    #[doc(alias = "AvgPx")]
249    pub fn avg_px(&self) -> Result<Option<Decimal>, InvalidValue> {
250        self.0.get_decimal(Tag(6))
251    }
252
253    /// The `AvgPxPrecision` (74) field.
254    #[doc(alias = "AvgPxPrecision")]
255    pub fn avg_px_precision(&self) -> Result<Option<i64>, InvalidValue> {
256        self.0.get_int(Tag(74))
257    }
258
259    /// The `PriceType` (423) field.
260    #[doc(alias = "PriceType")]
261    pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
262        Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
263    }
264
265    /// The `AvgParPx` (860) field.
266    #[doc(alias = "AvgParPx")]
267    pub fn avg_par_px(&self) -> Result<Option<Decimal>, InvalidValue> {
268        self.0.get_decimal(Tag(860))
269    }
270
271    /// The `SpreadOrBenchmarkCurveData` component.
272    pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'_> {
273        SpreadOrBenchmarkCurveData(self.0.scope())
274    }
275
276    /// The `ReportedPx` (861) field.
277    #[doc(alias = "ReportedPx")]
278    pub fn reported_px(&self) -> Result<Option<Decimal>, InvalidValue> {
279        self.0.get_decimal(Tag(861))
280    }
281
282    /// The `Text` (58) field.
283    #[doc(alias = "Text")]
284    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
285        self.0.get_str(Tag(58))
286    }
287
288    /// The `EncodedTextLen` (354) field.
289    #[doc(alias = "EncodedTextLen")]
290    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
291        self.0.get_int(Tag(354))
292    }
293
294    /// The `EncodedText` (355) field.
295    #[doc(alias = "EncodedText")]
296    pub fn encoded_text(&self) -> Option<&[u8]> {
297        self.0.get(Tag(355))
298    }
299
300    /// The `ProcessCode` (81) field.
301    #[doc(alias = "ProcessCode")]
302    pub fn process_code(&self) -> Result<Option<ProcessCode<'_>>, InvalidValue> {
303        Ok(self.0.get_str(Tag(81))?.map(ProcessCode::from_value))
304    }
305
306    /// The `GrossTradeAmt` (381) field.
307    #[doc(alias = "GrossTradeAmt")]
308    pub fn gross_trade_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
309        self.0.get_decimal(Tag(381))
310    }
311
312    /// The `NumDaysInterest` (157) field.
313    #[doc(alias = "NumDaysInterest")]
314    pub fn num_days_interest(&self) -> Result<Option<i64>, InvalidValue> {
315        self.0.get_int(Tag(157))
316    }
317
318    /// The `ExDate` (230) field.
319    #[doc(alias = "ExDate")]
320    pub fn ex_date(&self) -> Result<Option<Date>, InvalidValue> {
321        self.0.get_date(Tag(230))
322    }
323
324    /// The `AccruedInterestRate` (158) field.
325    #[doc(alias = "AccruedInterestRate")]
326    pub fn accrued_interest_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
327        self.0.get_decimal(Tag(158))
328    }
329
330    /// The `AccruedInterestAmt` (159) field.
331    #[doc(alias = "AccruedInterestAmt")]
332    pub fn accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
333        self.0.get_decimal(Tag(159))
334    }
335
336    /// The `InterestAtMaturity` (738) field.
337    #[doc(alias = "InterestAtMaturity")]
338    pub fn interest_at_maturity(&self) -> Result<Option<Decimal>, InvalidValue> {
339        self.0.get_decimal(Tag(738))
340    }
341
342    /// The `EndAccruedInterestAmt` (920) field.
343    #[doc(alias = "EndAccruedInterestAmt")]
344    pub fn end_accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
345        self.0.get_decimal(Tag(920))
346    }
347
348    /// The `StartCash` (921) field.
349    #[doc(alias = "StartCash")]
350    pub fn start_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
351        self.0.get_decimal(Tag(921))
352    }
353
354    /// The `EndCash` (922) field.
355    #[doc(alias = "EndCash")]
356    pub fn end_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
357        self.0.get_decimal(Tag(922))
358    }
359
360    /// The `Concession` (238) field.
361    #[doc(alias = "Concession")]
362    pub fn concession(&self) -> Result<Option<Decimal>, InvalidValue> {
363        self.0.get_decimal(Tag(238))
364    }
365
366    /// The `TotalTakedown` (237) field.
367    #[doc(alias = "TotalTakedown")]
368    pub fn total_takedown(&self) -> Result<Option<Decimal>, InvalidValue> {
369        self.0.get_decimal(Tag(237))
370    }
371
372    /// The `NetMoney` (118) field.
373    #[doc(alias = "NetMoney")]
374    pub fn net_money(&self) -> Result<Option<Decimal>, InvalidValue> {
375        self.0.get_decimal(Tag(118))
376    }
377
378    /// The `MaturityNetMoney` (890) field.
379    #[doc(alias = "MaturityNetMoney")]
380    pub fn maturity_net_money(&self) -> Result<Option<Decimal>, InvalidValue> {
381        self.0.get_decimal(Tag(890))
382    }
383
384    /// The `SettlCurrAmt` (119) field.
385    #[doc(alias = "SettlCurrAmt")]
386    pub fn settl_curr_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
387        self.0.get_decimal(Tag(119))
388    }
389
390    /// The `SettlCurrency` (120) field.
391    #[doc(alias = "SettlCurrency")]
392    pub fn settl_currency(&self) -> Result<Option<&str>, InvalidValue> {
393        self.0.get_str(Tag(120))
394    }
395
396    /// The `SettlCurrFxRate` (155) field.
397    #[doc(alias = "SettlCurrFxRate")]
398    pub fn settl_curr_fx_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
399        self.0.get_decimal(Tag(155))
400    }
401
402    /// The `SettlCurrFxRateCalc` (156) field.
403    #[doc(alias = "SettlCurrFxRateCalc")]
404    pub fn settl_curr_fx_rate_calc(&self) -> Result<Option<SettlCurrFxRateCalc<'_>>, InvalidValue> {
405        Ok(self.0.get_str(Tag(156))?.map(SettlCurrFxRateCalc::from_value))
406    }
407
408    /// The `SettlType` (63) field.
409    #[doc(alias = "SettlType")]
410    pub fn settl_type(&self) -> Result<Option<SettlType<'_>>, InvalidValue> {
411        Ok(self.0.get_str(Tag(63))?.map(SettlType::from_value))
412    }
413
414    /// The `SettlDate` (64) field.
415    #[doc(alias = "SettlDate")]
416    pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
417        self.0.get_date(Tag(64))
418    }
419
420    /// The `SettlInstructionsData` component.
421    pub fn settl_instructions_data(&self) -> SettlInstructionsData<'_> {
422        SettlInstructionsData(self.0.scope(), Self::known_tags().get())
423    }
424
425    /// The `CommissionData` component.
426    pub fn commission_data(&self) -> CommissionData<'_> {
427        CommissionData(self.0.scope())
428    }
429
430    /// The `SharedCommission` (858) field.
431    #[doc(alias = "SharedCommission")]
432    pub fn shared_commission(&self) -> Result<Option<Decimal>, InvalidValue> {
433        self.0.get_decimal(Tag(858))
434    }
435
436    /// The instances of the `NoStipulations` (232) group.
437    #[doc(alias = "NoStipulations")]
438    pub fn stipulations(&self) -> Result<Instances<'_, Stipulations<'_>>, InvalidValue> {
439        self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
440    }
441
442    /// The instances of the `NoMiscFees` (136) group.
443    #[doc(alias = "NoMiscFees")]
444    pub fn misc_fees(&self) -> Result<Instances<'_, MiscFeesGrp<'_>>, InvalidValue> {
445        self.0.get_group(&MiscFeesGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
446    }
447}
448
449impl std::fmt::Debug for Confirmation {
450    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
451        write!(f, "Confirmation({})", self.0)
452    }
453}
454
455impl std::fmt::Display for Confirmation {
456    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
457        std::fmt::Display::fmt(&self.0, f)
458    }
459}