Skip to main content

fixer_fix/fix42/
quote_status_request.rs

1// Code generated by fixer-gen. DO NOT EDIT.
2#![allow(clippy::new_without_default)]
3#![allow(clippy::needless_pass_by_value)]
4#![allow(clippy::too_many_arguments)]
5#![allow(unused_imports)]
6
7use fixer::message::Message;
8use fixer::fix_string::FIXString;
9use fixer::errors::MessageRejectErrorEnum;
10use fixer::session::session_id::SessionID;
11
12use rust_decimal::Decimal;
13
14
15use crate::field;
16use crate::tag;
17
18/// `QuoteStatusRequest` is the `fix42` `QuoteStatusRequest` type, `MsgType` = a.
19pub struct QuoteStatusRequest {
20    pub message: Message,
21}
22
23impl QuoteStatusRequest {
24    /// Creates a new `QuoteStatusRequest` with required fields.
25    pub fn new(symbol: field::SymbolField) -> Self {
26        let mut msg = Message::new();
27        msg.header.set_field(tag::MSG_TYPE, FIXString::from("a".to_string()));
28
29        msg.body.set_field(tag::SYMBOL, symbol.0);
30
31        Self { message: msg }
32    }
33
34    /// Creates a `QuoteStatusRequest` from an existing `Message`.
35    pub fn from_message(msg: Message) -> Self {
36        Self { message: msg }
37    }
38
39    /// Returns the underlying `Message`.
40    pub fn to_message(self) -> Message {
41        self.message
42    }
43
44
45
46
47    /// Sets `ContractMultiplier`, Tag 231.
48    pub fn set_contract_multiplier(&mut self, val: Decimal, scale: i32) {
49        self.message.body.set_field(tag::CONTRACT_MULTIPLIER, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
50    }
51
52    /// Gets `ContractMultiplier`, Tag 231.
53    pub fn get_contract_multiplier(&self) -> Result<Decimal, MessageRejectErrorEnum> {
54        let mut fld = field::ContractMultiplierField::new(Decimal::ZERO, 0);
55        self.message.body.get_field(tag::CONTRACT_MULTIPLIER, &mut fld.0)?;
56        Ok(fld.value())
57    }
58
59
60    /// Returns true if `ContractMultiplier` is present, Tag 231.
61    pub fn has_contract_multiplier(&self) -> bool {
62        self.message.body.has(tag::CONTRACT_MULTIPLIER)
63    }
64
65
66
67
68    /// Sets `CouponRate`, Tag 223.
69    pub fn set_coupon_rate(&mut self, val: Decimal, scale: i32) {
70        self.message.body.set_field(tag::COUPON_RATE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
71    }
72
73    /// Gets `CouponRate`, Tag 223.
74    pub fn get_coupon_rate(&self) -> Result<Decimal, MessageRejectErrorEnum> {
75        let mut fld = field::CouponRateField::new(Decimal::ZERO, 0);
76        self.message.body.get_field(tag::COUPON_RATE, &mut fld.0)?;
77        Ok(fld.value())
78    }
79
80
81    /// Returns true if `CouponRate` is present, Tag 223.
82    pub fn has_coupon_rate(&self) -> bool {
83        self.message.body.has(tag::COUPON_RATE)
84    }
85
86
87
88
89    /// Sets `EncodedIssuer`, Tag 349.
90    pub fn set_encoded_issuer(&mut self, v: String) {
91        self.message.body.set_field(tag::ENCODED_ISSUER, FIXString::from(v));
92    }
93
94    /// Gets `EncodedIssuer`, Tag 349.
95    pub fn get_encoded_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
96        let mut fld = field::EncodedIssuerField::new(String::new());
97        self.message.body.get_field(tag::ENCODED_ISSUER, &mut fld.0)?;
98        Ok(fld.value().to_string())
99    }
100
101
102    /// Returns true if `EncodedIssuer` is present, Tag 349.
103    pub fn has_encoded_issuer(&self) -> bool {
104        self.message.body.has(tag::ENCODED_ISSUER)
105    }
106
107
108
109
110    /// Sets `EncodedIssuerLen`, Tag 348.
111    pub fn set_encoded_issuer_len(&mut self, v: isize) {
112        self.message.body.set_field(tag::ENCODED_ISSUER_LEN, fixer::fix_int::FIXInt::from(v));
113    }
114
115    /// Gets `EncodedIssuerLen`, Tag 348.
116    pub fn get_encoded_issuer_len(&self) -> Result<isize, MessageRejectErrorEnum> {
117        let mut fld = field::EncodedIssuerLenField::new(0);
118        self.message.body.get_field(tag::ENCODED_ISSUER_LEN, &mut fld.0)?;
119        Ok(fld.value())
120    }
121
122
123    /// Returns true if `EncodedIssuerLen` is present, Tag 348.
124    pub fn has_encoded_issuer_len(&self) -> bool {
125        self.message.body.has(tag::ENCODED_ISSUER_LEN)
126    }
127
128
129
130
131    /// Sets `EncodedSecurityDesc`, Tag 351.
132    pub fn set_encoded_security_desc(&mut self, v: String) {
133        self.message.body.set_field(tag::ENCODED_SECURITY_DESC, FIXString::from(v));
134    }
135
136    /// Gets `EncodedSecurityDesc`, Tag 351.
137    pub fn get_encoded_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
138        let mut fld = field::EncodedSecurityDescField::new(String::new());
139        self.message.body.get_field(tag::ENCODED_SECURITY_DESC, &mut fld.0)?;
140        Ok(fld.value().to_string())
141    }
142
143
144    /// Returns true if `EncodedSecurityDesc` is present, Tag 351.
145    pub fn has_encoded_security_desc(&self) -> bool {
146        self.message.body.has(tag::ENCODED_SECURITY_DESC)
147    }
148
149
150
151
152    /// Sets `EncodedSecurityDescLen`, Tag 350.
153    pub fn set_encoded_security_desc_len(&mut self, v: isize) {
154        self.message.body.set_field(tag::ENCODED_SECURITY_DESC_LEN, fixer::fix_int::FIXInt::from(v));
155    }
156
157    /// Gets `EncodedSecurityDescLen`, Tag 350.
158    pub fn get_encoded_security_desc_len(&self) -> Result<isize, MessageRejectErrorEnum> {
159        let mut fld = field::EncodedSecurityDescLenField::new(0);
160        self.message.body.get_field(tag::ENCODED_SECURITY_DESC_LEN, &mut fld.0)?;
161        Ok(fld.value())
162    }
163
164
165    /// Returns true if `EncodedSecurityDescLen` is present, Tag 350.
166    pub fn has_encoded_security_desc_len(&self) -> bool {
167        self.message.body.has(tag::ENCODED_SECURITY_DESC_LEN)
168    }
169
170
171
172
173    /// Sets `IDSource`, Tag 22.
174    pub fn set_id_source(&mut self, v: String) {
175        self.message.body.set_field(tag::ID_SOURCE, FIXString::from(v));
176    }
177
178    /// Gets `IDSource`, Tag 22.
179    pub fn get_id_source(&self) -> Result<String, MessageRejectErrorEnum> {
180        let mut fld = field::IDSourceField::new(String::new());
181        self.message.body.get_field(tag::ID_SOURCE, &mut fld.0)?;
182        Ok(fld.value().to_string())
183    }
184
185
186    /// Returns true if `IDSource` is present, Tag 22.
187    pub fn has_id_source(&self) -> bool {
188        self.message.body.has(tag::ID_SOURCE)
189    }
190
191
192
193
194    /// Sets `Issuer`, Tag 106.
195    pub fn set_issuer(&mut self, v: String) {
196        self.message.body.set_field(tag::ISSUER, FIXString::from(v));
197    }
198
199    /// Gets `Issuer`, Tag 106.
200    pub fn get_issuer(&self) -> Result<String, MessageRejectErrorEnum> {
201        let mut fld = field::IssuerField::new(String::new());
202        self.message.body.get_field(tag::ISSUER, &mut fld.0)?;
203        Ok(fld.value().to_string())
204    }
205
206
207    /// Returns true if `Issuer` is present, Tag 106.
208    pub fn has_issuer(&self) -> bool {
209        self.message.body.has(tag::ISSUER)
210    }
211
212
213
214
215    /// Sets `MaturityDay`, Tag 205.
216    pub fn set_maturity_day(&mut self, v: isize) {
217        self.message.body.set_field(tag::MATURITY_DAY, fixer::fix_int::FIXInt::from(v));
218    }
219
220    /// Gets `MaturityDay`, Tag 205.
221    pub fn get_maturity_day(&self) -> Result<isize, MessageRejectErrorEnum> {
222        let mut fld = field::MaturityDayField::new(0);
223        self.message.body.get_field(tag::MATURITY_DAY, &mut fld.0)?;
224        Ok(fld.value())
225    }
226
227
228    /// Returns true if `MaturityDay` is present, Tag 205.
229    pub fn has_maturity_day(&self) -> bool {
230        self.message.body.has(tag::MATURITY_DAY)
231    }
232
233
234
235
236    /// Sets `MaturityMonthYear`, Tag 200.
237    pub fn set_maturity_month_year(&mut self, v: String) {
238        self.message.body.set_field(tag::MATURITY_MONTH_YEAR, FIXString::from(v));
239    }
240
241    /// Gets `MaturityMonthYear`, Tag 200.
242    pub fn get_maturity_month_year(&self) -> Result<String, MessageRejectErrorEnum> {
243        let mut fld = field::MaturityMonthYearField::new(String::new());
244        self.message.body.get_field(tag::MATURITY_MONTH_YEAR, &mut fld.0)?;
245        Ok(fld.value().to_string())
246    }
247
248
249    /// Returns true if `MaturityMonthYear` is present, Tag 200.
250    pub fn has_maturity_month_year(&self) -> bool {
251        self.message.body.has(tag::MATURITY_MONTH_YEAR)
252    }
253
254
255
256
257    /// Sets `OptAttribute`, Tag 206.
258    pub fn set_opt_attribute(&mut self, v: String) {
259        self.message.body.set_field(tag::OPT_ATTRIBUTE, FIXString::from(v));
260    }
261
262    /// Gets `OptAttribute`, Tag 206.
263    pub fn get_opt_attribute(&self) -> Result<String, MessageRejectErrorEnum> {
264        let mut fld = field::OptAttributeField::new(String::new());
265        self.message.body.get_field(tag::OPT_ATTRIBUTE, &mut fld.0)?;
266        Ok(fld.value().to_string())
267    }
268
269
270    /// Returns true if `OptAttribute` is present, Tag 206.
271    pub fn has_opt_attribute(&self) -> bool {
272        self.message.body.has(tag::OPT_ATTRIBUTE)
273    }
274
275
276
277
278    /// Sets `PutOrCall`, Tag 201.
279    pub fn set_put_or_call(&mut self, v: isize) {
280        self.message.body.set_field(tag::PUT_OR_CALL, fixer::fix_int::FIXInt::from(v));
281    }
282
283    /// Gets `PutOrCall`, Tag 201.
284    pub fn get_put_or_call(&self) -> Result<isize, MessageRejectErrorEnum> {
285        let mut fld = field::PutOrCallField::new(0);
286        self.message.body.get_field(tag::PUT_OR_CALL, &mut fld.0)?;
287        Ok(fld.value())
288    }
289
290
291    /// Returns true if `PutOrCall` is present, Tag 201.
292    pub fn has_put_or_call(&self) -> bool {
293        self.message.body.has(tag::PUT_OR_CALL)
294    }
295
296
297
298
299    /// Sets `QuoteID`, Tag 117.
300    pub fn set_quote_id(&mut self, v: String) {
301        self.message.body.set_field(tag::QUOTE_ID, FIXString::from(v));
302    }
303
304    /// Gets `QuoteID`, Tag 117.
305    pub fn get_quote_id(&self) -> Result<String, MessageRejectErrorEnum> {
306        let mut fld = field::QuoteIDField::new(String::new());
307        self.message.body.get_field(tag::QUOTE_ID, &mut fld.0)?;
308        Ok(fld.value().to_string())
309    }
310
311
312    /// Returns true if `QuoteID` is present, Tag 117.
313    pub fn has_quote_id(&self) -> bool {
314        self.message.body.has(tag::QUOTE_ID)
315    }
316
317
318
319
320    /// Sets `SecurityDesc`, Tag 107.
321    pub fn set_security_desc(&mut self, v: String) {
322        self.message.body.set_field(tag::SECURITY_DESC, FIXString::from(v));
323    }
324
325    /// Gets `SecurityDesc`, Tag 107.
326    pub fn get_security_desc(&self) -> Result<String, MessageRejectErrorEnum> {
327        let mut fld = field::SecurityDescField::new(String::new());
328        self.message.body.get_field(tag::SECURITY_DESC, &mut fld.0)?;
329        Ok(fld.value().to_string())
330    }
331
332
333    /// Returns true if `SecurityDesc` is present, Tag 107.
334    pub fn has_security_desc(&self) -> bool {
335        self.message.body.has(tag::SECURITY_DESC)
336    }
337
338
339
340
341    /// Sets `SecurityExchange`, Tag 207.
342    pub fn set_security_exchange(&mut self, v: String) {
343        self.message.body.set_field(tag::SECURITY_EXCHANGE, FIXString::from(v));
344    }
345
346    /// Gets `SecurityExchange`, Tag 207.
347    pub fn get_security_exchange(&self) -> Result<String, MessageRejectErrorEnum> {
348        let mut fld = field::SecurityExchangeField::new(String::new());
349        self.message.body.get_field(tag::SECURITY_EXCHANGE, &mut fld.0)?;
350        Ok(fld.value().to_string())
351    }
352
353
354    /// Returns true if `SecurityExchange` is present, Tag 207.
355    pub fn has_security_exchange(&self) -> bool {
356        self.message.body.has(tag::SECURITY_EXCHANGE)
357    }
358
359
360
361
362    /// Sets `SecurityID`, Tag 48.
363    pub fn set_security_id(&mut self, v: String) {
364        self.message.body.set_field(tag::SECURITY_ID, FIXString::from(v));
365    }
366
367    /// Gets `SecurityID`, Tag 48.
368    pub fn get_security_id(&self) -> Result<String, MessageRejectErrorEnum> {
369        let mut fld = field::SecurityIDField::new(String::new());
370        self.message.body.get_field(tag::SECURITY_ID, &mut fld.0)?;
371        Ok(fld.value().to_string())
372    }
373
374
375    /// Returns true if `SecurityID` is present, Tag 48.
376    pub fn has_security_id(&self) -> bool {
377        self.message.body.has(tag::SECURITY_ID)
378    }
379
380
381
382
383    /// Sets `SecurityType`, Tag 167.
384    pub fn set_security_type(&mut self, v: String) {
385        self.message.body.set_field(tag::SECURITY_TYPE, FIXString::from(v));
386    }
387
388    /// Gets `SecurityType`, Tag 167.
389    pub fn get_security_type(&self) -> Result<String, MessageRejectErrorEnum> {
390        let mut fld = field::SecurityTypeField::new(String::new());
391        self.message.body.get_field(tag::SECURITY_TYPE, &mut fld.0)?;
392        Ok(fld.value().to_string())
393    }
394
395
396    /// Returns true if `SecurityType` is present, Tag 167.
397    pub fn has_security_type(&self) -> bool {
398        self.message.body.has(tag::SECURITY_TYPE)
399    }
400
401
402
403
404    /// Sets `Side`, Tag 54.
405    pub fn set_side(&mut self, v: String) {
406        self.message.body.set_field(tag::SIDE, FIXString::from(v));
407    }
408
409    /// Gets `Side`, Tag 54.
410    pub fn get_side(&self) -> Result<String, MessageRejectErrorEnum> {
411        let mut fld = field::SideField::new(String::new());
412        self.message.body.get_field(tag::SIDE, &mut fld.0)?;
413        Ok(fld.value().to_string())
414    }
415
416
417    /// Returns true if `Side` is present, Tag 54.
418    pub fn has_side(&self) -> bool {
419        self.message.body.has(tag::SIDE)
420    }
421
422
423
424
425    /// Sets `StrikePrice`, Tag 202.
426    pub fn set_strike_price(&mut self, val: Decimal, scale: i32) {
427        self.message.body.set_field(tag::STRIKE_PRICE, fixer::fix_decimal::FIXDecimal { decimal: val, scale });
428    }
429
430    /// Gets `StrikePrice`, Tag 202.
431    pub fn get_strike_price(&self) -> Result<Decimal, MessageRejectErrorEnum> {
432        let mut fld = field::StrikePriceField::new(Decimal::ZERO, 0);
433        self.message.body.get_field(tag::STRIKE_PRICE, &mut fld.0)?;
434        Ok(fld.value())
435    }
436
437
438    /// Returns true if `StrikePrice` is present, Tag 202.
439    pub fn has_strike_price(&self) -> bool {
440        self.message.body.has(tag::STRIKE_PRICE)
441    }
442
443
444
445
446    /// Sets `Symbol`, Tag 55.
447    pub fn set_symbol(&mut self, v: String) {
448        self.message.body.set_field(tag::SYMBOL, FIXString::from(v));
449    }
450
451    /// Gets `Symbol`, Tag 55.
452    pub fn get_symbol(&self) -> Result<String, MessageRejectErrorEnum> {
453        let mut fld = field::SymbolField::new(String::new());
454        self.message.body.get_field(tag::SYMBOL, &mut fld.0)?;
455        Ok(fld.value().to_string())
456    }
457
458
459    /// Returns true if `Symbol` is present, Tag 55.
460    pub fn has_symbol(&self) -> bool {
461        self.message.body.has(tag::SYMBOL)
462    }
463
464
465
466
467    /// Sets `SymbolSfx`, Tag 65.
468    pub fn set_symbol_sfx(&mut self, v: String) {
469        self.message.body.set_field(tag::SYMBOL_SFX, FIXString::from(v));
470    }
471
472    /// Gets `SymbolSfx`, Tag 65.
473    pub fn get_symbol_sfx(&self) -> Result<String, MessageRejectErrorEnum> {
474        let mut fld = field::SymbolSfxField::new(String::new());
475        self.message.body.get_field(tag::SYMBOL_SFX, &mut fld.0)?;
476        Ok(fld.value().to_string())
477    }
478
479
480    /// Returns true if `SymbolSfx` is present, Tag 65.
481    pub fn has_symbol_sfx(&self) -> bool {
482        self.message.body.has(tag::SYMBOL_SFX)
483    }
484
485
486
487
488    /// Sets `TradingSessionID`, Tag 336.
489    pub fn set_trading_session_id(&mut self, v: String) {
490        self.message.body.set_field(tag::TRADING_SESSION_ID, FIXString::from(v));
491    }
492
493    /// Gets `TradingSessionID`, Tag 336.
494    pub fn get_trading_session_id(&self) -> Result<String, MessageRejectErrorEnum> {
495        let mut fld = field::TradingSessionIDField::new(String::new());
496        self.message.body.get_field(tag::TRADING_SESSION_ID, &mut fld.0)?;
497        Ok(fld.value().to_string())
498    }
499
500
501    /// Returns true if `TradingSessionID` is present, Tag 336.
502    pub fn has_trading_session_id(&self) -> bool {
503        self.message.body.has(tag::TRADING_SESSION_ID)
504    }
505
506
507}
508
509/// `RouteOut` is the callback type for routing `QuoteStatusRequest` messages.
510pub type RouteOut = fn(msg: QuoteStatusRequest, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
511
512/// Route type returned by the `route` function.
513pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
514
515/// Returns the begin string, message type, and route function for `QuoteStatusRequest`.
516pub fn route(router: RouteOut) -> Route {
517    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
518        router(QuoteStatusRequest::from_message(msg.clone()), session_id)
519    };
520    ("FIX.4.2", "a", Box::new(r))
521}