refix_fix44/generated/messages/
trading_session_status_request.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{Header, Trailer};
7use super::super::enums::{SubscriptionRequestType, TradSesMethod, TradSesMode};
8
9pub struct TradingSessionStatusRequest(RawMessage);
11
12impl TradingSessionStatusRequest {
13 pub const MSG_TYPE: &[u8] = b"g";
14
15 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
16 static TAGS: LazyKnownTags = LazyKnownTags::new(
17 &[Tag(335), Tag(336), Tag(625), Tag(338), Tag(339), Tag(263)],
18 &[Header::known_tags(), Trailer::known_tags()],
19 );
20 &TAGS
21 }
22
23 pub fn from_raw(raw: RawMessage) -> Self {
24 Self(raw)
25 }
26
27 pub fn raw(&self) -> &RawMessage {
28 &self.0
29 }
30
31 pub fn header(&self) -> Header<'_> {
32 Header(self.0.scope(), Self::known_tags().get())
33 }
34
35 pub fn trailer(&self) -> Trailer<'_> {
36 Trailer(self.0.scope())
37 }
38
39 #[doc(alias = "TradSesReqID")]
41 pub fn trad_ses_req_id(&self) -> Result<Option<&str>, InvalidValue> {
42 self.0.get_str(Tag(335))
43 }
44
45 #[doc(alias = "TradingSessionID")]
47 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
48 self.0.get_str(Tag(336))
49 }
50
51 #[doc(alias = "TradingSessionSubID")]
53 pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
54 self.0.get_str(Tag(625))
55 }
56
57 #[doc(alias = "TradSesMethod")]
59 pub fn trad_ses_method(&self) -> Result<Option<TradSesMethod>, InvalidValue> {
60 Ok(self.0.get_int(Tag(338))?.map(TradSesMethod::from_value))
61 }
62
63 #[doc(alias = "TradSesMode")]
65 pub fn trad_ses_mode(&self) -> Result<Option<TradSesMode>, InvalidValue> {
66 Ok(self.0.get_int(Tag(339))?.map(TradSesMode::from_value))
67 }
68
69 #[doc(alias = "SubscriptionRequestType")]
71 pub fn subscription_request_type(&self) -> Result<Option<SubscriptionRequestType<'_>>, InvalidValue> {
72 Ok(self.0.get_str(Tag(263))?.map(SubscriptionRequestType::from_value))
73 }
74}
75
76impl std::fmt::Debug for TradingSessionStatusRequest {
77 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
78 write!(f, "TradingSessionStatusRequest({})", self.0)
79 }
80}
81
82impl std::fmt::Display for TradingSessionStatusRequest {
83 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
84 std::fmt::Display::fmt(&self.0, f)
85 }
86}