refix_fix44/generated/components/
instrmt_leg_sec_list_grp.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{GroupTable, Instances, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::LegSwapType;
7use super::{InstrumentLeg, LegBenchmarkCurveData, LegSecAltIDGrp, LegStipulations};
8
9#[derive(Clone, Copy)]
11pub struct InstrmtLegSecListGrp<'a>(refix_message::Scope<'a>);
12
13impl<'a> From<refix_message::Scope<'a>> for InstrmtLegSecListGrp<'a> {
14 fn from(scope: refix_message::Scope<'a>) -> Self {
15 Self(scope)
16 }
17}
18
19impl<'a> InstrmtLegSecListGrp<'a> {
20 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
21 Tag(555),
22 Tag(600),
23 &[
24 Tag(248), Tag(249), Tag(250), Tag(251), Tag(252), Tag(253), Tag(254), Tag(257),
25 Tag(556), Tag(587), Tag(596), Tag(597), Tag(598), Tag(599), Tag(600), Tag(601),
26 Tag(602), Tag(603), Tag(604), Tag(607), Tag(608), Tag(609), Tag(610), Tag(611),
27 Tag(612), Tag(613), Tag(614), Tag(615), Tag(616), Tag(617), Tag(618), Tag(619),
28 Tag(620), Tag(621), Tag(622), Tag(623), Tag(624), Tag(676), Tag(677), Tag(678),
29 Tag(679), Tag(680), Tag(683), Tag(690), Tag(739), Tag(740), Tag(764), Tag(942),
30 Tag(955), Tag(956),
31 ],
32 &[LegSecAltIDGrp::TABLE, LegStipulations::TABLE],
33 );
34
35 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
36 static TAGS: LazyKnownTags = LazyKnownTags::new(
37 &[Tag(690), Tag(587), Tag(683)],
38 &[
39 InstrumentLeg::known_tags(), LegStipulations::known_tags(),
40 LegBenchmarkCurveData::known_tags(),
41 ],
42 );
43 &TAGS
44 }
45
46 pub fn raw(&self) -> refix_message::Scope<'a> {
47 self.0
48 }
49
50 pub fn instrument_leg(&self) -> InstrumentLeg<'a> {
52 InstrumentLeg(self.0, Self::known_tags().get())
53 }
54
55 #[doc(alias = "LegSwapType")]
57 pub fn leg_swap_type(&self) -> Result<Option<LegSwapType>, InvalidValue> {
58 Ok(self.0.get_int(Tag(690))?.map(LegSwapType::from_value))
59 }
60
61 #[doc(alias = "LegSettlType")]
63 pub fn leg_settl_type(&self) -> Result<Option<&'a str>, InvalidValue> {
64 self.0.get_str(Tag(587))
65 }
66
67 #[doc(alias = "NoLegStipulations")]
69 pub fn leg_stipulations(&self) -> Result<Instances<'a, LegStipulations<'a>>, InvalidValue> {
70 self.0.get_group(&LegStipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
71 }
72
73 pub fn leg_benchmark_curve_data(&self) -> LegBenchmarkCurveData<'a> {
75 LegBenchmarkCurveData(self.0)
76 }
77}
78
79impl std::fmt::Debug for InstrmtLegSecListGrp<'_> {
80 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
81 write!(f, "InstrmtLegSecListGrp({})", self.0)
82 }
83}