Skip to main content

refix_fix42/generated/messages/
security_definition_request.rs

1// @generated by refix codegen from FIX42.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5    Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, MonthYear, RawMessage, Tag,
6};
7
8use super::super::components::{Header, Trailer};
9use super::super::enums::{IDSource, PutOrCall, SecurityRequestType, SecurityType, Side};
10
11/// The `SecurityDefinitionRequest` (35=c) message.
12pub struct SecurityDefinitionRequest(RawMessage);
13
14impl SecurityDefinitionRequest {
15    pub const MSG_TYPE: &[u8] = b"c";
16
17    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
18        static TAGS: LazyKnownTags = LazyKnownTags::new(
19            &[
20                Tag(320), Tag(321), Tag(55), Tag(65), Tag(48), Tag(22), Tag(167), Tag(200),
21                Tag(205), Tag(201), Tag(202), Tag(206), Tag(231), Tag(223), Tag(207), Tag(106),
22                Tag(348), Tag(349), Tag(107), Tag(350), Tag(351), Tag(15), Tag(58), Tag(354),
23                Tag(355), Tag(336), Tag(146),
24            ],
25            &[
26                Header::known_tags(), Trailer::known_tags(),
27                SecurityDefinitionRequestRelatedSym::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())
43    }
44
45    pub fn trailer(&self) -> Trailer<'_> {
46        Trailer(self.0.scope())
47    }
48
49    /// The `SecurityReqID` (320) field.
50    #[doc(alias = "SecurityReqID")]
51    pub fn security_req_id(&self) -> Result<Option<&str>, InvalidValue> {
52        self.0.get_str(Tag(320))
53    }
54
55    /// The `SecurityRequestType` (321) field.
56    #[doc(alias = "SecurityRequestType")]
57    pub fn security_request_type(&self) -> Result<Option<SecurityRequestType>, InvalidValue> {
58        Ok(self.0.get_int(Tag(321))?.map(SecurityRequestType::from_value))
59    }
60
61    /// The `Symbol` (55) field.
62    #[doc(alias = "Symbol")]
63    pub fn symbol(&self) -> Result<Option<&str>, InvalidValue> {
64        self.0.get_str(Tag(55))
65    }
66
67    /// The `SymbolSfx` (65) field.
68    #[doc(alias = "SymbolSfx")]
69    pub fn symbol_sfx(&self) -> Result<Option<&str>, InvalidValue> {
70        self.0.get_str(Tag(65))
71    }
72
73    /// The `SecurityID` (48) field.
74    #[doc(alias = "SecurityID")]
75    pub fn security_id(&self) -> Result<Option<&str>, InvalidValue> {
76        self.0.get_str(Tag(48))
77    }
78
79    /// The `IDSource` (22) field.
80    #[doc(alias = "IDSource")]
81    pub fn id_source(&self) -> Result<Option<IDSource<'_>>, InvalidValue> {
82        Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
83    }
84
85    /// The `SecurityType` (167) field.
86    #[doc(alias = "SecurityType")]
87    pub fn security_type(&self) -> Result<Option<SecurityType<'_>>, InvalidValue> {
88        Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
89    }
90
91    /// The `MaturityMonthYear` (200) field.
92    #[doc(alias = "MaturityMonthYear")]
93    pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
94        self.0.get_month_year(Tag(200))
95    }
96
97    /// The `MaturityDay` (205) field.
98    #[doc(alias = "MaturityDay")]
99    pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
100        self.0.get_int(Tag(205))
101    }
102
103    /// The `PutOrCall` (201) field.
104    #[doc(alias = "PutOrCall")]
105    pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
106        Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
107    }
108
109    /// The `StrikePrice` (202) field.
110    #[doc(alias = "StrikePrice")]
111    pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
112        self.0.get_decimal(Tag(202))
113    }
114
115    /// The `OptAttribute` (206) field.
116    #[doc(alias = "OptAttribute")]
117    pub fn opt_attribute(&self) -> Result<Option<&str>, InvalidValue> {
118        self.0.get_str(Tag(206))
119    }
120
121    /// The `ContractMultiplier` (231) field.
122    #[doc(alias = "ContractMultiplier")]
123    pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
124        self.0.get_decimal(Tag(231))
125    }
126
127    /// The `CouponRate` (223) field.
128    #[doc(alias = "CouponRate")]
129    pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
130        self.0.get_decimal(Tag(223))
131    }
132
133    /// The `SecurityExchange` (207) field.
134    #[doc(alias = "SecurityExchange")]
135    pub fn security_exchange(&self) -> Result<Option<&str>, InvalidValue> {
136        self.0.get_str(Tag(207))
137    }
138
139    /// The `Issuer` (106) field.
140    #[doc(alias = "Issuer")]
141    pub fn issuer(&self) -> Result<Option<&str>, InvalidValue> {
142        self.0.get_str(Tag(106))
143    }
144
145    /// The `EncodedIssuerLen` (348) field.
146    #[doc(alias = "EncodedIssuerLen")]
147    pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
148        self.0.get_int(Tag(348))
149    }
150
151    /// The `EncodedIssuer` (349) field.
152    #[doc(alias = "EncodedIssuer")]
153    pub fn encoded_issuer(&self) -> Option<&[u8]> {
154        self.0.get(Tag(349))
155    }
156
157    /// The `SecurityDesc` (107) field.
158    #[doc(alias = "SecurityDesc")]
159    pub fn security_desc(&self) -> Result<Option<&str>, InvalidValue> {
160        self.0.get_str(Tag(107))
161    }
162
163    /// The `EncodedSecurityDescLen` (350) field.
164    #[doc(alias = "EncodedSecurityDescLen")]
165    pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
166        self.0.get_int(Tag(350))
167    }
168
169    /// The `EncodedSecurityDesc` (351) field.
170    #[doc(alias = "EncodedSecurityDesc")]
171    pub fn encoded_security_desc(&self) -> Option<&[u8]> {
172        self.0.get(Tag(351))
173    }
174
175    /// The `Currency` (15) field.
176    #[doc(alias = "Currency")]
177    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
178        self.0.get_str(Tag(15))
179    }
180
181    /// The `Text` (58) field.
182    #[doc(alias = "Text")]
183    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
184        self.0.get_str(Tag(58))
185    }
186
187    /// The `EncodedTextLen` (354) field.
188    #[doc(alias = "EncodedTextLen")]
189    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
190        self.0.get_int(Tag(354))
191    }
192
193    /// The `EncodedText` (355) field.
194    #[doc(alias = "EncodedText")]
195    pub fn encoded_text(&self) -> Option<&[u8]> {
196        self.0.get(Tag(355))
197    }
198
199    /// The `TradingSessionID` (336) field.
200    #[doc(alias = "TradingSessionID")]
201    pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
202        self.0.get_str(Tag(336))
203    }
204
205    /// The instances of the `NoRelatedSym` (146) group.
206    #[doc(alias = "NoRelatedSym")]
207    pub fn related_sym(&self) -> Result<Instances<'_, SecurityDefinitionRequestRelatedSym<'_>>, InvalidValue> {
208        self.0.get_group(&SecurityDefinitionRequestRelatedSym::TABLE, &Self::known_tags().get()).map(Instances::from)
209    }
210}
211
212impl std::fmt::Debug for SecurityDefinitionRequest {
213    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
214        write!(f, "SecurityDefinitionRequest({})", self.0)
215    }
216}
217
218impl std::fmt::Display for SecurityDefinitionRequest {
219    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
220        std::fmt::Display::fmt(&self.0, f)
221    }
222}
223
224/// An instance of the `NoRelatedSym` (146) group.
225#[derive(Clone, Copy)]
226pub struct SecurityDefinitionRequestRelatedSym<'a>(refix_message::Scope<'a>);
227
228impl<'a> From<refix_message::Scope<'a>> for SecurityDefinitionRequestRelatedSym<'a> {
229    fn from(scope: refix_message::Scope<'a>) -> Self {
230        Self(scope)
231    }
232}
233
234impl<'a> SecurityDefinitionRequestRelatedSym<'a> {
235    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
236        Tag(146),
237        Tag(311),
238        &[
239            Tag(54), Tag(305), Tag(306), Tag(307), Tag(308), Tag(309), Tag(310), Tag(311), Tag(312),
240            Tag(313), Tag(314), Tag(315), Tag(316), Tag(317), Tag(318), Tag(319), Tag(362),
241            Tag(363), Tag(364), Tag(365), Tag(435), Tag(436),
242        ],
243        &[],
244    );
245
246    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
247        static TAGS: LazyKnownTags = LazyKnownTags::new(
248            &[
249                Tag(311), Tag(312), Tag(309), Tag(305), Tag(310), Tag(313), Tag(314), Tag(315),
250                Tag(316), Tag(317), Tag(436), Tag(435), Tag(308), Tag(306), Tag(362), Tag(363),
251                Tag(307), Tag(364), Tag(365), Tag(319), Tag(54), Tag(318),
252            ],
253            &[],
254        );
255        &TAGS
256    }
257
258    pub fn raw(&self) -> refix_message::Scope<'a> {
259        self.0
260    }
261
262    /// The `UnderlyingSymbol` (311) field.
263    #[doc(alias = "UnderlyingSymbol")]
264    pub fn underlying_symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
265        self.0.get_str(Tag(311))
266    }
267
268    /// The `UnderlyingSymbolSfx` (312) field.
269    #[doc(alias = "UnderlyingSymbolSfx")]
270    pub fn underlying_symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
271        self.0.get_str(Tag(312))
272    }
273
274    /// The `UnderlyingSecurityID` (309) field.
275    #[doc(alias = "UnderlyingSecurityID")]
276    pub fn underlying_security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
277        self.0.get_str(Tag(309))
278    }
279
280    /// The `UnderlyingIDSource` (305) field.
281    #[doc(alias = "UnderlyingIDSource")]
282    pub fn underlying_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
283        self.0.get_str(Tag(305))
284    }
285
286    /// The `UnderlyingSecurityType` (310) field.
287    #[doc(alias = "UnderlyingSecurityType")]
288    pub fn underlying_security_type(&self) -> Result<Option<&'a str>, InvalidValue> {
289        self.0.get_str(Tag(310))
290    }
291
292    /// The `UnderlyingMaturityMonthYear` (313) field.
293    #[doc(alias = "UnderlyingMaturityMonthYear")]
294    pub fn underlying_maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
295        self.0.get_month_year(Tag(313))
296    }
297
298    /// The `UnderlyingMaturityDay` (314) field.
299    #[doc(alias = "UnderlyingMaturityDay")]
300    pub fn underlying_maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
301        self.0.get_int(Tag(314))
302    }
303
304    /// The `UnderlyingPutOrCall` (315) field.
305    #[doc(alias = "UnderlyingPutOrCall")]
306    pub fn underlying_put_or_call(&self) -> Result<Option<i64>, InvalidValue> {
307        self.0.get_int(Tag(315))
308    }
309
310    /// The `UnderlyingStrikePrice` (316) field.
311    #[doc(alias = "UnderlyingStrikePrice")]
312    pub fn underlying_strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
313        self.0.get_decimal(Tag(316))
314    }
315
316    /// The `UnderlyingOptAttribute` (317) field.
317    #[doc(alias = "UnderlyingOptAttribute")]
318    pub fn underlying_opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
319        self.0.get_str(Tag(317))
320    }
321
322    /// The `UnderlyingContractMultiplier` (436) field.
323    #[doc(alias = "UnderlyingContractMultiplier")]
324    pub fn underlying_contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
325        self.0.get_decimal(Tag(436))
326    }
327
328    /// The `UnderlyingCouponRate` (435) field.
329    #[doc(alias = "UnderlyingCouponRate")]
330    pub fn underlying_coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
331        self.0.get_decimal(Tag(435))
332    }
333
334    /// The `UnderlyingSecurityExchange` (308) field.
335    #[doc(alias = "UnderlyingSecurityExchange")]
336    pub fn underlying_security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
337        self.0.get_str(Tag(308))
338    }
339
340    /// The `UnderlyingIssuer` (306) field.
341    #[doc(alias = "UnderlyingIssuer")]
342    pub fn underlying_issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
343        self.0.get_str(Tag(306))
344    }
345
346    /// The `EncodedUnderlyingIssuerLen` (362) field.
347    #[doc(alias = "EncodedUnderlyingIssuerLen")]
348    pub fn encoded_underlying_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
349        self.0.get_int(Tag(362))
350    }
351
352    /// The `EncodedUnderlyingIssuer` (363) field.
353    #[doc(alias = "EncodedUnderlyingIssuer")]
354    pub fn encoded_underlying_issuer(&self) -> Option<&'a [u8]> {
355        self.0.get(Tag(363))
356    }
357
358    /// The `UnderlyingSecurityDesc` (307) field.
359    #[doc(alias = "UnderlyingSecurityDesc")]
360    pub fn underlying_security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
361        self.0.get_str(Tag(307))
362    }
363
364    /// The `EncodedUnderlyingSecurityDescLen` (364) field.
365    #[doc(alias = "EncodedUnderlyingSecurityDescLen")]
366    pub fn encoded_underlying_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
367        self.0.get_int(Tag(364))
368    }
369
370    /// The `EncodedUnderlyingSecurityDesc` (365) field.
371    #[doc(alias = "EncodedUnderlyingSecurityDesc")]
372    pub fn encoded_underlying_security_desc(&self) -> Option<&'a [u8]> {
373        self.0.get(Tag(365))
374    }
375
376    /// The `RatioQty` (319) field.
377    #[doc(alias = "RatioQty")]
378    pub fn ratio_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
379        self.0.get_decimal(Tag(319))
380    }
381
382    /// The `Side` (54) field.
383    #[doc(alias = "Side")]
384    pub fn side(&self) -> Result<Option<Side<'a>>, InvalidValue> {
385        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
386    }
387
388    /// The `UnderlyingCurrency` (318) field.
389    #[doc(alias = "UnderlyingCurrency")]
390    pub fn underlying_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
391        self.0.get_str(Tag(318))
392    }
393}
394
395impl std::fmt::Debug for SecurityDefinitionRequestRelatedSym<'_> {
396    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
397        write!(f, "SecurityDefinitionRequestRelatedSym({})", self.0)
398    }
399}