Skip to main content

refix_fix44/generated/components/
leg_quot_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, LegBenchmarkCurveData, LegSecAltIDGrp, LegStipulations, NestedParties};
8
9/// An instance of the `NoLegs` (555) group.
10#[derive(Clone, Copy)]
11pub struct LegQuotGrp<'a>(refix_message::Scope<'a>);
12
13impl<'a> From<refix_message::Scope<'a>> for LegQuotGrp<'a> {
14    fn from(scope: refix_message::Scope<'a>) -> Self {
15        Self(scope)
16    }
17}
18
19impl<'a> LegQuotGrp<'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(676),
29            Tag(677), Tag(678), Tag(679), Tag(680), Tag(681), Tag(683), Tag(684), Tag(686),
30            Tag(687), Tag(690), Tag(739), Tag(740), Tag(764), Tag(942), Tag(955), Tag(956),
31        ],
32        &[LegSecAltIDGrp::TABLE, LegStipulations::TABLE, NestedParties::TABLE],
33    );
34
35    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
36        static TAGS: LazyKnownTags = LazyKnownTags::new(
37            &[
38                Tag(687), Tag(690), Tag(587), Tag(588), Tag(683), Tag(539), Tag(686), Tag(681),
39                Tag(684),
40            ],
41            &[
42                InstrumentLeg::known_tags(), LegStipulations::known_tags(),
43                NestedParties::known_tags(), LegBenchmarkCurveData::known_tags(),
44            ],
45        );
46        &TAGS
47    }
48
49    pub fn raw(&self) -> refix_message::Scope<'a> {
50        self.0
51    }
52
53    /// The `InstrumentLeg` component.
54    pub fn instrument_leg(&self) -> InstrumentLeg<'a> {
55        InstrumentLeg(self.0, Self::known_tags().get())
56    }
57
58    /// The `LegQty` (687) field.
59    #[doc(alias = "LegQty")]
60    pub fn leg_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
61        self.0.get_decimal(Tag(687))
62    }
63
64    /// The `LegSwapType` (690) field.
65    #[doc(alias = "LegSwapType")]
66    pub fn leg_swap_type(&self) -> Result<Option<LegSwapType>, InvalidValue> {
67        Ok(self.0.get_int(Tag(690))?.map(LegSwapType::from_value))
68    }
69
70    /// The `LegSettlType` (587) field.
71    #[doc(alias = "LegSettlType")]
72    pub fn leg_settl_type(&self) -> Result<Option<&'a str>, InvalidValue> {
73        self.0.get_str(Tag(587))
74    }
75
76    /// The `LegSettlDate` (588) field.
77    #[doc(alias = "LegSettlDate")]
78    pub fn leg_settl_date(&self) -> Result<Option<Date>, InvalidValue> {
79        self.0.get_date(Tag(588))
80    }
81
82    /// The instances of the `NoLegStipulations` (683) group.
83    #[doc(alias = "NoLegStipulations")]
84    pub fn leg_stipulations(&self) -> Result<Instances<'a, LegStipulations<'a>>, InvalidValue> {
85        self.0.get_group(&LegStipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
86    }
87
88    /// The instances of the `NoNestedPartyIDs` (539) group.
89    #[doc(alias = "NoNestedPartyIDs")]
90    pub fn nested_party_ids(&self) -> Result<Instances<'a, NestedParties<'a>>, InvalidValue> {
91        self.0.get_group(&NestedParties::TABLE, &Self::known_tags().get()).map(Instances::from)
92    }
93
94    /// The `LegPriceType` (686) field.
95    #[doc(alias = "LegPriceType")]
96    pub fn leg_price_type(&self) -> Result<Option<i64>, InvalidValue> {
97        self.0.get_int(Tag(686))
98    }
99
100    /// The `LegBidPx` (681) field.
101    #[doc(alias = "LegBidPx")]
102    pub fn leg_bid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
103        self.0.get_decimal(Tag(681))
104    }
105
106    /// The `LegOfferPx` (684) field.
107    #[doc(alias = "LegOfferPx")]
108    pub fn leg_offer_px(&self) -> Result<Option<Decimal>, InvalidValue> {
109        self.0.get_decimal(Tag(684))
110    }
111
112    /// The `LegBenchmarkCurveData` component.
113    pub fn leg_benchmark_curve_data(&self) -> LegBenchmarkCurveData<'a> {
114        LegBenchmarkCurveData(self.0)
115    }
116}
117
118impl std::fmt::Debug for LegQuotGrp<'_> {
119    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
120        write!(f, "LegQuotGrp({})", self.0)
121    }
122}