Skip to main content

refix_fix44/generated/components/
ord_list_stat_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::{OrdRejReason, OrdStatus};
7
8/// An instance of the `NoOrders` (73) group.
9#[derive(Clone, Copy)]
10pub struct OrdListStatGrp<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for OrdListStatGrp<'a> {
13    fn from(scope: refix_message::Scope<'a>) -> Self {
14        Self(scope)
15    }
16}
17
18impl<'a> OrdListStatGrp<'a> {
19    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20        Tag(73),
21        Tag(11),
22        &[
23            Tag(6), Tag(11), Tag(14), Tag(39), Tag(58), Tag(84), Tag(103), Tag(151), Tag(354),
24            Tag(355), Tag(526), Tag(636),
25        ],
26        &[],
27    );
28
29    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
30        static TAGS: LazyKnownTags = LazyKnownTags::new(
31            &[
32                Tag(11), Tag(526), Tag(14), Tag(39), Tag(636), Tag(151), Tag(84), Tag(6), Tag(103),
33                Tag(58), Tag(354), Tag(355),
34            ],
35            &[],
36        );
37        &TAGS
38    }
39
40    pub fn raw(&self) -> refix_message::Scope<'a> {
41        self.0
42    }
43
44    /// The `ClOrdID` (11) field.
45    #[doc(alias = "ClOrdID")]
46    pub fn cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
47        self.0.get_str(Tag(11))
48    }
49
50    /// The `SecondaryClOrdID` (526) field.
51    #[doc(alias = "SecondaryClOrdID")]
52    pub fn secondary_cl_ord_id(&self) -> Result<Option<&'a str>, InvalidValue> {
53        self.0.get_str(Tag(526))
54    }
55
56    /// The `CumQty` (14) field.
57    #[doc(alias = "CumQty")]
58    pub fn cum_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
59        self.0.get_decimal(Tag(14))
60    }
61
62    /// The `OrdStatus` (39) field.
63    #[doc(alias = "OrdStatus")]
64    pub fn ord_status(&self) -> Result<Option<OrdStatus<'a>>, InvalidValue> {
65        Ok(self.0.get_str(Tag(39))?.map(OrdStatus::from_value))
66    }
67
68    /// The `WorkingIndicator` (636) field.
69    #[doc(alias = "WorkingIndicator")]
70    pub fn working_indicator(&self) -> Result<Option<bool>, InvalidValue> {
71        self.0.get_bool(Tag(636))
72    }
73
74    /// The `LeavesQty` (151) field.
75    #[doc(alias = "LeavesQty")]
76    pub fn leaves_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
77        self.0.get_decimal(Tag(151))
78    }
79
80    /// The `CxlQty` (84) field.
81    #[doc(alias = "CxlQty")]
82    pub fn cxl_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
83        self.0.get_decimal(Tag(84))
84    }
85
86    /// The `AvgPx` (6) field.
87    #[doc(alias = "AvgPx")]
88    pub fn avg_px(&self) -> Result<Option<Decimal>, InvalidValue> {
89        self.0.get_decimal(Tag(6))
90    }
91
92    /// The `OrdRejReason` (103) field.
93    #[doc(alias = "OrdRejReason")]
94    pub fn ord_rej_reason(&self) -> Result<Option<OrdRejReason>, InvalidValue> {
95        Ok(self.0.get_int(Tag(103))?.map(OrdRejReason::from_value))
96    }
97
98    /// The `Text` (58) field.
99    #[doc(alias = "Text")]
100    pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
101        self.0.get_str(Tag(58))
102    }
103
104    /// The `EncodedTextLen` (354) field.
105    #[doc(alias = "EncodedTextLen")]
106    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
107        self.0.get_int(Tag(354))
108    }
109
110    /// The `EncodedText` (355) field.
111    #[doc(alias = "EncodedText")]
112    pub fn encoded_text(&self) -> Option<&'a [u8]> {
113        self.0.get(Tag(355))
114    }
115}
116
117impl std::fmt::Debug for OrdListStatGrp<'_> {
118    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
119        write!(f, "OrdListStatGrp({})", self.0)
120    }
121}