Skip to main content

refix_fix44/generated/components/
und_instrmt_strk_px_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, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::Side;
7use super::{UndSecAltIDGrp, UnderlyingInstrument, UnderlyingStipulations};
8
9/// An instance of the `NoUnderlyings` (711) group.
10#[derive(Clone, Copy)]
11pub struct UndInstrmtStrkPxGrp<'a>(refix_message::Scope<'a>);
12
13impl<'a> From<refix_message::Scope<'a>> for UndInstrmtStrkPxGrp<'a> {
14    fn from(scope: refix_message::Scope<'a>) -> Self {
15        Self(scope)
16    }
17}
18
19impl<'a> UndInstrmtStrkPxGrp<'a> {
20    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
21        Tag(711),
22        Tag(311),
23        &[
24            Tag(11), Tag(15), Tag(44), Tag(54), Tag(58), Tag(140), Tag(241), Tag(242), Tag(243),
25            Tag(244), Tag(245), Tag(246), Tag(247), Tag(256), Tag(305), Tag(306), Tag(307),
26            Tag(308), Tag(309), Tag(310), Tag(311), Tag(312), Tag(313), Tag(315), Tag(316),
27            Tag(317), Tag(318), Tag(354), Tag(355), Tag(362), Tag(363), Tag(364), Tag(365),
28            Tag(435), Tag(436), Tag(457), Tag(462), Tag(463), Tag(526), Tag(542), Tag(592),
29            Tag(593), Tag(594), Tag(595), Tag(763), Tag(810), Tag(877), Tag(878), Tag(879),
30            Tag(882), Tag(883), Tag(884), Tag(885), Tag(886), Tag(887), Tag(941),
31        ],
32        &[UndSecAltIDGrp::TABLE, UnderlyingStipulations::TABLE],
33    );
34
35    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
36        static TAGS: LazyKnownTags = LazyKnownTags::new(
37            &[Tag(140), Tag(11), Tag(526), Tag(54), Tag(44), Tag(15), Tag(58), Tag(354), Tag(355)],
38            &[UnderlyingInstrument::known_tags()],
39        );
40        &TAGS
41    }
42
43    pub fn raw(&self) -> refix_message::Scope<'a> {
44        self.0
45    }
46
47    /// The `UnderlyingInstrument` component.
48    pub fn underlying_instrument(&self) -> UnderlyingInstrument<'a> {
49        UnderlyingInstrument(self.0, Self::known_tags().get())
50    }
51
52    /// The `PrevClosePx` (140) field.
53    #[doc(alias = "PrevClosePx")]
54    pub fn prev_close_px(&self) -> Result<Option<Decimal>, InvalidValue> {
55        self.0.get_decimal(Tag(140))
56    }
57
58    /// The `ClOrdID` (11) field.
59    #[doc(alias = "ClOrdID")]
60    pub fn cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
61        self.0.get_str(Tag(11))
62    }
63
64    /// The `SecondaryClOrdID` (526) field.
65    #[doc(alias = "SecondaryClOrdID")]
66    pub fn secondary_cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
67        self.0.get_str(Tag(526))
68    }
69
70    /// The `Side` (54) field.
71    #[doc(alias = "Side")]
72    pub fn side(&self) -> Result<Option<Side<'a>>, InvalidValue> {
73        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
74    }
75
76    /// The `Price` (44) field.
77    #[doc(alias = "Price")]
78    pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
79        self.0.get_decimal(Tag(44))
80    }
81
82    /// The `Currency` (15) field.
83    #[doc(alias = "Currency")]
84    pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
85        self.0.get_str(Tag(15))
86    }
87
88    /// The `Text` (58) field.
89    #[doc(alias = "Text")]
90    pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
91        self.0.get_str(Tag(58))
92    }
93
94    /// The `EncodedTextLen` (354) field.
95    #[doc(alias = "EncodedTextLen")]
96    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
97        self.0.get_int(Tag(354))
98    }
99
100    /// The `EncodedText` (355) field.
101    #[doc(alias = "EncodedText")]
102    pub fn encoded_text(&self) -> Option<&'a [u8]> {
103        self.0.get(Tag(355))
104    }
105}
106
107impl std::fmt::Debug for UndInstrmtStrkPxGrp<'_> {
108    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
109        write!(f, "UndInstrmtStrkPxGrp({})", self.0)
110    }
111}