refix_fix44/generated/messages/
security_status_request.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{
7 Header, InstrmtLegGrp, Instrument, InstrumentExtension, Trailer, UndInstrmtGrp,
8};
9use super::super::enums::SubscriptionRequestType;
10
11pub struct SecurityStatusRequest(RawMessage);
13
14impl SecurityStatusRequest {
15 pub const MSG_TYPE: &[u8] = b"e";
16
17 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
18 static TAGS: LazyKnownTags = LazyKnownTags::new(
19 &[Tag(324), Tag(711), Tag(555), Tag(15), Tag(263), Tag(336), Tag(625)],
20 &[
21 Header::known_tags(), Trailer::known_tags(), Instrument::known_tags(),
22 InstrumentExtension::known_tags(), UndInstrmtGrp::known_tags(),
23 InstrmtLegGrp::known_tags(),
24 ],
25 );
26 &TAGS
27 }
28
29 pub fn from_raw(raw: RawMessage) -> Self {
30 Self(raw)
31 }
32
33 pub fn raw(&self) -> &RawMessage {
34 &self.0
35 }
36
37 pub fn header(&self) -> Header<'_> {
38 Header(self.0.scope(), Self::known_tags().get())
39 }
40
41 pub fn trailer(&self) -> Trailer<'_> {
42 Trailer(self.0.scope())
43 }
44
45 #[doc(alias = "SecurityStatusReqID")]
47 pub fn security_status_req_id(&self) -> Result<Option<&str>, InvalidValue> {
48 self.0.get_str(Tag(324))
49 }
50
51 pub fn instrument(&self) -> Instrument<'_> {
53 Instrument(self.0.scope(), Self::known_tags().get())
54 }
55
56 pub fn instrument_extension(&self) -> InstrumentExtension<'_> {
58 InstrumentExtension(self.0.scope(), Self::known_tags().get())
59 }
60
61 #[doc(alias = "NoUnderlyings")]
63 pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
64 self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
65 }
66
67 #[doc(alias = "NoLegs")]
69 pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
70 self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
71 }
72
73 #[doc(alias = "Currency")]
75 pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
76 self.0.get_str(Tag(15))
77 }
78
79 #[doc(alias = "SubscriptionRequestType")]
81 pub fn subscription_request_type(&self) -> Result<Option<SubscriptionRequestType<'_>>, InvalidValue> {
82 Ok(self.0.get_str(Tag(263))?.map(SubscriptionRequestType::from_value))
83 }
84
85 #[doc(alias = "TradingSessionID")]
87 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
88 self.0.get_str(Tag(336))
89 }
90
91 #[doc(alias = "TradingSessionSubID")]
93 pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
94 self.0.get_str(Tag(625))
95 }
96}
97
98impl std::fmt::Debug for SecurityStatusRequest {
99 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
100 write!(f, "SecurityStatusRequest({})", self.0)
101 }
102}
103
104impl std::fmt::Display for SecurityStatusRequest {
105 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
106 std::fmt::Display::fmt(&self.0, f)
107 }
108}