Skip to main content

refix_fix44/generated/messages/
order_status_request.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{
7    FinancingDetails, Header, Instrument, Parties, Trailer, UndInstrmtGrp,
8};
9use super::super::enums::{AcctIDSource, Side};
10
11/// The `OrderStatusRequest` (35=H) message.
12pub struct OrderStatusRequest(RawMessage);
13
14impl OrderStatusRequest {
15    pub const MSG_TYPE: &[u8] = b"H";
16
17    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
18        static TAGS: LazyKnownTags = LazyKnownTags::new(
19            &[
20                Tag(37), Tag(11), Tag(526), Tag(583), Tag(453), Tag(790), Tag(1), Tag(660),
21                Tag(711), Tag(54),
22            ],
23            &[
24                Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
25                Instrument::known_tags(), FinancingDetails::known_tags(),
26                UndInstrmtGrp::known_tags(),
27            ],
28        );
29        &TAGS
30    }
31
32    pub fn from_raw(raw: RawMessage) -> Self {
33        Self(raw)
34    }
35
36    pub fn raw(&self) -> &RawMessage {
37        &self.0
38    }
39
40    pub fn header(&self) -> Header<'_> {
41        Header(self.0.scope(), Self::known_tags().get())
42    }
43
44    pub fn trailer(&self) -> Trailer<'_> {
45        Trailer(self.0.scope())
46    }
47
48    /// The `OrderID` (37) field.
49    #[doc(alias = "OrderID")]
50    pub fn order_id(&self) -> Result<Option<&str>, InvalidValue> {
51        self.0.get_str(Tag(37))
52    }
53
54    /// The `ClOrdID` (11) field.
55    #[doc(alias = "ClOrdID")]
56    pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
57        self.0.get_str(Tag(11))
58    }
59
60    /// The `SecondaryClOrdID` (526) field.
61    #[doc(alias = "SecondaryClOrdID")]
62    pub fn secondary_cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
63        self.0.get_str(Tag(526))
64    }
65
66    /// The `ClOrdLinkID` (583) field.
67    #[doc(alias = "ClOrdLinkID")]
68    pub fn cl_ord_link_id(&self) -> Result<Option<&str>, InvalidValue> {
69        self.0.get_str(Tag(583))
70    }
71
72    /// The instances of the `NoPartyIDs` (453) group.
73    #[doc(alias = "NoPartyIDs")]
74    pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
75        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
76    }
77
78    /// The `OrdStatusReqID` (790) field.
79    #[doc(alias = "OrdStatusReqID")]
80    pub fn ord_status_req_id(&self) -> Result<Option<&str>, InvalidValue> {
81        self.0.get_str(Tag(790))
82    }
83
84    /// The `Account` (1) field.
85    #[doc(alias = "Account")]
86    pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
87        self.0.get_str(Tag(1))
88    }
89
90    /// The `AcctIDSource` (660) field.
91    #[doc(alias = "AcctIDSource")]
92    pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
93        Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
94    }
95
96    /// The `Instrument` component.
97    pub fn instrument(&self) -> Instrument<'_> {
98        Instrument(self.0.scope(), Self::known_tags().get())
99    }
100
101    /// The `FinancingDetails` component.
102    pub fn financing_details(&self) -> FinancingDetails<'_> {
103        FinancingDetails(self.0.scope())
104    }
105
106    /// The instances of the `NoUnderlyings` (711) group.
107    #[doc(alias = "NoUnderlyings")]
108    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
109        self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
110    }
111
112    /// The `Side` (54) field.
113    #[doc(alias = "Side")]
114    pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
115        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
116    }
117}
118
119impl std::fmt::Debug for OrderStatusRequest {
120    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
121        write!(f, "OrderStatusRequest({})", self.0)
122    }
123}
124
125impl std::fmt::Display for OrderStatusRequest {
126    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
127        std::fmt::Display::fmt(&self.0, f)
128    }
129}