Skip to main content

refix_fix44/generated/components/
side_cross_ord_mod_grp.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Date, GroupTable, Instances, InvalidValue, LazyKnownTags, MultipleValues, Tag};
5
6use super::super::enums::{
7    AccountType, AcctIDSource, BookingType, BookingUnit, CashMargin, ClearingFeeIndicator,
8    CoveredOrUncovered, CustOrderCapacity, DayBookingInst, OrderCapacity, OrderRestrictions,
9    PositionEffect, PreallocMethod, QtyType, Side,
10};
11use super::{CommissionData, OrderQtyData, Parties, PreAllocGrp};
12
13/// An instance of the `NoSides` (552) group.
14#[derive(Clone, Copy)]
15pub struct SideCrossOrdModGrp<'a>(refix_message::Scope<'a>);
16
17impl<'a> From<refix_message::Scope<'a>> for SideCrossOrdModGrp<'a> {
18    fn from(scope: refix_message::Scope<'a>) -> Self {
19        Self(scope)
20    }
21}
22
23impl<'a> SideCrossOrdModGrp<'a> {
24    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
25        Tag(552),
26        Tag(54),
27        &[
28            Tag(1), Tag(11), Tag(12), Tag(13), Tag(38), Tag(54), Tag(58), Tag(70), Tag(75), Tag(77),
29            Tag(78), Tag(120), Tag(121), Tag(152), Tag(203), Tag(229), Tag(354), Tag(355), Tag(377),
30            Tag(453), Tag(468), Tag(469), Tag(479), Tag(497), Tag(516), Tag(526), Tag(528),
31            Tag(529), Tag(544), Tag(581), Tag(582), Tag(583), Tag(589), Tag(590), Tag(591),
32            Tag(635), Tag(659), Tag(660), Tag(775), Tag(854),
33        ],
34        &[Parties::TABLE, PreAllocGrp::TABLE],
35    );
36
37    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
38        static TAGS: LazyKnownTags = LazyKnownTags::new(
39            &[
40                Tag(54), Tag(11), Tag(526), Tag(583), Tag(453), Tag(229), Tag(75), Tag(1), Tag(660),
41                Tag(581), Tag(589), Tag(590), Tag(591), Tag(70), Tag(78), Tag(854), Tag(528),
42                Tag(529), Tag(582), Tag(121), Tag(120), Tag(775), Tag(58), Tag(354), Tag(355),
43                Tag(77), Tag(203), Tag(544), Tag(635), Tag(377), Tag(659),
44            ],
45            &[
46                Parties::known_tags(), PreAllocGrp::known_tags(), OrderQtyData::known_tags(),
47                CommissionData::known_tags(),
48            ],
49        );
50        &TAGS
51    }
52
53    pub fn raw(&self) -> refix_message::Scope<'a> {
54        self.0
55    }
56
57    /// The `Side` (54) field.
58    #[doc(alias = "Side")]
59    pub fn side(&self) -> Result<Option<Side<'a>>, InvalidValue> {
60        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
61    }
62
63    /// The `ClOrdID` (11) field.
64    #[doc(alias = "ClOrdID")]
65    pub fn cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
66        self.0.get_str(Tag(11))
67    }
68
69    /// The `SecondaryClOrdID` (526) field.
70    #[doc(alias = "SecondaryClOrdID")]
71    pub fn secondary_cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
72        self.0.get_str(Tag(526))
73    }
74
75    /// The `ClOrdLinkID` (583) field.
76    #[doc(alias = "ClOrdLinkID")]
77    pub fn cl_ord_link_id(&self) -> Result<Option<&'a str>, InvalidValue> {
78        self.0.get_str(Tag(583))
79    }
80
81    /// The instances of the `NoPartyIDs` (453) group.
82    #[doc(alias = "NoPartyIDs")]
83    pub fn party_ids(&self) -> Result<Instances<'a, Parties<'a>>, InvalidValue> {
84        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
85    }
86
87    /// The `TradeOriginationDate` (229) field.
88    #[doc(alias = "TradeOriginationDate")]
89    pub fn trade_origination_date(&self) -> Result<Option<Date>, InvalidValue> {
90        self.0.get_date(Tag(229))
91    }
92
93    /// The `TradeDate` (75) field.
94    #[doc(alias = "TradeDate")]
95    pub fn trade_date(&self) -> Result<Option<Date>, InvalidValue> {
96        self.0.get_date(Tag(75))
97    }
98
99    /// The `Account` (1) field.
100    #[doc(alias = "Account")]
101    pub fn account(&self) -> Result<Option<&'a str>, InvalidValue> {
102        self.0.get_str(Tag(1))
103    }
104
105    /// The `AcctIDSource` (660) field.
106    #[doc(alias = "AcctIDSource")]
107    pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
108        Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
109    }
110
111    /// The `AccountType` (581) field.
112    #[doc(alias = "AccountType")]
113    pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
114        Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
115    }
116
117    /// The `DayBookingInst` (589) field.
118    #[doc(alias = "DayBookingInst")]
119    pub fn day_booking_inst(&self) -> Result<Option<DayBookingInst<'a>>, InvalidValue> {
120        Ok(self.0.get_str(Tag(589))?.map(DayBookingInst::from_value))
121    }
122
123    /// The `BookingUnit` (590) field.
124    #[doc(alias = "BookingUnit")]
125    pub fn booking_unit(&self) -> Result<Option<BookingUnit<'a>>, InvalidValue> {
126        Ok(self.0.get_str(Tag(590))?.map(BookingUnit::from_value))
127    }
128
129    /// The `PreallocMethod` (591) field.
130    #[doc(alias = "PreallocMethod")]
131    pub fn prealloc_method(&self) -> Result<Option<PreallocMethod<'a>>, InvalidValue> {
132        Ok(self.0.get_str(Tag(591))?.map(PreallocMethod::from_value))
133    }
134
135    /// The `AllocID` (70) field.
136    #[doc(alias = "AllocID")]
137    pub fn alloc_id(&self) -> Result<Option<&'a str>, InvalidValue> {
138        self.0.get_str(Tag(70))
139    }
140
141    /// The instances of the `NoAllocs` (78) group.
142    #[doc(alias = "NoAllocs")]
143    pub fn allocs(&self) -> Result<Instances<'a, PreAllocGrp<'a>>, InvalidValue> {
144        self.0.get_group(&PreAllocGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
145    }
146
147    /// The `QtyType` (854) field.
148    #[doc(alias = "QtyType")]
149    pub fn qty_type(&self) -> Result<Option<QtyType>, InvalidValue> {
150        Ok(self.0.get_int(Tag(854))?.map(QtyType::from_value))
151    }
152
153    /// The `OrderQtyData` component.
154    pub fn order_qty_data(&self) -> OrderQtyData<'a> {
155        OrderQtyData(self.0)
156    }
157
158    /// The `CommissionData` component.
159    pub fn commission_data(&self) -> CommissionData<'a> {
160        CommissionData(self.0)
161    }
162
163    /// The `OrderCapacity` (528) field.
164    #[doc(alias = "OrderCapacity")]
165    pub fn order_capacity(&self) -> Result<Option<OrderCapacity<'a>>, InvalidValue> {
166        Ok(self.0.get_str(Tag(528))?.map(OrderCapacity::from_value))
167    }
168
169    /// The `OrderRestrictions` (529) field.
170    #[doc(alias = "OrderRestrictions")]
171    pub fn order_restrictions(&self) -> Result<Option<MultipleValues<'a, OrderRestrictions<'a>>>, InvalidValue> {
172        self.0.get_multiple_values(Tag(529))
173    }
174
175    /// The `CustOrderCapacity` (582) field.
176    #[doc(alias = "CustOrderCapacity")]
177    pub fn cust_order_capacity(&self) -> Result<Option<CustOrderCapacity>, InvalidValue> {
178        Ok(self.0.get_int(Tag(582))?.map(CustOrderCapacity::from_value))
179    }
180
181    /// The `ForexReq` (121) field.
182    #[doc(alias = "ForexReq")]
183    pub fn forex_req(&self) -> Result<Option<bool>, InvalidValue> {
184        self.0.get_bool(Tag(121))
185    }
186
187    /// The `SettlCurrency` (120) field.
188    #[doc(alias = "SettlCurrency")]
189    pub fn settl_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
190        self.0.get_str(Tag(120))
191    }
192
193    /// The `BookingType` (775) field.
194    #[doc(alias = "BookingType")]
195    pub fn booking_type(&self) -> Result<Option<BookingType>, InvalidValue> {
196        Ok(self.0.get_int(Tag(775))?.map(BookingType::from_value))
197    }
198
199    /// The `Text` (58) field.
200    #[doc(alias = "Text")]
201    pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
202        self.0.get_str(Tag(58))
203    }
204
205    /// The `EncodedTextLen` (354) field.
206    #[doc(alias = "EncodedTextLen")]
207    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
208        self.0.get_int(Tag(354))
209    }
210
211    /// The `EncodedText` (355) field.
212    #[doc(alias = "EncodedText")]
213    pub fn encoded_text(&self) -> Option<&'a [u8]> {
214        self.0.get(Tag(355))
215    }
216
217    /// The `PositionEffect` (77) field.
218    #[doc(alias = "PositionEffect")]
219    pub fn position_effect(&self) -> Result<Option<PositionEffect<'a>>, InvalidValue> {
220        Ok(self.0.get_str(Tag(77))?.map(PositionEffect::from_value))
221    }
222
223    /// The `CoveredOrUncovered` (203) field.
224    #[doc(alias = "CoveredOrUncovered")]
225    pub fn covered_or_uncovered(&self) -> Result<Option<CoveredOrUncovered>, InvalidValue> {
226        Ok(self.0.get_int(Tag(203))?.map(CoveredOrUncovered::from_value))
227    }
228
229    /// The `CashMargin` (544) field.
230    #[doc(alias = "CashMargin")]
231    pub fn cash_margin(&self) -> Result<Option<CashMargin<'a>>, InvalidValue> {
232        Ok(self.0.get_str(Tag(544))?.map(CashMargin::from_value))
233    }
234
235    /// The `ClearingFeeIndicator` (635) field.
236    #[doc(alias = "ClearingFeeIndicator")]
237    pub fn clearing_fee_indicator(&self) -> Result<Option<ClearingFeeIndicator<'a>>, InvalidValue> {
238        Ok(self.0.get_str(Tag(635))?.map(ClearingFeeIndicator::from_value))
239    }
240
241    /// The `SolicitedFlag` (377) field.
242    #[doc(alias = "SolicitedFlag")]
243    pub fn solicited_flag(&self) -> Result<Option<bool>, InvalidValue> {
244        self.0.get_bool(Tag(377))
245    }
246
247    /// The `SideComplianceID` (659) field.
248    #[doc(alias = "SideComplianceID")]
249    pub fn side_compliance_id(&self) -> Result<Option<&'a str>, InvalidValue> {
250        self.0.get_str(Tag(659))
251    }
252}
253
254impl std::fmt::Debug for SideCrossOrdModGrp<'_> {
255    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
256        write!(f, "SideCrossOrdModGrp({})", self.0)
257    }
258}