Skip to main content

fixer_fix/fix50sp1/
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 crate::field;
14use crate::tag;
15
16/// `SecurityList` is the `fix50sp1` `SecurityList` type, `MsgType` = y.
17pub struct SecurityList {
18    pub message: Message,
19}
20
21impl SecurityList {
22    /// Creates a new `SecurityList` with required fields.
23    pub fn new() -> Self {
24        let mut msg = Message::new();
25        msg.header.set_field(tag::MSG_TYPE, FIXString::from("y".to_string()));
26
27        Self { message: msg }
28    }
29
30    /// Creates a `SecurityList` from an existing `Message`.
31    pub fn from_message(msg: Message) -> Self {
32        Self { message: msg }
33    }
34
35    /// Returns the underlying `Message`.
36    pub fn to_message(self) -> Message {
37        self.message
38    }
39
40
41
42
43    /// Sets `ApplID`, Tag 1180.
44    pub fn set_appl_id(&mut self, v: String) {
45        self.message.body.set_field(tag::APPL_ID, FIXString::from(v));
46    }
47
48    /// Gets `ApplID`, Tag 1180.
49    pub fn get_appl_id(&self) -> Result<String, MessageRejectErrorEnum> {
50        let mut fld = field::ApplIDField::new(String::new());
51        self.message.body.get_field(tag::APPL_ID, &mut fld.0)?;
52        Ok(fld.value().to_string())
53    }
54
55
56    /// Returns true if `ApplID` is present, Tag 1180.
57    pub fn has_appl_id(&self) -> bool {
58        self.message.body.has(tag::APPL_ID)
59    }
60
61
62
63
64    /// Sets `ApplLastSeqNum`, Tag 1350.
65    pub fn set_appl_last_seq_num(&mut self, v: isize) {
66        self.message.body.set_field(tag::APPL_LAST_SEQ_NUM, fixer::fix_int::FIXInt::from(v));
67    }
68
69    /// Gets `ApplLastSeqNum`, Tag 1350.
70    pub fn get_appl_last_seq_num(&self) -> Result<isize, MessageRejectErrorEnum> {
71        let mut fld = field::ApplLastSeqNumField::new(0);
72        self.message.body.get_field(tag::APPL_LAST_SEQ_NUM, &mut fld.0)?;
73        Ok(fld.value())
74    }
75
76
77    /// Returns true if `ApplLastSeqNum` is present, Tag 1350.
78    pub fn has_appl_last_seq_num(&self) -> bool {
79        self.message.body.has(tag::APPL_LAST_SEQ_NUM)
80    }
81
82
83
84
85    /// Sets `ApplResendFlag`, Tag 1352.
86    pub fn set_appl_resend_flag(&mut self, v: bool) {
87        self.message.body.set_field(tag::APPL_RESEND_FLAG, fixer::fix_boolean::FIXBoolean::from(v));
88    }
89
90    /// Gets `ApplResendFlag`, Tag 1352.
91    pub fn get_appl_resend_flag(&self) -> Result<bool, MessageRejectErrorEnum> {
92        let mut fld = field::ApplResendFlagField::new(false);
93        self.message.body.get_field(tag::APPL_RESEND_FLAG, &mut fld.0)?;
94        Ok(fld.value())
95    }
96
97
98    /// Returns true if `ApplResendFlag` is present, Tag 1352.
99    pub fn has_appl_resend_flag(&self) -> bool {
100        self.message.body.has(tag::APPL_RESEND_FLAG)
101    }
102
103
104
105
106    /// Sets `ApplSeqNum`, Tag 1181.
107    pub fn set_appl_seq_num(&mut self, v: isize) {
108        self.message.body.set_field(tag::APPL_SEQ_NUM, fixer::fix_int::FIXInt::from(v));
109    }
110
111    /// Gets `ApplSeqNum`, Tag 1181.
112    pub fn get_appl_seq_num(&self) -> Result<isize, MessageRejectErrorEnum> {
113        let mut fld = field::ApplSeqNumField::new(0);
114        self.message.body.get_field(tag::APPL_SEQ_NUM, &mut fld.0)?;
115        Ok(fld.value())
116    }
117
118
119    /// Returns true if `ApplSeqNum` is present, Tag 1181.
120    pub fn has_appl_seq_num(&self) -> bool {
121        self.message.body.has(tag::APPL_SEQ_NUM)
122    }
123
124
125
126
127    /// Sets `ClearingBusinessDate`, Tag 715.
128    pub fn set_clearing_business_date(&mut self, v: String) {
129        self.message.body.set_field(tag::CLEARING_BUSINESS_DATE, FIXString::from(v));
130    }
131
132    /// Gets `ClearingBusinessDate`, Tag 715.
133    pub fn get_clearing_business_date(&self) -> Result<String, MessageRejectErrorEnum> {
134        let mut fld = field::ClearingBusinessDateField::new(String::new());
135        self.message.body.get_field(tag::CLEARING_BUSINESS_DATE, &mut fld.0)?;
136        Ok(fld.value().to_string())
137    }
138
139
140    /// Returns true if `ClearingBusinessDate` is present, Tag 715.
141    pub fn has_clearing_business_date(&self) -> bool {
142        self.message.body.has(tag::CLEARING_BUSINESS_DATE)
143    }
144
145
146
147
148    /// Sets `LastFragment`, Tag 893.
149    pub fn set_last_fragment(&mut self, v: bool) {
150        self.message.body.set_field(tag::LAST_FRAGMENT, fixer::fix_boolean::FIXBoolean::from(v));
151    }
152
153    /// Gets `LastFragment`, Tag 893.
154    pub fn get_last_fragment(&self) -> Result<bool, MessageRejectErrorEnum> {
155        let mut fld = field::LastFragmentField::new(false);
156        self.message.body.get_field(tag::LAST_FRAGMENT, &mut fld.0)?;
157        Ok(fld.value())
158    }
159
160
161    /// Returns true if `LastFragment` is present, Tag 893.
162    pub fn has_last_fragment(&self) -> bool {
163        self.message.body.has(tag::LAST_FRAGMENT)
164    }
165
166
167
168
169    /// Sets `MarketID`, Tag 1301.
170    pub fn set_market_id(&mut self, v: String) {
171        self.message.body.set_field(tag::MARKET_ID, FIXString::from(v));
172    }
173
174    /// Gets `MarketID`, Tag 1301.
175    pub fn get_market_id(&self) -> Result<String, MessageRejectErrorEnum> {
176        let mut fld = field::MarketIDField::new(String::new());
177        self.message.body.get_field(tag::MARKET_ID, &mut fld.0)?;
178        Ok(fld.value().to_string())
179    }
180
181
182    /// Returns true if `MarketID` is present, Tag 1301.
183    pub fn has_market_id(&self) -> bool {
184        self.message.body.has(tag::MARKET_ID)
185    }
186
187
188
189
190    /// Sets `MarketSegmentID`, Tag 1300.
191    pub fn set_market_segment_id(&mut self, v: String) {
192        self.message.body.set_field(tag::MARKET_SEGMENT_ID, FIXString::from(v));
193    }
194
195    /// Gets `MarketSegmentID`, Tag 1300.
196    pub fn get_market_segment_id(&self) -> Result<String, MessageRejectErrorEnum> {
197        let mut fld = field::MarketSegmentIDField::new(String::new());
198        self.message.body.get_field(tag::MARKET_SEGMENT_ID, &mut fld.0)?;
199        Ok(fld.value().to_string())
200    }
201
202
203    /// Returns true if `MarketSegmentID` is present, Tag 1300.
204    pub fn has_market_segment_id(&self) -> bool {
205        self.message.body.has(tag::MARKET_SEGMENT_ID)
206    }
207
208
209
210
211    /// Sets `NoRelatedSym`, Tag 146.
212    pub fn set_no_related_sym(&mut self, v: isize) {
213        self.message.body.set_field(tag::NO_RELATED_SYM, fixer::fix_int::FIXInt::from(v));
214    }
215
216    /// Gets `NoRelatedSym`, Tag 146.
217    pub fn get_no_related_sym(&self) -> Result<isize, MessageRejectErrorEnum> {
218        let mut fld = field::NoRelatedSymField::new(0);
219        self.message.body.get_field(tag::NO_RELATED_SYM, &mut fld.0)?;
220        Ok(fld.value())
221    }
222
223
224    /// Returns true if `NoRelatedSym` is present, Tag 146.
225    pub fn has_no_related_sym(&self) -> bool {
226        self.message.body.has(tag::NO_RELATED_SYM)
227    }
228
229
230
231
232    /// Sets `SecurityReportID`, Tag 964.
233    pub fn set_security_report_id(&mut self, v: isize) {
234        self.message.body.set_field(tag::SECURITY_REPORT_ID, fixer::fix_int::FIXInt::from(v));
235    }
236
237    /// Gets `SecurityReportID`, Tag 964.
238    pub fn get_security_report_id(&self) -> Result<isize, MessageRejectErrorEnum> {
239        let mut fld = field::SecurityReportIDField::new(0);
240        self.message.body.get_field(tag::SECURITY_REPORT_ID, &mut fld.0)?;
241        Ok(fld.value())
242    }
243
244
245    /// Returns true if `SecurityReportID` is present, Tag 964.
246    pub fn has_security_report_id(&self) -> bool {
247        self.message.body.has(tag::SECURITY_REPORT_ID)
248    }
249
250
251
252
253    /// Sets `SecurityReqID`, Tag 320.
254    pub fn set_security_req_id(&mut self, v: String) {
255        self.message.body.set_field(tag::SECURITY_REQ_ID, FIXString::from(v));
256    }
257
258    /// Gets `SecurityReqID`, Tag 320.
259    pub fn get_security_req_id(&self) -> Result<String, MessageRejectErrorEnum> {
260        let mut fld = field::SecurityReqIDField::new(String::new());
261        self.message.body.get_field(tag::SECURITY_REQ_ID, &mut fld.0)?;
262        Ok(fld.value().to_string())
263    }
264
265
266    /// Returns true if `SecurityReqID` is present, Tag 320.
267    pub fn has_security_req_id(&self) -> bool {
268        self.message.body.has(tag::SECURITY_REQ_ID)
269    }
270
271
272
273
274    /// Sets `SecurityRequestResult`, Tag 560.
275    pub fn set_security_request_result(&mut self, v: isize) {
276        self.message.body.set_field(tag::SECURITY_REQUEST_RESULT, fixer::fix_int::FIXInt::from(v));
277    }
278
279    /// Gets `SecurityRequestResult`, Tag 560.
280    pub fn get_security_request_result(&self) -> Result<isize, MessageRejectErrorEnum> {
281        let mut fld = field::SecurityRequestResultField::new(0);
282        self.message.body.get_field(tag::SECURITY_REQUEST_RESULT, &mut fld.0)?;
283        Ok(fld.value())
284    }
285
286
287    /// Returns true if `SecurityRequestResult` is present, Tag 560.
288    pub fn has_security_request_result(&self) -> bool {
289        self.message.body.has(tag::SECURITY_REQUEST_RESULT)
290    }
291
292
293
294
295    /// Sets `SecurityResponseID`, Tag 322.
296    pub fn set_security_response_id(&mut self, v: String) {
297        self.message.body.set_field(tag::SECURITY_RESPONSE_ID, FIXString::from(v));
298    }
299
300    /// Gets `SecurityResponseID`, Tag 322.
301    pub fn get_security_response_id(&self) -> Result<String, MessageRejectErrorEnum> {
302        let mut fld = field::SecurityResponseIDField::new(String::new());
303        self.message.body.get_field(tag::SECURITY_RESPONSE_ID, &mut fld.0)?;
304        Ok(fld.value().to_string())
305    }
306
307
308    /// Returns true if `SecurityResponseID` is present, Tag 322.
309    pub fn has_security_response_id(&self) -> bool {
310        self.message.body.has(tag::SECURITY_RESPONSE_ID)
311    }
312
313
314
315
316    /// Sets `TotNoRelatedSym`, Tag 393.
317    pub fn set_tot_no_related_sym(&mut self, v: isize) {
318        self.message.body.set_field(tag::TOT_NO_RELATED_SYM, fixer::fix_int::FIXInt::from(v));
319    }
320
321    /// Gets `TotNoRelatedSym`, Tag 393.
322    pub fn get_tot_no_related_sym(&self) -> Result<isize, MessageRejectErrorEnum> {
323        let mut fld = field::TotNoRelatedSymField::new(0);
324        self.message.body.get_field(tag::TOT_NO_RELATED_SYM, &mut fld.0)?;
325        Ok(fld.value())
326    }
327
328
329    /// Returns true if `TotNoRelatedSym` is present, Tag 393.
330    pub fn has_tot_no_related_sym(&self) -> bool {
331        self.message.body.has(tag::TOT_NO_RELATED_SYM)
332    }
333
334
335}
336
337/// `RouteOut` is the callback type for routing `SecurityList` messages.
338pub type RouteOut = fn(msg: SecurityList, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
339
340/// Route type returned by the `route` function.
341pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
342
343/// Returns the begin string, message type, and route function for `SecurityList`.
344pub fn route(router: RouteOut) -> Route {
345    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
346        router(SecurityList::from_message(msg.clone()), session_id)
347    };
348    ("8", "y", Box::new(r))
349}