Skip to main content

refix_fix42/generated/messages/
dont_know_trade.rs

1// @generated by refix codegen from FIX42.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, InvalidValue, MonthYear, RawMessage, Tag};
5
6use super::super::components::{Header, Trailer};
7use super::super::enums::{DKReason, IDSource, PutOrCall, SecurityType, Side};
8
9/// The `DontKnowTrade` (35=Q) message.
10pub struct DontKnowTrade(RawMessage);
11
12impl DontKnowTrade {
13    pub const MSG_TYPE: &[u8] = b"Q";
14
15    pub fn from_raw(raw: RawMessage) -> Self {
16        Self(raw)
17    }
18
19    pub fn raw(&self) -> &RawMessage {
20        &self.0
21    }
22
23    pub fn header(&self) -> Header<'_> {
24        Header(self.0.scope())
25    }
26
27    pub fn trailer(&self) -> Trailer<'_> {
28        Trailer(self.0.scope())
29    }
30
31    /// The `OrderID` (37) field.
32    #[doc(alias = "OrderID")]
33    pub fn order_id(&self) -> Result<Option<&str>, InvalidValue> {
34        self.0.get_str(Tag(37))
35    }
36
37    /// The `ExecID` (17) field.
38    #[doc(alias = "ExecID")]
39    pub fn exec_id(&self) -> Result<Option<&str>, InvalidValue> {
40        self.0.get_str(Tag(17))
41    }
42
43    /// The `DKReason` (127) field.
44    #[doc(alias = "DKReason")]
45    pub fn dk_reason(&self) -> Result<Option<DKReason<'_>>, InvalidValue> {
46        Ok(self.0.get_str(Tag(127))?.map(DKReason::from_value))
47    }
48
49    /// The `Symbol` (55) field.
50    #[doc(alias = "Symbol")]
51    pub fn symbol(&self) -> Result<Option<&str>, InvalidValue> {
52        self.0.get_str(Tag(55))
53    }
54
55    /// The `SymbolSfx` (65) field.
56    #[doc(alias = "SymbolSfx")]
57    pub fn symbol_sfx(&self) -> Result<Option<&str>, InvalidValue> {
58        self.0.get_str(Tag(65))
59    }
60
61    /// The `SecurityID` (48) field.
62    #[doc(alias = "SecurityID")]
63    pub fn security_id(&self) -> Result<Option<&str>, InvalidValue> {
64        self.0.get_str(Tag(48))
65    }
66
67    /// The `IDSource` (22) field.
68    #[doc(alias = "IDSource")]
69    pub fn id_source(&self) -> Result<Option<IDSource<'_>>, InvalidValue> {
70        Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
71    }
72
73    /// The `SecurityType` (167) field.
74    #[doc(alias = "SecurityType")]
75    pub fn security_type(&self) -> Result<Option<SecurityType<'_>>, InvalidValue> {
76        Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
77    }
78
79    /// The `MaturityMonthYear` (200) field.
80    #[doc(alias = "MaturityMonthYear")]
81    pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
82        self.0.get_month_year(Tag(200))
83    }
84
85    /// The `MaturityDay` (205) field.
86    #[doc(alias = "MaturityDay")]
87    pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
88        self.0.get_int(Tag(205))
89    }
90
91    /// The `PutOrCall` (201) field.
92    #[doc(alias = "PutOrCall")]
93    pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
94        Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
95    }
96
97    /// The `StrikePrice` (202) field.
98    #[doc(alias = "StrikePrice")]
99    pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
100        self.0.get_decimal(Tag(202))
101    }
102
103    /// The `OptAttribute` (206) field.
104    #[doc(alias = "OptAttribute")]
105    pub fn opt_attribute(&self) -> Result<Option<&str>, InvalidValue> {
106        self.0.get_str(Tag(206))
107    }
108
109    /// The `ContractMultiplier` (231) field.
110    #[doc(alias = "ContractMultiplier")]
111    pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
112        self.0.get_decimal(Tag(231))
113    }
114
115    /// The `CouponRate` (223) field.
116    #[doc(alias = "CouponRate")]
117    pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
118        self.0.get_decimal(Tag(223))
119    }
120
121    /// The `SecurityExchange` (207) field.
122    #[doc(alias = "SecurityExchange")]
123    pub fn security_exchange(&self) -> Result<Option<&str>, InvalidValue> {
124        self.0.get_str(Tag(207))
125    }
126
127    /// The `Issuer` (106) field.
128    #[doc(alias = "Issuer")]
129    pub fn issuer(&self) -> Result<Option<&str>, InvalidValue> {
130        self.0.get_str(Tag(106))
131    }
132
133    /// The `EncodedIssuerLen` (348) field.
134    #[doc(alias = "EncodedIssuerLen")]
135    pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
136        self.0.get_int(Tag(348))
137    }
138
139    /// The `EncodedIssuer` (349) field.
140    #[doc(alias = "EncodedIssuer")]
141    pub fn encoded_issuer(&self) -> Option<&[u8]> {
142        self.0.get(Tag(349))
143    }
144
145    /// The `SecurityDesc` (107) field.
146    #[doc(alias = "SecurityDesc")]
147    pub fn security_desc(&self) -> Result<Option<&str>, InvalidValue> {
148        self.0.get_str(Tag(107))
149    }
150
151    /// The `EncodedSecurityDescLen` (350) field.
152    #[doc(alias = "EncodedSecurityDescLen")]
153    pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
154        self.0.get_int(Tag(350))
155    }
156
157    /// The `EncodedSecurityDesc` (351) field.
158    #[doc(alias = "EncodedSecurityDesc")]
159    pub fn encoded_security_desc(&self) -> Option<&[u8]> {
160        self.0.get(Tag(351))
161    }
162
163    /// The `Side` (54) field.
164    #[doc(alias = "Side")]
165    pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
166        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
167    }
168
169    /// The `OrderQty` (38) field.
170    #[doc(alias = "OrderQty")]
171    pub fn order_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
172        self.0.get_decimal(Tag(38))
173    }
174
175    /// The `CashOrderQty` (152) field.
176    #[doc(alias = "CashOrderQty")]
177    pub fn cash_order_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
178        self.0.get_decimal(Tag(152))
179    }
180
181    /// The `LastShares` (32) field.
182    #[doc(alias = "LastShares")]
183    pub fn last_shares(&self) -> Result<Option<Decimal>, InvalidValue> {
184        self.0.get_decimal(Tag(32))
185    }
186
187    /// The `LastPx` (31) field.
188    #[doc(alias = "LastPx")]
189    pub fn last_px(&self) -> Result<Option<Decimal>, InvalidValue> {
190        self.0.get_decimal(Tag(31))
191    }
192
193    /// The `Text` (58) field.
194    #[doc(alias = "Text")]
195    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
196        self.0.get_str(Tag(58))
197    }
198
199    /// The `EncodedTextLen` (354) field.
200    #[doc(alias = "EncodedTextLen")]
201    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
202        self.0.get_int(Tag(354))
203    }
204
205    /// The `EncodedText` (355) field.
206    #[doc(alias = "EncodedText")]
207    pub fn encoded_text(&self) -> Option<&[u8]> {
208        self.0.get(Tag(355))
209    }
210}
211
212impl std::fmt::Debug for DontKnowTrade {
213    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
214        write!(f, "DontKnowTrade({})", self.0)
215    }
216}
217
218impl std::fmt::Display for DontKnowTrade {
219    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
220        std::fmt::Display::fmt(&self.0, f)
221    }
222}