Skip to main content

refix_fix44/generated/messages/
derivative_security_list_request.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{Header, Trailer, UnderlyingInstrument};
7use super::super::enums::{SecurityListRequestType, SubscriptionRequestType};
8
9/// The `DerivativeSecurityListRequest` (35=z) message.
10pub struct DerivativeSecurityListRequest(RawMessage);
11
12impl DerivativeSecurityListRequest {
13    pub const MSG_TYPE: &[u8] = b"z";
14
15    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
16        static TAGS: LazyKnownTags = LazyKnownTags::new(
17            &[
18                Tag(320), Tag(559), Tag(762), Tag(15), Tag(58), Tag(354), Tag(355), Tag(336),
19                Tag(625), Tag(263),
20            ],
21            &[Header::known_tags(), Trailer::known_tags(), UnderlyingInstrument::known_tags()],
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    /// The `SecurityReqID` (320) field.
43    #[doc(alias = "SecurityReqID")]
44    pub fn security_req_id(&self) -> Result<Option<&str>, InvalidValue> {
45        self.0.get_str(Tag(320))
46    }
47
48    /// The `SecurityListRequestType` (559) field.
49    #[doc(alias = "SecurityListRequestType")]
50    pub fn security_list_request_type(&self) -> Result<Option<SecurityListRequestType>, InvalidValue> {
51        Ok(self.0.get_int(Tag(559))?.map(SecurityListRequestType::from_value))
52    }
53
54    /// The `UnderlyingInstrument` component.
55    pub fn underlying_instrument(&self) -> UnderlyingInstrument<'_> {
56        UnderlyingInstrument(self.0.scope(), Self::known_tags().get())
57    }
58
59    /// The `SecuritySubType` (762) field.
60    #[doc(alias = "SecuritySubType")]
61    pub fn security_sub_type(&self) -> Result<Option<&str>, InvalidValue> {
62        self.0.get_str(Tag(762))
63    }
64
65    /// The `Currency` (15) field.
66    #[doc(alias = "Currency")]
67    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
68        self.0.get_str(Tag(15))
69    }
70
71    /// The `Text` (58) field.
72    #[doc(alias = "Text")]
73    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
74        self.0.get_str(Tag(58))
75    }
76
77    /// The `EncodedTextLen` (354) field.
78    #[doc(alias = "EncodedTextLen")]
79    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
80        self.0.get_int(Tag(354))
81    }
82
83    /// The `EncodedText` (355) field.
84    #[doc(alias = "EncodedText")]
85    pub fn encoded_text(&self) -> Option<&[u8]> {
86        self.0.get(Tag(355))
87    }
88
89    /// The `TradingSessionID` (336) field.
90    #[doc(alias = "TradingSessionID")]
91    pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
92        self.0.get_str(Tag(336))
93    }
94
95    /// The `TradingSessionSubID` (625) field.
96    #[doc(alias = "TradingSessionSubID")]
97    pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
98        self.0.get_str(Tag(625))
99    }
100
101    /// The `SubscriptionRequestType` (263) field.
102    #[doc(alias = "SubscriptionRequestType")]
103    pub fn subscription_request_type(&self) -> Result<Option<SubscriptionRequestType<'_>>, InvalidValue> {
104        Ok(self.0.get_str(Tag(263))?.map(SubscriptionRequestType::from_value))
105    }
106}
107
108impl std::fmt::Debug for DerivativeSecurityListRequest {
109    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
110        write!(f, "DerivativeSecurityListRequest({})", self.0)
111    }
112}
113
114impl std::fmt::Display for DerivativeSecurityListRequest {
115    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
116        std::fmt::Display::fmt(&self.0, f)
117    }
118}