Skip to main content

refix_fix44/generated/components/
sec_list_grp.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::ExpirationCycle;
7use super::{
8    AttrbGrp, EvntGrp, FinancingDetails, InstrmtLegSecListGrp, Instrument, InstrumentExtension,
9    SecAltIDGrp, SpreadOrBenchmarkCurveData, Stipulations, UndInstrmtGrp, YieldData,
10};
11
12/// An instance of the `NoRelatedSym` (146) group.
13#[derive(Clone, Copy)]
14pub struct SecListGrp<'a>(refix_message::Scope<'a>);
15
16impl<'a> From<refix_message::Scope<'a>> for SecListGrp<'a> {
17    fn from(scope: refix_message::Scope<'a>) -> Self {
18        Self(scope)
19    }
20}
21
22impl<'a> SecListGrp<'a> {
23    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
24        Tag(146),
25        Tag(55),
26        &[
27            Tag(15), Tag(22), Tag(48), Tag(55), Tag(58), Tag(65), Tag(106), Tag(107), Tag(167),
28            Tag(200), Tag(201), Tag(202), Tag(206), Tag(207), Tag(218), Tag(220), Tag(221),
29            Tag(222), Tag(223), Tag(224), Tag(225), Tag(226), Tag(227), Tag(228), Tag(231),
30            Tag(232), Tag(235), Tag(236), Tag(239), Tag(240), Tag(255), Tag(336), Tag(348),
31            Tag(349), Tag(350), Tag(351), Tag(354), Tag(355), Tag(454), Tag(460), Tag(461),
32            Tag(470), Tag(471), Tag(472), Tag(541), Tag(543), Tag(555), Tag(561), Tag(562),
33            Tag(625), Tag(662), Tag(663), Tag(667), Tag(668), Tag(691), Tag(696), Tag(697),
34            Tag(698), Tag(699), Tag(701), Tag(711), Tag(761), Tag(762), Tag(788), Tag(827),
35            Tag(864), Tag(869), Tag(870), Tag(873), Tag(874), Tag(875), Tag(876), Tag(898),
36            Tag(913), Tag(914), Tag(915), Tag(916), Tag(917), Tag(918), Tag(919), Tag(947),
37        ],
38        &[
39            SecAltIDGrp::TABLE, EvntGrp::TABLE, AttrbGrp::TABLE, UndInstrmtGrp::TABLE,
40            Stipulations::TABLE, InstrmtLegSecListGrp::TABLE,
41        ],
42    );
43
44    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
45        static TAGS: LazyKnownTags = LazyKnownTags::new(
46            &[
47                Tag(711), Tag(15), Tag(232), Tag(555), Tag(561), Tag(562), Tag(336), Tag(625),
48                Tag(827), Tag(58), Tag(354), Tag(355),
49            ],
50            &[
51                Instrument::known_tags(), InstrumentExtension::known_tags(),
52                FinancingDetails::known_tags(), UndInstrmtGrp::known_tags(),
53                Stipulations::known_tags(), InstrmtLegSecListGrp::known_tags(),
54                SpreadOrBenchmarkCurveData::known_tags(), YieldData::known_tags(),
55            ],
56        );
57        &TAGS
58    }
59
60    pub fn raw(&self) -> refix_message::Scope<'a> {
61        self.0
62    }
63
64    /// The `Instrument` component.
65    pub fn instrument(&self) -> Instrument<'a> {
66        Instrument(self.0, Self::known_tags().get())
67    }
68
69    /// The `InstrumentExtension` component.
70    pub fn instrument_extension(&self) -> InstrumentExtension<'a> {
71        InstrumentExtension(self.0, Self::known_tags().get())
72    }
73
74    /// The `FinancingDetails` component.
75    pub fn financing_details(&self) -> FinancingDetails<'a> {
76        FinancingDetails(self.0)
77    }
78
79    /// The instances of the `NoUnderlyings` (711) group.
80    #[doc(alias = "NoUnderlyings")]
81    pub fn underlyings(&self) -> Result<Instances<'a, UndInstrmtGrp<'a>>, InvalidValue> {
82        self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
83    }
84
85    /// The `Currency` (15) field.
86    #[doc(alias = "Currency")]
87    pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
88        self.0.get_str(Tag(15))
89    }
90
91    /// The instances of the `NoStipulations` (232) group.
92    #[doc(alias = "NoStipulations")]
93    pub fn stipulations(&self) -> Result<Instances<'a, Stipulations<'a>>, InvalidValue> {
94        self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
95    }
96
97    /// The instances of the `NoLegs` (555) group.
98    #[doc(alias = "NoLegs")]
99    pub fn legs(&self) -> Result<Instances<'a, InstrmtLegSecListGrp<'a>>, InvalidValue> {
100        self.0.get_group(&InstrmtLegSecListGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
101    }
102
103    /// The `SpreadOrBenchmarkCurveData` component.
104    pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'a> {
105        SpreadOrBenchmarkCurveData(self.0)
106    }
107
108    /// The `YieldData` component.
109    pub fn yield_data(&self) -> YieldData<'a> {
110        YieldData(self.0)
111    }
112
113    /// The `RoundLot` (561) field.
114    #[doc(alias = "RoundLot")]
115    pub fn round_lot(&self) -> Result<Option<Decimal>, InvalidValue> {
116        self.0.get_decimal(Tag(561))
117    }
118
119    /// The `MinTradeVol` (562) field.
120    #[doc(alias = "MinTradeVol")]
121    pub fn min_trade_vol(&self) -> Result<Option<Decimal>, InvalidValue> {
122        self.0.get_decimal(Tag(562))
123    }
124
125    /// The `TradingSessionID` (336) field.
126    #[doc(alias = "TradingSessionID")]
127    pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
128        self.0.get_str(Tag(336))
129    }
130
131    /// The `TradingSessionSubID` (625) field.
132    #[doc(alias = "TradingSessionSubID")]
133    pub fn trading_session_sub_id(&self) -> Result<Option<&'a str>, InvalidValue> {
134        self.0.get_str(Tag(625))
135    }
136
137    /// The `ExpirationCycle` (827) field.
138    #[doc(alias = "ExpirationCycle")]
139    pub fn expiration_cycle(&self) -> Result<Option<ExpirationCycle>, InvalidValue> {
140        Ok(self.0.get_int(Tag(827))?.map(ExpirationCycle::from_value))
141    }
142
143    /// The `Text` (58) field.
144    #[doc(alias = "Text")]
145    pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
146        self.0.get_str(Tag(58))
147    }
148
149    /// The `EncodedTextLen` (354) field.
150    #[doc(alias = "EncodedTextLen")]
151    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
152        self.0.get_int(Tag(354))
153    }
154
155    /// The `EncodedText` (355) field.
156    #[doc(alias = "EncodedText")]
157    pub fn encoded_text(&self) -> Option<&'a [u8]> {
158        self.0.get(Tag(355))
159    }
160}
161
162impl std::fmt::Debug for SecListGrp<'_> {
163    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
164        write!(f, "SecListGrp({})", self.0)
165    }
166}