Skip to main content

fixer_fix/fix50/
security_list_update_report.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/// `SecurityListUpdateReport` is the `fix50` `SecurityListUpdateReport` type, `MsgType` = BK.
17pub struct SecurityListUpdateReport {
18    pub message: Message,
19}
20
21impl SecurityListUpdateReport {
22    /// Creates a new `SecurityListUpdateReport` with required fields.
23    pub fn new() -> Self {
24        let mut msg = Message::new();
25        msg.header.set_field(tag::MSG_TYPE, FIXString::from("BK".to_string()));
26
27        Self { message: msg }
28    }
29
30    /// Creates a `SecurityListUpdateReport` 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 `ClearingBusinessDate`, Tag 715.
44    pub fn set_clearing_business_date(&mut self, v: String) {
45        self.message.body.set_field(tag::CLEARING_BUSINESS_DATE, FIXString::from(v));
46    }
47
48    /// Gets `ClearingBusinessDate`, Tag 715.
49    pub fn get_clearing_business_date(&self) -> Result<String, MessageRejectErrorEnum> {
50        let mut fld = field::ClearingBusinessDateField::new(String::new());
51        self.message.body.get_field(tag::CLEARING_BUSINESS_DATE, &mut fld.0)?;
52        Ok(fld.value().to_string())
53    }
54
55
56    /// Returns true if `ClearingBusinessDate` is present, Tag 715.
57    pub fn has_clearing_business_date(&self) -> bool {
58        self.message.body.has(tag::CLEARING_BUSINESS_DATE)
59    }
60
61
62
63
64    /// Sets `CorporateAction`, Tag 292.
65    pub fn set_corporate_action(&mut self, v: String) {
66        self.message.body.set_field(tag::CORPORATE_ACTION, FIXString::from(v));
67    }
68
69    /// Gets `CorporateAction`, Tag 292.
70    pub fn get_corporate_action(&self) -> Result<String, MessageRejectErrorEnum> {
71        let mut fld = field::CorporateActionField::new(String::new());
72        self.message.body.get_field(tag::CORPORATE_ACTION, &mut fld.0)?;
73        Ok(fld.value().to_string())
74    }
75
76
77    /// Returns true if `CorporateAction` is present, Tag 292.
78    pub fn has_corporate_action(&self) -> bool {
79        self.message.body.has(tag::CORPORATE_ACTION)
80    }
81
82
83
84
85    /// Sets `LastFragment`, Tag 893.
86    pub fn set_last_fragment(&mut self, v: bool) {
87        self.message.body.set_field(tag::LAST_FRAGMENT, fixer::fix_boolean::FIXBoolean::from(v));
88    }
89
90    /// Gets `LastFragment`, Tag 893.
91    pub fn get_last_fragment(&self) -> Result<bool, MessageRejectErrorEnum> {
92        let mut fld = field::LastFragmentField::new(false);
93        self.message.body.get_field(tag::LAST_FRAGMENT, &mut fld.0)?;
94        Ok(fld.value())
95    }
96
97
98    /// Returns true if `LastFragment` is present, Tag 893.
99    pub fn has_last_fragment(&self) -> bool {
100        self.message.body.has(tag::LAST_FRAGMENT)
101    }
102
103
104
105
106    /// Sets `NoRelatedSym`, Tag 146.
107    pub fn set_no_related_sym(&mut self, v: isize) {
108        self.message.body.set_field(tag::NO_RELATED_SYM, fixer::fix_int::FIXInt::from(v));
109    }
110
111    /// Gets `NoRelatedSym`, Tag 146.
112    pub fn get_no_related_sym(&self) -> Result<isize, MessageRejectErrorEnum> {
113        let mut fld = field::NoRelatedSymField::new(0);
114        self.message.body.get_field(tag::NO_RELATED_SYM, &mut fld.0)?;
115        Ok(fld.value())
116    }
117
118
119    /// Returns true if `NoRelatedSym` is present, Tag 146.
120    pub fn has_no_related_sym(&self) -> bool {
121        self.message.body.has(tag::NO_RELATED_SYM)
122    }
123
124
125
126
127    /// Sets `SecurityReportID`, Tag 964.
128    pub fn set_security_report_id(&mut self, v: isize) {
129        self.message.body.set_field(tag::SECURITY_REPORT_ID, fixer::fix_int::FIXInt::from(v));
130    }
131
132    /// Gets `SecurityReportID`, Tag 964.
133    pub fn get_security_report_id(&self) -> Result<isize, MessageRejectErrorEnum> {
134        let mut fld = field::SecurityReportIDField::new(0);
135        self.message.body.get_field(tag::SECURITY_REPORT_ID, &mut fld.0)?;
136        Ok(fld.value())
137    }
138
139
140    /// Returns true if `SecurityReportID` is present, Tag 964.
141    pub fn has_security_report_id(&self) -> bool {
142        self.message.body.has(tag::SECURITY_REPORT_ID)
143    }
144
145
146
147
148    /// Sets `SecurityReqID`, Tag 320.
149    pub fn set_security_req_id(&mut self, v: String) {
150        self.message.body.set_field(tag::SECURITY_REQ_ID, FIXString::from(v));
151    }
152
153    /// Gets `SecurityReqID`, Tag 320.
154    pub fn get_security_req_id(&self) -> Result<String, MessageRejectErrorEnum> {
155        let mut fld = field::SecurityReqIDField::new(String::new());
156        self.message.body.get_field(tag::SECURITY_REQ_ID, &mut fld.0)?;
157        Ok(fld.value().to_string())
158    }
159
160
161    /// Returns true if `SecurityReqID` is present, Tag 320.
162    pub fn has_security_req_id(&self) -> bool {
163        self.message.body.has(tag::SECURITY_REQ_ID)
164    }
165
166
167
168
169    /// Sets `SecurityRequestResult`, Tag 560.
170    pub fn set_security_request_result(&mut self, v: isize) {
171        self.message.body.set_field(tag::SECURITY_REQUEST_RESULT, fixer::fix_int::FIXInt::from(v));
172    }
173
174    /// Gets `SecurityRequestResult`, Tag 560.
175    pub fn get_security_request_result(&self) -> Result<isize, MessageRejectErrorEnum> {
176        let mut fld = field::SecurityRequestResultField::new(0);
177        self.message.body.get_field(tag::SECURITY_REQUEST_RESULT, &mut fld.0)?;
178        Ok(fld.value())
179    }
180
181
182    /// Returns true if `SecurityRequestResult` is present, Tag 560.
183    pub fn has_security_request_result(&self) -> bool {
184        self.message.body.has(tag::SECURITY_REQUEST_RESULT)
185    }
186
187
188
189
190    /// Sets `SecurityResponseID`, Tag 322.
191    pub fn set_security_response_id(&mut self, v: String) {
192        self.message.body.set_field(tag::SECURITY_RESPONSE_ID, FIXString::from(v));
193    }
194
195    /// Gets `SecurityResponseID`, Tag 322.
196    pub fn get_security_response_id(&self) -> Result<String, MessageRejectErrorEnum> {
197        let mut fld = field::SecurityResponseIDField::new(String::new());
198        self.message.body.get_field(tag::SECURITY_RESPONSE_ID, &mut fld.0)?;
199        Ok(fld.value().to_string())
200    }
201
202
203    /// Returns true if `SecurityResponseID` is present, Tag 322.
204    pub fn has_security_response_id(&self) -> bool {
205        self.message.body.has(tag::SECURITY_RESPONSE_ID)
206    }
207
208
209
210
211    /// Sets `SecurityUpdateAction`, Tag 980.
212    pub fn set_security_update_action(&mut self, v: String) {
213        self.message.body.set_field(tag::SECURITY_UPDATE_ACTION, FIXString::from(v));
214    }
215
216    /// Gets `SecurityUpdateAction`, Tag 980.
217    pub fn get_security_update_action(&self) -> Result<String, MessageRejectErrorEnum> {
218        let mut fld = field::SecurityUpdateActionField::new(String::new());
219        self.message.body.get_field(tag::SECURITY_UPDATE_ACTION, &mut fld.0)?;
220        Ok(fld.value().to_string())
221    }
222
223
224    /// Returns true if `SecurityUpdateAction` is present, Tag 980.
225    pub fn has_security_update_action(&self) -> bool {
226        self.message.body.has(tag::SECURITY_UPDATE_ACTION)
227    }
228
229
230
231
232    /// Sets `TotNoRelatedSym`, Tag 393.
233    pub fn set_tot_no_related_sym(&mut self, v: isize) {
234        self.message.body.set_field(tag::TOT_NO_RELATED_SYM, fixer::fix_int::FIXInt::from(v));
235    }
236
237    /// Gets `TotNoRelatedSym`, Tag 393.
238    pub fn get_tot_no_related_sym(&self) -> Result<isize, MessageRejectErrorEnum> {
239        let mut fld = field::TotNoRelatedSymField::new(0);
240        self.message.body.get_field(tag::TOT_NO_RELATED_SYM, &mut fld.0)?;
241        Ok(fld.value())
242    }
243
244
245    /// Returns true if `TotNoRelatedSym` is present, Tag 393.
246    pub fn has_tot_no_related_sym(&self) -> bool {
247        self.message.body.has(tag::TOT_NO_RELATED_SYM)
248    }
249
250
251}
252
253/// `RouteOut` is the callback type for routing `SecurityListUpdateReport` messages.
254pub type RouteOut = fn(msg: SecurityListUpdateReport, session_id: SessionID) -> Result<(), MessageRejectErrorEnum>;
255
256/// Route type returned by the `route` function.
257pub type Route = (&'static str, &'static str, Box<dyn Fn(&Message, SessionID) -> Result<(), MessageRejectErrorEnum> + Send>);
258
259/// Returns the begin string, message type, and route function for `SecurityListUpdateReport`.
260pub fn route(router: RouteOut) -> Route {
261    let r = move |msg: &Message, session_id: SessionID| -> Result<(), MessageRejectErrorEnum> {
262        router(SecurityListUpdateReport::from_message(msg.clone()), session_id)
263    };
264    ("7", "BK", Box::new(r))
265}