Skip to main content

refix_fix44/generated/components/
leg_quot_stat_grp.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Date, Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::LegSwapType;
7use super::{InstrumentLeg, LegSecAltIDGrp, LegStipulations, NestedParties};
8
9/// An instance of the `NoLegs` (555) group.
10#[derive(Clone, Copy)]
11pub struct LegQuotStatGrp<'a>(refix_message::Scope<'a>);
12
13impl<'a> From<refix_message::Scope<'a>> for LegQuotStatGrp<'a> {
14    fn from(scope: refix_message::Scope<'a>) -> Self {
15        Self(scope)
16    }
17}
18
19impl<'a> LegQuotStatGrp<'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(539), Tag(556), Tag(587), Tag(588), Tag(596), Tag(597), Tag(598), Tag(599),
26            Tag(600), Tag(601), Tag(602), Tag(603), Tag(604), Tag(607), Tag(608), Tag(609),
27            Tag(610), Tag(611), Tag(612), Tag(613), Tag(614), Tag(615), Tag(616), Tag(617),
28            Tag(618), Tag(619), Tag(620), Tag(621), Tag(622), Tag(623), Tag(624), Tag(683),
29            Tag(687), Tag(690), Tag(739), Tag(740), Tag(764), Tag(942), Tag(955), Tag(956),
30        ],
31        &[LegSecAltIDGrp::TABLE, LegStipulations::TABLE, NestedParties::TABLE],
32    );
33
34    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
35        static TAGS: LazyKnownTags = LazyKnownTags::new(
36            &[Tag(687), Tag(690), Tag(587), Tag(588), Tag(683), Tag(539)],
37            &[
38                InstrumentLeg::known_tags(), LegStipulations::known_tags(),
39                NestedParties::known_tags(),
40            ],
41        );
42        &TAGS
43    }
44
45    pub fn raw(&self) -> refix_message::Scope<'a> {
46        self.0
47    }
48
49    /// The `InstrumentLeg` component.
50    pub fn instrument_leg(&self) -> InstrumentLeg<'a> {
51        InstrumentLeg(self.0, Self::known_tags().get())
52    }
53
54    /// The `LegQty` (687) field.
55    #[doc(alias = "LegQty")]
56    pub fn leg_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
57        self.0.get_decimal(Tag(687))
58    }
59
60    /// The `LegSwapType` (690) field.
61    #[doc(alias = "LegSwapType")]
62    pub fn leg_swap_type(&self) -> Result<Option<LegSwapType>, InvalidValue> {
63        Ok(self.0.get_int(Tag(690))?.map(LegSwapType::from_value))
64    }
65
66    /// The `LegSettlType` (587) field.
67    #[doc(alias = "LegSettlType")]
68    pub fn leg_settl_type(&self) -> Result<Option<&'a str>, InvalidValue> {
69        self.0.get_str(Tag(587))
70    }
71
72    /// The `LegSettlDate` (588) field.
73    #[doc(alias = "LegSettlDate")]
74    pub fn leg_settl_date(&self) -> Result<Option<Date>, InvalidValue> {
75        self.0.get_date(Tag(588))
76    }
77
78    /// The instances of the `NoLegStipulations` (683) group.
79    #[doc(alias = "NoLegStipulations")]
80    pub fn leg_stipulations(&self) -> Result<Instances<'a, LegStipulations<'a>>, InvalidValue> {
81        self.0.get_group(&LegStipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
82    }
83
84    /// The instances of the `NoNestedPartyIDs` (539) group.
85    #[doc(alias = "NoNestedPartyIDs")]
86    pub fn nested_party_ids(&self) -> Result<Instances<'a, NestedParties<'a>>, InvalidValue> {
87        self.0.get_group(&NestedParties::TABLE, &Self::known_tags().get()).map(Instances::from)
88    }
89}
90
91impl std::fmt::Debug for LegQuotStatGrp<'_> {
92    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
93        write!(f, "LegQuotStatGrp({})", self.0)
94    }
95}