refix_fix44/generated/messages/
derivative_security_list_request.rs1#![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
9pub 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 #[doc(alias = "SecurityReqID")]
44 pub fn security_req_id(&self) -> Result<Option<&str>, InvalidValue> {
45 self.0.get_str(Tag(320))
46 }
47
48 #[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 pub fn underlying_instrument(&self) -> UnderlyingInstrument<'_> {
56 UnderlyingInstrument(self.0.scope(), Self::known_tags().get())
57 }
58
59 #[doc(alias = "SecuritySubType")]
61 pub fn security_sub_type(&self) -> Result<Option<&str>, InvalidValue> {
62 self.0.get_str(Tag(762))
63 }
64
65 #[doc(alias = "Currency")]
67 pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
68 self.0.get_str(Tag(15))
69 }
70
71 #[doc(alias = "Text")]
73 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
74 self.0.get_str(Tag(58))
75 }
76
77 #[doc(alias = "EncodedTextLen")]
79 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
80 self.0.get_int(Tag(354))
81 }
82
83 #[doc(alias = "EncodedText")]
85 pub fn encoded_text(&self) -> Option<&[u8]> {
86 self.0.get(Tag(355))
87 }
88
89 #[doc(alias = "TradingSessionID")]
91 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
92 self.0.get_str(Tag(336))
93 }
94
95 #[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 #[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}