Skip to main content

refix_fix44/generated/components/
underlying_instrument.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, KnownTags, LazyKnownTags, MonthYear, Tag,
6};
7
8use super::{UndSecAltIDGrp, UnderlyingStipulations};
9
10/// The fields of the `UnderlyingInstrument` component.
11#[derive(Clone, Copy)]
12pub struct UnderlyingInstrument<'a>(
13    pub(in super::super) refix_message::Scope<'a>,
14    pub(in super::super) KnownTags<'static>,
15);
16
17impl<'a> UnderlyingInstrument<'a> {
18    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
19        static TAGS: LazyKnownTags = LazyKnownTags::new(
20            &[
21                Tag(311), Tag(312), Tag(309), Tag(305), Tag(457), Tag(462), Tag(463), Tag(310),
22                Tag(763), Tag(313), Tag(542), Tag(315), Tag(241), Tag(242), Tag(243), Tag(244),
23                Tag(245), Tag(246), Tag(256), Tag(595), Tag(592), Tag(593), Tag(594), Tag(247),
24                Tag(316), Tag(941), Tag(317), Tag(436), Tag(435), Tag(308), Tag(306), Tag(362),
25                Tag(363), Tag(307), Tag(364), Tag(365), Tag(877), Tag(878), Tag(318), Tag(879),
26                Tag(810), Tag(882), Tag(883), Tag(884), Tag(885), Tag(886), Tag(887),
27            ],
28            &[UndSecAltIDGrp::known_tags(), UnderlyingStipulations::known_tags()],
29        );
30        &TAGS
31    }
32
33    pub fn raw(&self) -> refix_message::Scope<'a> {
34        self.0
35    }
36
37    /// The `UnderlyingSymbol` (311) field.
38    #[doc(alias = "UnderlyingSymbol")]
39    pub fn underlying_symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
40        self.0.get_str(Tag(311))
41    }
42
43    /// The `UnderlyingSymbolSfx` (312) field.
44    #[doc(alias = "UnderlyingSymbolSfx")]
45    pub fn underlying_symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
46        self.0.get_str(Tag(312))
47    }
48
49    /// The `UnderlyingSecurityID` (309) field.
50    #[doc(alias = "UnderlyingSecurityID")]
51    pub fn underlying_security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
52        self.0.get_str(Tag(309))
53    }
54
55    /// The `UnderlyingSecurityIDSource` (305) field.
56    #[doc(alias = "UnderlyingSecurityIDSource")]
57    pub fn underlying_security_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
58        self.0.get_str(Tag(305))
59    }
60
61    /// The instances of the `NoUnderlyingSecurityAltID` (457) group.
62    #[doc(alias = "NoUnderlyingSecurityAltID")]
63    pub fn underlying_security_alt_id(&self) -> Result<Instances<'a, UndSecAltIDGrp<'a>>, InvalidValue> {
64        self.0.get_group(&UndSecAltIDGrp::TABLE, &self.1).map(Instances::from)
65    }
66
67    /// The `UnderlyingProduct` (462) field.
68    #[doc(alias = "UnderlyingProduct")]
69    pub fn underlying_product(&self) -> Result<Option<i64>, InvalidValue> {
70        self.0.get_int(Tag(462))
71    }
72
73    /// The `UnderlyingCFICode` (463) field.
74    #[doc(alias = "UnderlyingCFICode")]
75    pub fn underlying_cfi_code(&self) -> Result<Option<&'a str>, InvalidValue> {
76        self.0.get_str(Tag(463))
77    }
78
79    /// The `UnderlyingSecurityType` (310) field.
80    #[doc(alias = "UnderlyingSecurityType")]
81    pub fn underlying_security_type(&self) -> Result<Option<&'a str>, InvalidValue> {
82        self.0.get_str(Tag(310))
83    }
84
85    /// The `UnderlyingSecuritySubType` (763) field.
86    #[doc(alias = "UnderlyingSecuritySubType")]
87    pub fn underlying_security_sub_type(&self) -> Result<Option<&'a str>, InvalidValue> {
88        self.0.get_str(Tag(763))
89    }
90
91    /// The `UnderlyingMaturityMonthYear` (313) field.
92    #[doc(alias = "UnderlyingMaturityMonthYear")]
93    pub fn underlying_maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
94        self.0.get_month_year(Tag(313))
95    }
96
97    /// The `UnderlyingMaturityDate` (542) field.
98    #[doc(alias = "UnderlyingMaturityDate")]
99    pub fn underlying_maturity_date(&self) -> Result<Option<Date>, InvalidValue> {
100        self.0.get_date(Tag(542))
101    }
102
103    /// The `UnderlyingPutOrCall` (315) field.
104    #[doc(alias = "UnderlyingPutOrCall")]
105    pub fn underlying_put_or_call(&self) -> Result<Option<i64>, InvalidValue> {
106        self.0.get_int(Tag(315))
107    }
108
109    /// The `UnderlyingCouponPaymentDate` (241) field.
110    #[doc(alias = "UnderlyingCouponPaymentDate")]
111    pub fn underlying_coupon_payment_date(&self) -> Result<Option<Date>, InvalidValue> {
112        self.0.get_date(Tag(241))
113    }
114
115    /// The `UnderlyingIssueDate` (242) field.
116    #[doc(alias = "UnderlyingIssueDate")]
117    pub fn underlying_issue_date(&self) -> Result<Option<Date>, InvalidValue> {
118        self.0.get_date(Tag(242))
119    }
120
121    /// The `UnderlyingRepoCollateralSecurityType` (243) field.
122    #[doc(alias = "UnderlyingRepoCollateralSecurityType")]
123    pub fn underlying_repo_collateral_security_type(&self) -> Result<Option<&'a str>, InvalidValue> {
124        self.0.get_str(Tag(243))
125    }
126
127    /// The `UnderlyingRepurchaseTerm` (244) field.
128    #[doc(alias = "UnderlyingRepurchaseTerm")]
129    pub fn underlying_repurchase_term(&self) -> Result<Option<i64>, InvalidValue> {
130        self.0.get_int(Tag(244))
131    }
132
133    /// The `UnderlyingRepurchaseRate` (245) field.
134    #[doc(alias = "UnderlyingRepurchaseRate")]
135    pub fn underlying_repurchase_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
136        self.0.get_decimal(Tag(245))
137    }
138
139    /// The `UnderlyingFactor` (246) field.
140    #[doc(alias = "UnderlyingFactor")]
141    pub fn underlying_factor(&self) -> Result<Option<Decimal>, InvalidValue> {
142        self.0.get_decimal(Tag(246))
143    }
144
145    /// The `UnderlyingCreditRating` (256) field.
146    #[doc(alias = "UnderlyingCreditRating")]
147    pub fn underlying_credit_rating(&self) -> Result<Option<&'a str>, InvalidValue> {
148        self.0.get_str(Tag(256))
149    }
150
151    /// The `UnderlyingInstrRegistry` (595) field.
152    #[doc(alias = "UnderlyingInstrRegistry")]
153    pub fn underlying_instr_registry(&self) -> Result<Option<&'a str>, InvalidValue> {
154        self.0.get_str(Tag(595))
155    }
156
157    /// The `UnderlyingCountryOfIssue` (592) field.
158    #[doc(alias = "UnderlyingCountryOfIssue")]
159    pub fn underlying_country_of_issue(&self) -> Result<Option<&'a str>, InvalidValue> {
160        self.0.get_str(Tag(592))
161    }
162
163    /// The `UnderlyingStateOrProvinceOfIssue` (593) field.
164    #[doc(alias = "UnderlyingStateOrProvinceOfIssue")]
165    pub fn underlying_state_or_province_of_issue(&self) -> Result<Option<&'a str>, InvalidValue> {
166        self.0.get_str(Tag(593))
167    }
168
169    /// The `UnderlyingLocaleOfIssue` (594) field.
170    #[doc(alias = "UnderlyingLocaleOfIssue")]
171    pub fn underlying_locale_of_issue(&self) -> Result<Option<&'a str>, InvalidValue> {
172        self.0.get_str(Tag(594))
173    }
174
175    /// The `UnderlyingRedemptionDate` (247) field.
176    #[doc(alias = "UnderlyingRedemptionDate")]
177    pub fn underlying_redemption_date(&self) -> Result<Option<Date>, InvalidValue> {
178        self.0.get_date(Tag(247))
179    }
180
181    /// The `UnderlyingStrikePrice` (316) field.
182    #[doc(alias = "UnderlyingStrikePrice")]
183    pub fn underlying_strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
184        self.0.get_decimal(Tag(316))
185    }
186
187    /// The `UnderlyingStrikeCurrency` (941) field.
188    #[doc(alias = "UnderlyingStrikeCurrency")]
189    pub fn underlying_strike_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
190        self.0.get_str(Tag(941))
191    }
192
193    /// The `UnderlyingOptAttribute` (317) field.
194    #[doc(alias = "UnderlyingOptAttribute")]
195    pub fn underlying_opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
196        self.0.get_str(Tag(317))
197    }
198
199    /// The `UnderlyingContractMultiplier` (436) field.
200    #[doc(alias = "UnderlyingContractMultiplier")]
201    pub fn underlying_contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
202        self.0.get_decimal(Tag(436))
203    }
204
205    /// The `UnderlyingCouponRate` (435) field.
206    #[doc(alias = "UnderlyingCouponRate")]
207    pub fn underlying_coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
208        self.0.get_decimal(Tag(435))
209    }
210
211    /// The `UnderlyingSecurityExchange` (308) field.
212    #[doc(alias = "UnderlyingSecurityExchange")]
213    pub fn underlying_security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
214        self.0.get_str(Tag(308))
215    }
216
217    /// The `UnderlyingIssuer` (306) field.
218    #[doc(alias = "UnderlyingIssuer")]
219    pub fn underlying_issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
220        self.0.get_str(Tag(306))
221    }
222
223    /// The `EncodedUnderlyingIssuerLen` (362) field.
224    #[doc(alias = "EncodedUnderlyingIssuerLen")]
225    pub fn encoded_underlying_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
226        self.0.get_int(Tag(362))
227    }
228
229    /// The `EncodedUnderlyingIssuer` (363) field.
230    #[doc(alias = "EncodedUnderlyingIssuer")]
231    pub fn encoded_underlying_issuer(&self) -> Option<&'a [u8]> {
232        self.0.get(Tag(363))
233    }
234
235    /// The `UnderlyingSecurityDesc` (307) field.
236    #[doc(alias = "UnderlyingSecurityDesc")]
237    pub fn underlying_security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
238        self.0.get_str(Tag(307))
239    }
240
241    /// The `EncodedUnderlyingSecurityDescLen` (364) field.
242    #[doc(alias = "EncodedUnderlyingSecurityDescLen")]
243    pub fn encoded_underlying_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
244        self.0.get_int(Tag(364))
245    }
246
247    /// The `EncodedUnderlyingSecurityDesc` (365) field.
248    #[doc(alias = "EncodedUnderlyingSecurityDesc")]
249    pub fn encoded_underlying_security_desc(&self) -> Option<&'a [u8]> {
250        self.0.get(Tag(365))
251    }
252
253    /// The `UnderlyingCPProgram` (877) field.
254    #[doc(alias = "UnderlyingCPProgram")]
255    pub fn underlying_cp_program(&self) -> Result<Option<&'a str>, InvalidValue> {
256        self.0.get_str(Tag(877))
257    }
258
259    /// The `UnderlyingCPRegType` (878) field.
260    #[doc(alias = "UnderlyingCPRegType")]
261    pub fn underlying_cp_reg_type(&self) -> Result<Option<&'a str>, InvalidValue> {
262        self.0.get_str(Tag(878))
263    }
264
265    /// The `UnderlyingCurrency` (318) field.
266    #[doc(alias = "UnderlyingCurrency")]
267    pub fn underlying_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
268        self.0.get_str(Tag(318))
269    }
270
271    /// The `UnderlyingQty` (879) field.
272    #[doc(alias = "UnderlyingQty")]
273    pub fn underlying_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
274        self.0.get_decimal(Tag(879))
275    }
276
277    /// The `UnderlyingPx` (810) field.
278    #[doc(alias = "UnderlyingPx")]
279    pub fn underlying_px(&self) -> Result<Option<Decimal>, InvalidValue> {
280        self.0.get_decimal(Tag(810))
281    }
282
283    /// The `UnderlyingDirtyPrice` (882) field.
284    #[doc(alias = "UnderlyingDirtyPrice")]
285    pub fn underlying_dirty_price(&self) -> Result<Option<Decimal>, InvalidValue> {
286        self.0.get_decimal(Tag(882))
287    }
288
289    /// The `UnderlyingEndPrice` (883) field.
290    #[doc(alias = "UnderlyingEndPrice")]
291    pub fn underlying_end_price(&self) -> Result<Option<Decimal>, InvalidValue> {
292        self.0.get_decimal(Tag(883))
293    }
294
295    /// The `UnderlyingStartValue` (884) field.
296    #[doc(alias = "UnderlyingStartValue")]
297    pub fn underlying_start_value(&self) -> Result<Option<Decimal>, InvalidValue> {
298        self.0.get_decimal(Tag(884))
299    }
300
301    /// The `UnderlyingCurrentValue` (885) field.
302    #[doc(alias = "UnderlyingCurrentValue")]
303    pub fn underlying_current_value(&self) -> Result<Option<Decimal>, InvalidValue> {
304        self.0.get_decimal(Tag(885))
305    }
306
307    /// The `UnderlyingEndValue` (886) field.
308    #[doc(alias = "UnderlyingEndValue")]
309    pub fn underlying_end_value(&self) -> Result<Option<Decimal>, InvalidValue> {
310        self.0.get_decimal(Tag(886))
311    }
312
313    /// The instances of the `NoUnderlyingStips` (887) group.
314    #[doc(alias = "NoUnderlyingStips")]
315    pub fn underlying_stips(&self) -> Result<Instances<'a, UnderlyingStipulations<'a>>, InvalidValue> {
316        self.0.get_group(&UnderlyingStipulations::TABLE, &self.1).map(Instances::from)
317    }
318}
319
320impl std::fmt::Debug for UnderlyingInstrument<'_> {
321    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
322        write!(f, "UnderlyingInstrument({})", self.0.display_known(&Self::known_tags().get()))
323    }
324}