refix_fix44/generated/messages/
order_status_request.rs1#![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
11pub 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 #[doc(alias = "OrderID")]
50 pub fn order_id(&self) -> Result<Option<&str>, InvalidValue> {
51 self.0.get_str(Tag(37))
52 }
53
54 #[doc(alias = "ClOrdID")]
56 pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
57 self.0.get_str(Tag(11))
58 }
59
60 #[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 #[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 #[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 #[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 #[doc(alias = "Account")]
86 pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
87 self.0.get_str(Tag(1))
88 }
89
90 #[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 pub fn instrument(&self) -> Instrument<'_> {
98 Instrument(self.0.scope(), Self::known_tags().get())
99 }
100
101 pub fn financing_details(&self) -> FinancingDetails<'_> {
103 FinancingDetails(self.0.scope())
104 }
105
106 #[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 #[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}