Skip to main content

fixer_fix/fix50sp2/
security_list.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
12
13use jiff::Timestamp;
14
15use crate::field;
16use crate::tag;
17
18/// `SecurityList` is the `fix50sp2` `SecurityList` type, `MsgType` = y.
19pub struct SecurityList {
20    pub message: Message,
21}
22
23impl SecurityList {
24    /// Creates a new `SecurityList` with required fields.
25    pub fn new() -> Self {
26        let mut msg = Message::new();
27        msg.header.set_field(tag::MSG_TYPE, FIXString::from("y".to_string()));
28
29        Self { message: msg }
30    }
31
32    /// Creates a `SecurityList` from an existing `Message`.
33    pub fn from_message(msg: Message) -> Self {
34        Self { message: msg }
35    }
36
37    /// Returns the underlying `Message`.
38    pub fn to_message(self) -> Message {
39        self.message
40    }
41
42
43
44
45    /// Sets `ApplID`, Tag 1180.
46    pub fn set_appl_id(&mut self, v: String) {
47        self.message.body.set_field(tag::APPL_ID, FIXString::from(v));
48    }
49
50    /// Gets `ApplID`, Tag 1180.
51    pub fn get_appl_id(&self) -> Result<String, MessageRejectErrorEnum> {
52        let mut fld = field::ApplIDField::new(String::new());
53        self.message.body.get_field(tag::APPL_ID, &mut fld.0)?;
54        Ok(fld.value().to_string())
55    }
56
57
58    /// Returns true if `ApplID` is present, Tag 1180.
59    pub fn has_appl_id(&self) -> bool {
60        self.message.body.has(tag::APPL_ID)
61    }
62
63
64
65
66    /// Sets `ApplLastSeqNum`, Tag 1350.
67    pub fn set_appl_last_seq_num(&mut self, v: isize) {
68        self.message.body.set_field(tag::APPL_LAST_SEQ_NUM, fixer::fix_int::FIXInt::from(v));
69    }
70
71    /// Gets `ApplLastSeqNum`, Tag 1350.
72    pub fn get_appl_last_seq_num(&self) -> Result<isize, MessageRejectErrorEnum> {
73        let mut fld = field::ApplLastSeqNumField::new(0);
74        self.message.body.get_field(tag::APPL_LAST_SEQ_NUM, &mut fld.0)?;
75        Ok(fld.value())
76    }
77
78
79    /// Returns true if `ApplLastSeqNum` is present, Tag 1350.
80    pub fn has_appl_last_seq_num(&self) -> bool {
81        self.message.body.has(tag::APPL_LAST_SEQ_NUM)
82    }
83
84
85
86
87    /// Sets `ApplResendFlag`, Tag 1352.
88    pub fn set_appl_resend_flag(&mut self, v: bool) {
89        self.message.body.set_field(tag::APPL_RESEND_FLAG, fixer::fix_boolean::FIXBoolean::from(v));
90    }
91
92    /// Gets `ApplResendFlag`, Tag 1352.
93    pub fn get_appl_resend_flag(&self) -> Result<bool, MessageRejectErrorEnum> {
94        let mut fld = field::ApplResendFlagField::new(false);
95        self.message.body.get_field(tag::APPL_RESEND_FLAG, &mut fld.0)?;
96        Ok(fld.value())
97    }
98
99
100    /// Returns true if `ApplResendFlag` is present, Tag 1352.
101    pub fn has_appl_resend_flag(&self) -> bool {
102        self.message.body.has(tag::APPL_RESEND_FLAG)
103    }
104
105
106
107
108    /// Sets `ApplSeqNum`, Tag 1181.
109    pub fn set_appl_seq_num(&mut self, v: isize) {
110        self.message.body.set_field(tag::APPL_SEQ_NUM, fixer::fix_int::FIXInt::from(v));
111    }
112
113    /// Gets `ApplSeqNum`, Tag 1181.
114    pub fn get_appl_seq_num(&self) -> Result<isize, MessageRejectErrorEnum> {
115        let mut fld = field::ApplSeqNumField::new(0);
116        self.message.body.get_field(tag::APPL_SEQ_NUM, &mut fld.0)?;
117        Ok(fld.value())
118    }
119
120
121    /// Returns true if `ApplSeqNum` is present, Tag 1181.
122    pub fn has_appl_seq_num(&self) -> bool {
123        self.message.body.has(tag::APPL_SEQ_NUM)
124    }
125
126
127
128
129    /// Sets `ClearingBusinessDate`, Tag 715.
130    pub fn set_clearing_business_date(&mut self, v: String) {
131        self.message.body.set_field(tag::CLEARING_BUSINESS_DATE, FIXString::from(v));
132    }
133
134    /// Gets `ClearingBusinessDate`, Tag 715.
135    pub fn get_clearing_business_date(&self) -> Result<String, MessageRejectErrorEnum> {
136        let mut fld = field::ClearingBusinessDateField::new(String::new());
137        self.message.body.get_field(tag::CLEARING_BUSINESS_DATE, &mut fld.0)?;
138        Ok(fld.value().to_string())
139    }
140
141
142    /// Returns true if `ClearingBusinessDate` is present, Tag 715.
143    pub fn has_clearing_business_date(&self) -> bool {
144        self.message.body.has(tag::CLEARING_BUSINESS_DATE)
145    }
146
147
148
149
150    /// Sets `EncodedSecurityListDesc`, Tag 1469.
151    pub fn set_encoded_security_list_desc(&mut self, v: String) {
152        self.message.body.set_field(tag::ENCODED_SECURITY_LIST_DESC, FIXString::from(v));
153    }
154
155    /// Gets `EncodedSecurityListDesc`, Tag 1469.
156    pub fn get_encoded_security_list_desc(&self) -> Result<String, MessageRejectErrorEnum> {
157        let mut fld = field::EncodedSecurityListDescField::new(String::new());
158        self.message.body.get_field(tag::ENCODED_SECURITY_LIST_DESC, &mut fld.0)?;
159        Ok(fld.value().to_string())
160    }
161
162
163    /// Returns true if `EncodedSecurityListDesc` is present, Tag 1469.
164    pub fn has_encoded_security_list_desc(&self) -> bool {
165        self.message.body.has(tag::ENCODED_SECURITY_LIST_DESC)
166    }
167
168
169
170
171    /// Sets `EncodedSecurityListDescLen`, Tag 1468.
172    pub fn set_encoded_security_list_desc_len(&mut self, v: isize) {
173        self.message.body.set_field(tag::ENCODED_SECURITY_LIST_DESC_LEN, fixer::fix_int::FIXInt::from(v));
174    }
175
176    /// Gets `EncodedSecurityListDescLen`, Tag 1468.
177    pub fn get_encoded_security_list_desc_len(&self) -> Result<isize, MessageRejectErrorEnum> {
178        let mut fld = field::EncodedSecurityListDescLenField::new(0);
179        self.message.body.get_field(tag::ENCODED_SECURITY_LIST_DESC_LEN, &mut fld.0)?;
180        Ok(fld.value())
181    }
182
183
184    /// Returns true if `EncodedSecurityListDescLen` is present, Tag 1468.
185    pub fn has_encoded_security_list_desc_len(&self) -> bool {
186        self.message.body.has(tag::ENCODED_SECURITY_LIST_DESC_LEN)
187    }
188
189
190
191
192    /// Sets `LastFragment`, Tag 893.
193    pub fn set_last_fragment(&mut self, v: bool) {
194        self.message.body.set_field(tag::LAST_FRAGMENT, fixer::fix_boolean::FIXBoolean::from(v));
195    }
196
197    /// Gets `LastFragment`, Tag 893.
198    pub fn get_last_fragment(&self) -> Result<bool, MessageRejectErrorEnum> {
199        let mut fld = field::LastFragmentField::new(false);
200        self.message.body.get_field(tag::LAST_FRAGMENT, &mut fld.0)?;
201        Ok(fld.value())
202    }
203
204
205    /// Returns true if `LastFragment` is present, Tag 893.
206    pub fn has_last_fragment(&self) -> bool {
207        self.message.body.has(tag::LAST_FRAGMENT)
208    }
209
210
211
212
213    /// Sets `MarketID`, Tag 1301.
214    pub fn set_market_id(&mut self, v: String) {
215        self.message.body.set_field(tag::MARKET_ID, FIXString::from(v));
216    }
217
218    /// Gets `MarketID`, Tag 1301.
219    pub fn get_market_id(&self) -> Result<String, MessageRejectErrorEnum> {
220        let mut fld = field::MarketIDField::new(String::new());
221        self.message.body.get_field(tag::MARKET_ID, &mut fld.0)?;
222        Ok(fld.value().to_string())
223    }
224
225
226    /// Returns true if `MarketID` is present, Tag 1301.
227    pub fn has_market_id(&self) -> bool {
228        self.message.body.has(tag::MARKET_ID)
229    }
230
231
232
233
234    /// Sets `MarketSegmentID`, Tag 1300.
235    pub fn set_market_segment_id(&mut self, v: String) {
236        self.message.body.set_field(tag::MARKET_SEGMENT_ID, FIXString::from(v));
237    }
238
239    /// Gets `MarketSegmentID`, Tag 1300.
240    pub fn get_market_segment_id(&self) -> Result<String, MessageRejectErrorEnum> {
241        let mut fld = field::MarketSegmentIDField::new(String::new());
242        self.message.body.get_field(tag::MARKET_SEGMENT_ID, &mut fld.0)?;
243        Ok(fld.value().to_string())
244    }
245
246
247    /// Returns true if `MarketSegmentID` is present, Tag 1300.
248    pub fn has_market_segment_id(&self) -> bool {
249        self.message.body.has(tag::MARKET_SEGMENT_ID)
250    }
251
252
253
254
255    /// Sets `NoRelatedSym`, Tag 146.
256    pub fn set_no_related_sym(&mut self, v: isize) {
257        self.message.body.set_field(tag::NO_RELATED_SYM, fixer::fix_int::FIXInt::from(v));
258    }
259
260    /// Gets `NoRelatedSym`, Tag 146.
261    pub fn get_no_related_sym(&self) -> Result<isize, MessageRejectErrorEnum> {
262        let mut fld = field::NoRelatedSymField::new(0);
263        self.message.body.get_field(tag::NO_RELATED_SYM, &mut fld.0)?;
264        Ok(fld.value())
265    }
266
267
268    /// Returns true if `NoRelatedSym` is present, Tag 146.
269    pub fn has_no_related_sym(&self) -> bool {
270        self.message.body.has(tag::NO_RELATED_SYM)
271    }
272
273
274
275
276    /// Sets `SecurityListDesc`, Tag 1467.
277    pub fn set_security_list_desc(&mut self, v: String) {
278        self.message.body.set_field(tag::SECURITY_LIST_DESC, FIXString::from(v));
279    }
280
281    /// Gets `SecurityListDesc`, Tag 1467.
282    pub fn get_security_list_desc(&self) -> Result<String, MessageRejectErrorEnum> {
283        let mut fld = field::SecurityListDescField::new(String::new());
284        self.message.body.get_field(tag::SECURITY_LIST_DESC, &mut fld.0)?;
285        Ok(fld.value().to_string())
286    }
287
288
289    /// Returns true if `SecurityListDesc` is present, Tag 1467.
290    pub fn has_security_list_desc(&self) -> bool {
291        self.message.body.has(tag::SECURITY_LIST_DESC)
292    }
293
294
295
296
297    /// Sets `SecurityListID`, Tag 1465.
298    pub fn set_security_list_id(&mut self, v: String) {
299        self.message.body.set_field(tag::SECURITY_LIST_ID, FIXString::from(v));
300    }
301
302    /// Gets `SecurityListID`, Tag 1465.
303    pub fn get_security_list_id(&self) -> Result<String, MessageRejectErrorEnum> {
304        let mut fld = field::SecurityListIDField::new(String::new());
305        self.message.body.get_field(tag::SECURITY_LIST_ID, &mut fld.0)?;
306        Ok(fld.value().to_string())
307    }
308
309
310    /// Returns true if `SecurityListID` is present, Tag 1465.
311    pub fn has_security_list_id(&self) -> bool {
312        self.message.body.has(tag::SECURITY_LIST_ID)
313    }
314
315
316
317
318    /// Sets `SecurityListRefID`, Tag 1466.
319    pub fn set_security_list_ref_id(&mut self, v: String) {
320        self.message.body.set_field(tag::SECURITY_LIST_REF_ID, FIXString::from(v));
321    }
322
323    /// Gets `SecurityListRefID`, Tag 1466.
324    pub fn get_security_list_ref_id(&self) -> Result<String, MessageRejectErrorEnum> {
325        let mut fld = field::SecurityListRefIDField::new(String::new());
326        self.message.body.get_field(tag::SECURITY_LIST_REF_ID, &mut fld.0)?;
327        Ok(fld.value().to_string())
328    }
329
330
331    /// Returns true if `SecurityListRefID` is present, Tag 1466.
332    pub fn has_security_list_ref_id(&self) -> bool {
333        self.message.body.has(tag::SECURITY_LIST_REF_ID)
334    }
335
336
337
338
339    /// Sets `SecurityListType`, Tag 1470.
340    pub fn set_security_list_type(&mut self, v: isize) {
341        self.message.body.set_field(tag::SECURITY_LIST_TYPE, fixer::fix_int::FIXInt::from(v));
342    }
343
344    /// Gets `SecurityListType`, Tag 1470.
345    pub fn get_security_list_type(&self) -> Result<isize, MessageRejectErrorEnum> {
346        let mut fld = field::SecurityListTypeField::new(0);
347        self.message.body.get_field(tag::SECURITY_LIST_TYPE, &mut fld.0)?;
348        Ok(fld.value())
349    }
350
351
352    /// Returns true if `SecurityListType` is present, Tag 1470.
353    pub fn has_security_list_type(&self) -> bool {
354        self.message.body.has(tag::SECURITY_LIST_TYPE)
355    }
356
357
358
359
360    /// Sets `SecurityListTypeSource`, Tag 1471.
361    pub fn set_security_list_type_source(&mut self, v: isize) {
362        self.message.body.set_field(tag::SECURITY_LIST_TYPE_SOURCE, fixer::fix_int::FIXInt::from(v));
363    }
364
365    /// Gets `SecurityListTypeSource`, Tag 1471.
366    pub fn get_security_list_type_source(&self) -> Result<isize, MessageRejectErrorEnum> {
367        let mut fld = field::SecurityListTypeSourceField::new(0);
368        self.message.body.get_field(tag::SECURITY_LIST_TYPE_SOURCE, &mut fld.0)?;
369        Ok(fld.value())
370    }
371
372
373    /// Returns true if `SecurityListTypeSource` is present, Tag 1471.
374    pub fn has_security_list_type_source(&self) -> bool {
375        self.message.body.has(tag::SECURITY_LIST_TYPE_SOURCE)
376    }
377
378
379
380
381    /// Sets `SecurityReportID`, Tag 964.
382    pub fn set_security_report_id(&mut self, v: isize) {
383        self.message.body.set_field(tag::SECURITY_REPORT_ID, fixer::fix_int::FIXInt::from(v));
384    }
385
386    /// Gets `SecurityReportID`, Tag 964.
387    pub fn get_security_report_id(&self) -> Result<isize, MessageRejectErrorEnum> {
388        let mut fld = field::SecurityReportIDField::new(0);
389        self.message.body.get_field(tag::SECURITY_REPORT_ID, &mut fld.0)?;
390        Ok(fld.value())
391    }
392
393
394    /// Returns true if `SecurityReportID` is present, Tag 964.
395    pub fn has_security_report_id(&self) -> bool {
396        self.message.body.has(tag::SECURITY_REPORT_ID)
397    }
398
399
400
401
402    /// Sets `SecurityReqID`, Tag 320.
403    pub fn set_security_req_id(&mut self, v: String) {
404        self.message.body.set_field(tag::SECURITY_REQ_ID, FIXString::from(v));
405    }
406
407    /// Gets `SecurityReqID`, Tag 320.
408    pub fn get_security_req_id(&self) -> Result<String, MessageRejectErrorEnum> {
409        let mut fld = field::SecurityReqIDField::new(String::new());
410        self.message.body.get_field(tag::SECURITY_REQ_ID, &mut fld.0)?;
411        Ok(fld.value().to_string())
412    }
413
414
415    /// Returns true if `SecurityReqID` is present, Tag 320.
416    pub fn has_security_req_id(&self) -> bool {
417        self.message.body.has(tag::SECURITY_REQ_ID)
418    }
419
420
421
422
423    /// Sets `SecurityRequestResult`, Tag 560.
424    pub fn set_security_request_result(&mut self, v: isize) {
425        self.message.body.set_field(tag::SECURITY_REQUEST_RESULT, fixer::fix_int::FIXInt::from(v));
426    }
427
428    /// Gets `SecurityRequestResult`, Tag 560.
429    pub fn get_security_request_result(&self) -> Result<isize, MessageRejectErrorEnum> {
430        let mut fld = field::SecurityRequestResultField::new(0);
431        self.message.body.get_field(tag::SECURITY_REQUEST_RESULT, &mut fld.0)?;
432        Ok(fld.value())
433    }
434
435
436    /// Returns true if `SecurityRequestResult` is present, Tag 560.
437    pub fn has_security_request_result(&self) -> bool {
438        self.message.body.has(tag::SECURITY_REQUEST_RESULT)
439    }
440
441
442
443
444    /// Sets `SecurityResponseID`, Tag 322.
445    pub fn set_security_response_id(&mut self, v: String) {
446        self.message.body.set_field(tag::SECURITY_RESPONSE_ID, FIXString::from(v));
447    }
448
449    /// Gets `SecurityResponseID`, Tag 322.
450    pub fn get_security_response_id(&self) -> Result<String, MessageRejectErrorEnum> {
451        let mut fld = field::SecurityResponseIDField::new(String::new());
452        self.message.body.get_field(tag::SECURITY_RESPONSE_ID, &mut fld.0)?;
453        Ok(fld.value().to_string())
454    }
455
456
457    /// Returns true if `SecurityResponseID` is present, Tag 322.
458    pub fn has_security_response_id(&self) -> bool {
459        self.message.body.has(tag::SECURITY_RESPONSE_ID)
460    }
461
462
463
464
465    /// Sets `TotNoRelatedSym`, Tag 393.
466    pub fn set_tot_no_related_sym(&mut self, v: isize) {
467        self.message.body.set_field(tag::TOT_NO_RELATED_SYM, fixer::fix_int::FIXInt::from(v));
468    }
469
470    /// Gets `TotNoRelatedSym`, Tag 393.
471    pub fn get_tot_no_related_sym(&self) -> Result<isize, MessageRejectErrorEnum> {
472        let mut fld = field::TotNoRelatedSymField::new(0);
473        self.message.body.get_field(tag::TOT_NO_RELATED_SYM, &mut fld.0)?;
474        Ok(fld.value())
475    }
476
477
478    /// Returns true if `TotNoRelatedSym` is present, Tag 393.
479    pub fn has_tot_no_related_sym(&self) -> bool {
480        self.message.body.has(tag::TOT_NO_RELATED_SYM)
481    }
482
483
484
485
486    /// Sets `TransactTime`, Tag 60.
487    pub fn set_transact_time(&mut self, v: Timestamp) {
488        self.message.body.set_field(tag::TRANSACT_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
489            time: v,
490            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
491        });
492    }
493
494    /// Gets `TransactTime`, Tag 60.
495    pub fn get_transact_time(&self) -> Result<Timestamp, MessageRejectErrorEnum> {
496        let mut fld = field::TransactTimeField::new(Timestamp::UNIX_EPOCH);
497        self.message.body.get_field(tag::TRANSACT_TIME, &mut fld.0)?;
498        Ok(fld.value())
499    }
500
501
502    /// Returns true if `TransactTime` is present, Tag 60.
503    pub fn has_transact_time(&self) -> bool {
504        self.message.body.has(tag::TRANSACT_TIME)
505    }
506
507
508}
509
510/// `RouteOut` is the callback type for routing `SecurityList` messages.
511pub type RouteOut = fn(msg: SecurityList, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
512
513/// Route type returned by the `route` function.
514pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
515
516/// Returns the begin string, message type, and route function for `SecurityList`.
517pub fn route(router: RouteOut) -> Route {
518    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
519        router(SecurityList::from_message(msg.clone()), session_id)
520    };
521    ("9", "y", Box::new(r))
522}