refix_fix44/generated/messages/
order_mass_status_request.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{Header, Instrument, Parties, Trailer, UnderlyingInstrument};
7use super::super::enums::{AcctIDSource, MassStatusReqType, Side};
8
9pub struct OrderMassStatusRequest(RawMessage);
11
12impl OrderMassStatusRequest {
13 pub const MSG_TYPE: &[u8] = b"AF";
14
15 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
16 static TAGS: LazyKnownTags = LazyKnownTags::new(
17 &[Tag(584), Tag(585), Tag(453), Tag(1), Tag(660), Tag(336), Tag(625), Tag(54)],
18 &[
19 Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
20 Instrument::known_tags(), UnderlyingInstrument::known_tags(),
21 ],
22 );
23 &TAGS
24 }
25
26 pub fn from_raw(raw: RawMessage) -> Self {
27 Self(raw)
28 }
29
30 pub fn raw(&self) -> &RawMessage {
31 &self.0
32 }
33
34 pub fn header(&self) -> Header<'_> {
35 Header(self.0.scope(), Self::known_tags().get())
36 }
37
38 pub fn trailer(&self) -> Trailer<'_> {
39 Trailer(self.0.scope())
40 }
41
42 #[doc(alias = "MassStatusReqID")]
44 pub fn mass_status_req_id(&self) -> Result<Option<&str>, InvalidValue> {
45 self.0.get_str(Tag(584))
46 }
47
48 #[doc(alias = "MassStatusReqType")]
50 pub fn mass_status_req_type(&self) -> Result<Option<MassStatusReqType>, InvalidValue> {
51 Ok(self.0.get_int(Tag(585))?.map(MassStatusReqType::from_value))
52 }
53
54 #[doc(alias = "NoPartyIDs")]
56 pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
57 self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
58 }
59
60 #[doc(alias = "Account")]
62 pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
63 self.0.get_str(Tag(1))
64 }
65
66 #[doc(alias = "AcctIDSource")]
68 pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
69 Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
70 }
71
72 #[doc(alias = "TradingSessionID")]
74 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
75 self.0.get_str(Tag(336))
76 }
77
78 #[doc(alias = "TradingSessionSubID")]
80 pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
81 self.0.get_str(Tag(625))
82 }
83
84 pub fn instrument(&self) -> Instrument<'_> {
86 Instrument(self.0.scope(), Self::known_tags().get())
87 }
88
89 pub fn underlying_instrument(&self) -> UnderlyingInstrument<'_> {
91 UnderlyingInstrument(self.0.scope(), Self::known_tags().get())
92 }
93
94 #[doc(alias = "Side")]
96 pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
97 Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
98 }
99}
100
101impl std::fmt::Debug for OrderMassStatusRequest {
102 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
103 write!(f, "OrderMassStatusRequest({})", self.0)
104 }
105}
106
107impl std::fmt::Display for OrderMassStatusRequest {
108 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
109 std::fmt::Display::fmt(&self.0, f)
110 }
111}