refix_fix44/generated/messages/
security_list_request.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{
7 FinancingDetails, Header, InstrmtLegGrp, Instrument, InstrumentExtension, Trailer,
8 UndInstrmtGrp,
9};
10use super::super::enums::{SecurityListRequestType, SubscriptionRequestType};
11
12pub struct SecurityListRequest(RawMessage);
14
15impl SecurityListRequest {
16 pub const MSG_TYPE: &[u8] = b"x";
17
18 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
19 static TAGS: LazyKnownTags = LazyKnownTags::new(
20 &[
21 Tag(320), Tag(559), Tag(711), Tag(555), Tag(15), Tag(58), Tag(354), Tag(355),
22 Tag(336), Tag(625), Tag(263),
23 ],
24 &[
25 Header::known_tags(), Trailer::known_tags(), Instrument::known_tags(),
26 InstrumentExtension::known_tags(), FinancingDetails::known_tags(),
27 UndInstrmtGrp::known_tags(), InstrmtLegGrp::known_tags(),
28 ],
29 );
30 &TAGS
31 }
32
33 pub fn from_raw(raw: RawMessage) -> Self {
34 Self(raw)
35 }
36
37 pub fn raw(&self) -> &RawMessage {
38 &self.0
39 }
40
41 pub fn header(&self) -> Header<'_> {
42 Header(self.0.scope(), Self::known_tags().get())
43 }
44
45 pub fn trailer(&self) -> Trailer<'_> {
46 Trailer(self.0.scope())
47 }
48
49 #[doc(alias = "SecurityReqID")]
51 pub fn security_req_id(&self) -> Result<Option<&str>, InvalidValue> {
52 self.0.get_str(Tag(320))
53 }
54
55 #[doc(alias = "SecurityListRequestType")]
57 pub fn security_list_request_type(&self) -> Result<Option<SecurityListRequestType>, InvalidValue> {
58 Ok(self.0.get_int(Tag(559))?.map(SecurityListRequestType::from_value))
59 }
60
61 pub fn instrument(&self) -> Instrument<'_> {
63 Instrument(self.0.scope(), Self::known_tags().get())
64 }
65
66 pub fn instrument_extension(&self) -> InstrumentExtension<'_> {
68 InstrumentExtension(self.0.scope(), Self::known_tags().get())
69 }
70
71 pub fn financing_details(&self) -> FinancingDetails<'_> {
73 FinancingDetails(self.0.scope())
74 }
75
76 #[doc(alias = "NoUnderlyings")]
78 pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
79 self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
80 }
81
82 #[doc(alias = "NoLegs")]
84 pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
85 self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
86 }
87
88 #[doc(alias = "Currency")]
90 pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
91 self.0.get_str(Tag(15))
92 }
93
94 #[doc(alias = "Text")]
96 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
97 self.0.get_str(Tag(58))
98 }
99
100 #[doc(alias = "EncodedTextLen")]
102 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
103 self.0.get_int(Tag(354))
104 }
105
106 #[doc(alias = "EncodedText")]
108 pub fn encoded_text(&self) -> Option<&[u8]> {
109 self.0.get(Tag(355))
110 }
111
112 #[doc(alias = "TradingSessionID")]
114 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
115 self.0.get_str(Tag(336))
116 }
117
118 #[doc(alias = "TradingSessionSubID")]
120 pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
121 self.0.get_str(Tag(625))
122 }
123
124 #[doc(alias = "SubscriptionRequestType")]
126 pub fn subscription_request_type(&self) -> Result<Option<SubscriptionRequestType<'_>>, InvalidValue> {
127 Ok(self.0.get_str(Tag(263))?.map(SubscriptionRequestType::from_value))
128 }
129}
130
131impl std::fmt::Debug for SecurityListRequest {
132 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
133 write!(f, "SecurityListRequest({})", self.0)
134 }
135}
136
137impl std::fmt::Display for SecurityListRequest {
138 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
139 std::fmt::Display::fmt(&self.0, f)
140 }
141}