refix-fix44 0.12.0

Typed FIX 4.4 protocol messages for the ReFIX engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
// @generated by refix codegen from FIX44.xml. Do not edit.
#![cfg_attr(rustfmt, rustfmt::skip)]

use refix_message::{
    Date, Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, MultipleValues, Tag,
    UtcTimestamp,
};

use super::super::enums::{
    AccountType, AcctIDSource, CustOrderCapacity, ExecInst, OrdType, OrderCapacity,
    OrderRestrictions, PositionEffect, PreallocMethod, ProcessCode, SettlCurrFxRateCalc, Side,
    SideMultiLegReportingType, TradeAllocIndicator,
};
use super::{
    ClrInstGrp, CommissionData, ContAmtGrp, MiscFeesGrp, Parties, Stipulations, TrdAllocGrp,
};

/// An instance of the `NoSides` (552) group.
#[derive(Clone, Copy)]
pub struct TrdCapRptSideGrp<'a>(refix_message::Scope<'a>);

impl<'a> From<refix_message::Scope<'a>> for TrdCapRptSideGrp<'a> {
    fn from(scope: refix_message::Scope<'a>) -> Self {
        Self(scope)
    }
}

impl<'a> TrdCapRptSideGrp<'a> {
    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
        Tag(552),
        Tag(54),
        &[
            Tag(1), Tag(11), Tag(12), Tag(13), Tag(15), Tag(18), Tag(37), Tag(40), Tag(54), Tag(58),
            Tag(66), Tag(70), Tag(77), Tag(78), Tag(81), Tag(118), Tag(119), Tag(120), Tag(136),
            Tag(155), Tag(156), Tag(157), Tag(158), Tag(159), Tag(198), Tag(230), Tag(232),
            Tag(237), Tag(238), Tag(336), Tag(354), Tag(355), Tag(376), Tag(377), Tag(381),
            Tag(453), Tag(479), Tag(483), Tag(497), Tag(518), Tag(526), Tag(528), Tag(529),
            Tag(575), Tag(576), Tag(578), Tag(579), Tag(581), Tag(582), Tag(591), Tag(625),
            Tag(660), Tag(738), Tag(752), Tag(821), Tag(825), Tag(826), Tag(920), Tag(921),
            Tag(922), Tag(943),
        ],
        &[
            Parties::TABLE, ClrInstGrp::TABLE, ContAmtGrp::TABLE, Stipulations::TABLE,
            MiscFeesGrp::TABLE, TrdAllocGrp::TABLE,
        ],
    );

    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
        static TAGS: LazyKnownTags = LazyKnownTags::new(
            &[
                Tag(54), Tag(37), Tag(198), Tag(11), Tag(526), Tag(66), Tag(453), Tag(1), Tag(660),
                Tag(581), Tag(81), Tag(575), Tag(576), Tag(578), Tag(579), Tag(821), Tag(15),
                Tag(376), Tag(377), Tag(528), Tag(529), Tag(582), Tag(40), Tag(18), Tag(483),
                Tag(336), Tag(625), Tag(943), Tag(381), Tag(157), Tag(230), Tag(158), Tag(159),
                Tag(738), Tag(920), Tag(921), Tag(922), Tag(238), Tag(237), Tag(118), Tag(119),
                Tag(120), Tag(155), Tag(156), Tag(77), Tag(58), Tag(354), Tag(355), Tag(752),
                Tag(518), Tag(232), Tag(136), Tag(825), Tag(826), Tag(591), Tag(70), Tag(78),
            ],
            &[
                Parties::known_tags(), ClrInstGrp::known_tags(), CommissionData::known_tags(),
                ContAmtGrp::known_tags(), Stipulations::known_tags(), MiscFeesGrp::known_tags(),
                TrdAllocGrp::known_tags(),
            ],
        );
        &TAGS
    }

    pub fn raw(&self) -> refix_message::Scope<'a> {
        self.0
    }

    /// The `Side` (54) field.
    #[doc(alias = "Side")]
    pub fn side(&self) -> Result<Option<Side<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
    }

    /// The `OrderID` (37) field.
    #[doc(alias = "OrderID")]
    pub fn order_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(37))
    }

    /// The `SecondaryOrderID` (198) field.
    #[doc(alias = "SecondaryOrderID")]
    pub fn secondary_order_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(198))
    }

    /// The `ClOrdID` (11) field.
    #[doc(alias = "ClOrdID")]
    pub fn cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(11))
    }

    /// The `SecondaryClOrdID` (526) field.
    #[doc(alias = "SecondaryClOrdID")]
    pub fn secondary_cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(526))
    }

    /// The `ListID` (66) field.
    #[doc(alias = "ListID")]
    pub fn list_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(66))
    }

    /// The instances of the `NoPartyIDs` (453) group.
    #[doc(alias = "NoPartyIDs")]
    pub fn party_ids(&self) -> Result<Instances<'a, Parties<'a>>, InvalidValue> {
        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
    }

    /// The `Account` (1) field.
    #[doc(alias = "Account")]
    pub fn account(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(1))
    }

    /// The `AcctIDSource` (660) field.
    #[doc(alias = "AcctIDSource")]
    pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
        Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
    }

    /// The `AccountType` (581) field.
    #[doc(alias = "AccountType")]
    pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
        Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
    }

    /// The `ProcessCode` (81) field.
    #[doc(alias = "ProcessCode")]
    pub fn process_code(&self) -> Result<Option<ProcessCode<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(81))?.map(ProcessCode::from_value))
    }

    /// The `OddLot` (575) field.
    #[doc(alias = "OddLot")]
    pub fn odd_lot(&self) -> Result<Option<bool>, InvalidValue> {
        self.0.get_bool(Tag(575))
    }

    /// The instances of the `NoClearingInstructions` (576) group.
    #[doc(alias = "NoClearingInstructions")]
    pub fn clearing_instructions(&self) -> Result<Instances<'a, ClrInstGrp<'a>>, InvalidValue> {
        self.0.get_group(&ClrInstGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
    }

    /// The `TradeInputSource` (578) field.
    #[doc(alias = "TradeInputSource")]
    pub fn trade_input_source(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(578))
    }

    /// The `TradeInputDevice` (579) field.
    #[doc(alias = "TradeInputDevice")]
    pub fn trade_input_device(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(579))
    }

    /// The `OrderInputDevice` (821) field.
    #[doc(alias = "OrderInputDevice")]
    pub fn order_input_device(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(821))
    }

    /// The `Currency` (15) field.
    #[doc(alias = "Currency")]
    pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(15))
    }

    /// The `ComplianceID` (376) field.
    #[doc(alias = "ComplianceID")]
    pub fn compliance_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(376))
    }

    /// The `SolicitedFlag` (377) field.
    #[doc(alias = "SolicitedFlag")]
    pub fn solicited_flag(&self) -> Result<Option<bool>, InvalidValue> {
        self.0.get_bool(Tag(377))
    }

    /// The `OrderCapacity` (528) field.
    #[doc(alias = "OrderCapacity")]
    pub fn order_capacity(&self) -> Result<Option<OrderCapacity<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(528))?.map(OrderCapacity::from_value))
    }

    /// The `OrderRestrictions` (529) field.
    #[doc(alias = "OrderRestrictions")]
    pub fn order_restrictions(&self) -> Result<Option<MultipleValues<'a, OrderRestrictions<'a>>>, InvalidValue> {
        self.0.get_multiple_values(Tag(529))
    }

    /// The `CustOrderCapacity` (582) field.
    #[doc(alias = "CustOrderCapacity")]
    pub fn cust_order_capacity(&self) -> Result<Option<CustOrderCapacity>, InvalidValue> {
        Ok(self.0.get_int(Tag(582))?.map(CustOrderCapacity::from_value))
    }

    /// The `OrdType` (40) field.
    #[doc(alias = "OrdType")]
    pub fn ord_type(&self) -> Result<Option<OrdType<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(40))?.map(OrdType::from_value))
    }

    /// The `ExecInst` (18) field.
    #[doc(alias = "ExecInst")]
    pub fn exec_inst(&self) -> Result<Option<MultipleValues<'a, ExecInst<'a>>>, InvalidValue> {
        self.0.get_multiple_values(Tag(18))
    }

    /// The `TransBkdTime` (483) field.
    #[doc(alias = "TransBkdTime")]
    pub fn trans_bkd_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
        self.0.get_utc_timestamp(Tag(483))
    }

    /// The `TradingSessionID` (336) field.
    #[doc(alias = "TradingSessionID")]
    pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(336))
    }

    /// The `TradingSessionSubID` (625) field.
    #[doc(alias = "TradingSessionSubID")]
    pub fn trading_session_sub_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(625))
    }

    /// The `TimeBracket` (943) field.
    #[doc(alias = "TimeBracket")]
    pub fn time_bracket(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(943))
    }

    /// The `CommissionData` component.
    pub fn commission_data(&self) -> CommissionData<'a> {
        CommissionData(self.0)
    }

    /// The `GrossTradeAmt` (381) field.
    #[doc(alias = "GrossTradeAmt")]
    pub fn gross_trade_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(381))
    }

    /// The `NumDaysInterest` (157) field.
    #[doc(alias = "NumDaysInterest")]
    pub fn num_days_interest(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(157))
    }

    /// The `ExDate` (230) field.
    #[doc(alias = "ExDate")]
    pub fn ex_date(&self) -> Result<Option<Date>, InvalidValue> {
        self.0.get_date(Tag(230))
    }

    /// The `AccruedInterestRate` (158) field.
    #[doc(alias = "AccruedInterestRate")]
    pub fn accrued_interest_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(158))
    }

    /// The `AccruedInterestAmt` (159) field.
    #[doc(alias = "AccruedInterestAmt")]
    pub fn accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(159))
    }

    /// The `InterestAtMaturity` (738) field.
    #[doc(alias = "InterestAtMaturity")]
    pub fn interest_at_maturity(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(738))
    }

    /// The `EndAccruedInterestAmt` (920) field.
    #[doc(alias = "EndAccruedInterestAmt")]
    pub fn end_accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(920))
    }

    /// The `StartCash` (921) field.
    #[doc(alias = "StartCash")]
    pub fn start_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(921))
    }

    /// The `EndCash` (922) field.
    #[doc(alias = "EndCash")]
    pub fn end_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(922))
    }

    /// The `Concession` (238) field.
    #[doc(alias = "Concession")]
    pub fn concession(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(238))
    }

    /// The `TotalTakedown` (237) field.
    #[doc(alias = "TotalTakedown")]
    pub fn total_takedown(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(237))
    }

    /// The `NetMoney` (118) field.
    #[doc(alias = "NetMoney")]
    pub fn net_money(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(118))
    }

    /// The `SettlCurrAmt` (119) field.
    #[doc(alias = "SettlCurrAmt")]
    pub fn settl_curr_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(119))
    }

    /// The `SettlCurrency` (120) field.
    #[doc(alias = "SettlCurrency")]
    pub fn settl_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(120))
    }

    /// The `SettlCurrFxRate` (155) field.
    #[doc(alias = "SettlCurrFxRate")]
    pub fn settl_curr_fx_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(155))
    }

    /// The `SettlCurrFxRateCalc` (156) field.
    #[doc(alias = "SettlCurrFxRateCalc")]
    pub fn settl_curr_fx_rate_calc(&self) -> Result<Option<SettlCurrFxRateCalc<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(156))?.map(SettlCurrFxRateCalc::from_value))
    }

    /// The `PositionEffect` (77) field.
    #[doc(alias = "PositionEffect")]
    pub fn position_effect(&self) -> Result<Option<PositionEffect<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(77))?.map(PositionEffect::from_value))
    }

    /// The `Text` (58) field.
    #[doc(alias = "Text")]
    pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(58))
    }

    /// The `EncodedTextLen` (354) field.
    #[doc(alias = "EncodedTextLen")]
    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(354))
    }

    /// The `EncodedText` (355) field.
    #[doc(alias = "EncodedText")]
    pub fn encoded_text(&self) -> Option<&'a [u8]> {
        self.0.get(Tag(355))
    }

    /// The `SideMultiLegReportingType` (752) field.
    #[doc(alias = "SideMultiLegReportingType")]
    pub fn side_multi_leg_reporting_type(&self) -> Result<Option<SideMultiLegReportingType>, InvalidValue> {
        Ok(self.0.get_int(Tag(752))?.map(SideMultiLegReportingType::from_value))
    }

    /// The instances of the `NoContAmts` (518) group.
    #[doc(alias = "NoContAmts")]
    pub fn cont_amts(&self) -> Result<Instances<'a, ContAmtGrp<'a>>, InvalidValue> {
        self.0.get_group(&ContAmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
    }

    /// The instances of the `NoStipulations` (232) group.
    #[doc(alias = "NoStipulations")]
    pub fn stipulations(&self) -> Result<Instances<'a, Stipulations<'a>>, InvalidValue> {
        self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
    }

    /// The instances of the `NoMiscFees` (136) group.
    #[doc(alias = "NoMiscFees")]
    pub fn misc_fees(&self) -> Result<Instances<'a, MiscFeesGrp<'a>>, InvalidValue> {
        self.0.get_group(&MiscFeesGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
    }

    /// The `ExchangeRule` (825) field.
    #[doc(alias = "ExchangeRule")]
    pub fn exchange_rule(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(825))
    }

    /// The `TradeAllocIndicator` (826) field.
    #[doc(alias = "TradeAllocIndicator")]
    pub fn trade_alloc_indicator(&self) -> Result<Option<TradeAllocIndicator>, InvalidValue> {
        Ok(self.0.get_int(Tag(826))?.map(TradeAllocIndicator::from_value))
    }

    /// The `PreallocMethod` (591) field.
    #[doc(alias = "PreallocMethod")]
    pub fn prealloc_method(&self) -> Result<Option<PreallocMethod<'a>>, InvalidValue> {
        Ok(self.0.get_str(Tag(591))?.map(PreallocMethod::from_value))
    }

    /// The `AllocID` (70) field.
    #[doc(alias = "AllocID")]
    pub fn alloc_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(70))
    }

    /// The instances of the `NoAllocs` (78) group.
    #[doc(alias = "NoAllocs")]
    pub fn allocs(&self) -> Result<Instances<'a, TrdAllocGrp<'a>>, InvalidValue> {
        self.0.get_group(&TrdAllocGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
    }
}

impl std::fmt::Debug for TrdCapRptSideGrp<'_> {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "TrdCapRptSideGrp({})", self.0)
    }
}