Skip to main content

refix_fix44/generated/messages/
security_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    Header, InstrmtLegGrp, Instrument, InstrumentExtension, Trailer, UndInstrmtGrp,
8};
9use super::super::enums::SubscriptionRequestType;
10
11/// The `SecurityStatusRequest` (35=e) message.
12pub 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    /// The `SecurityStatusReqID` (324) field.
46    #[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    /// The `Instrument` component.
52    pub fn instrument(&self) -> Instrument<'_> {
53        Instrument(self.0.scope(), Self::known_tags().get())
54    }
55
56    /// The `InstrumentExtension` component.
57    pub fn instrument_extension(&self) -> InstrumentExtension<'_> {
58        InstrumentExtension(self.0.scope(), Self::known_tags().get())
59    }
60
61    /// The instances of the `NoUnderlyings` (711) group.
62    #[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    /// The instances of the `NoLegs` (555) group.
68    #[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    /// The `Currency` (15) field.
74    #[doc(alias = "Currency")]
75    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
76        self.0.get_str(Tag(15))
77    }
78
79    /// The `SubscriptionRequestType` (263) field.
80    #[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    /// The `TradingSessionID` (336) field.
86    #[doc(alias = "TradingSessionID")]
87    pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
88        self.0.get_str(Tag(336))
89    }
90
91    /// The `TradingSessionSubID` (625) field.
92    #[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}