refix_fix44/generated/messages/
collateral_report.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Date, Decimal, Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{
7 ExecCollGrp, FinancingDetails, Header, InstrmtLegGrp, Instrument, MiscFeesGrp, Parties,
8 SettlInstructionsData, SpreadOrBenchmarkCurveData, Stipulations, Trailer, TrdCollGrp,
9 TrdRegTimestamps, UndInstrmtGrp,
10};
11use super::super::enums::{AccountType, CollStatus, PriceType, QtyType, SettlSessID, Side};
12
13pub struct CollateralReport(RawMessage);
15
16impl CollateralReport {
17 pub const MSG_TYPE: &[u8] = b"BA";
18
19 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
20 static TAGS: LazyKnownTags = LazyKnownTags::new(
21 &[
22 Tag(908), Tag(909), Tag(910), Tag(911), Tag(912), Tag(453), Tag(1), Tag(581),
23 Tag(11), Tag(37), Tag(198), Tag(526), Tag(124), Tag(897), Tag(64), Tag(53),
24 Tag(854), Tag(15), Tag(555), Tag(711), Tag(899), Tag(900), Tag(901), Tag(768),
25 Tag(54), Tag(136), Tag(44), Tag(423), Tag(159), Tag(920), Tag(921), Tag(922),
26 Tag(232), Tag(336), Tag(625), Tag(716), Tag(717), Tag(715), Tag(58), Tag(354),
27 Tag(355),
28 ],
29 &[
30 Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
31 ExecCollGrp::known_tags(), TrdCollGrp::known_tags(), Instrument::known_tags(),
32 FinancingDetails::known_tags(), InstrmtLegGrp::known_tags(),
33 UndInstrmtGrp::known_tags(), TrdRegTimestamps::known_tags(),
34 MiscFeesGrp::known_tags(), SpreadOrBenchmarkCurveData::known_tags(),
35 Stipulations::known_tags(), SettlInstructionsData::known_tags(),
36 ],
37 );
38 &TAGS
39 }
40
41 pub fn from_raw(raw: RawMessage) -> Self {
42 Self(raw)
43 }
44
45 pub fn raw(&self) -> &RawMessage {
46 &self.0
47 }
48
49 pub fn header(&self) -> Header<'_> {
50 Header(self.0.scope(), Self::known_tags().get())
51 }
52
53 pub fn trailer(&self) -> Trailer<'_> {
54 Trailer(self.0.scope())
55 }
56
57 #[doc(alias = "CollRptID")]
59 pub fn coll_rpt_id(&self) -> Result<Option<&str>, InvalidValue> {
60 self.0.get_str(Tag(908))
61 }
62
63 #[doc(alias = "CollInquiryID")]
65 pub fn coll_inquiry_id(&self) -> Result<Option<&str>, InvalidValue> {
66 self.0.get_str(Tag(909))
67 }
68
69 #[doc(alias = "CollStatus")]
71 pub fn coll_status(&self) -> Result<Option<CollStatus>, InvalidValue> {
72 Ok(self.0.get_int(Tag(910))?.map(CollStatus::from_value))
73 }
74
75 #[doc(alias = "TotNumReports")]
77 pub fn tot_num_reports(&self) -> Result<Option<i64>, InvalidValue> {
78 self.0.get_int(Tag(911))
79 }
80
81 #[doc(alias = "LastRptRequested")]
83 pub fn last_rpt_requested(&self) -> Result<Option<bool>, InvalidValue> {
84 self.0.get_bool(Tag(912))
85 }
86
87 #[doc(alias = "NoPartyIDs")]
89 pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
90 self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
91 }
92
93 #[doc(alias = "Account")]
95 pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
96 self.0.get_str(Tag(1))
97 }
98
99 #[doc(alias = "AccountType")]
101 pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
102 Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
103 }
104
105 #[doc(alias = "ClOrdID")]
107 pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
108 self.0.get_str(Tag(11))
109 }
110
111 #[doc(alias = "OrderID")]
113 pub fn order_id(&self) -> Result<Option<&str>, InvalidValue> {
114 self.0.get_str(Tag(37))
115 }
116
117 #[doc(alias = "SecondaryOrderID")]
119 pub fn secondary_order_id(&self) -> Result<Option<&str>, InvalidValue> {
120 self.0.get_str(Tag(198))
121 }
122
123 #[doc(alias = "SecondaryClOrdID")]
125 pub fn secondary_cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
126 self.0.get_str(Tag(526))
127 }
128
129 #[doc(alias = "NoExecs")]
131 pub fn execs(&self) -> Result<Instances<'_, ExecCollGrp<'_>>, InvalidValue> {
132 self.0.get_group(&ExecCollGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
133 }
134
135 #[doc(alias = "NoTrades")]
137 pub fn trades(&self) -> Result<Instances<'_, TrdCollGrp<'_>>, InvalidValue> {
138 self.0.get_group(&TrdCollGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
139 }
140
141 pub fn instrument(&self) -> Instrument<'_> {
143 Instrument(self.0.scope(), Self::known_tags().get())
144 }
145
146 pub fn financing_details(&self) -> FinancingDetails<'_> {
148 FinancingDetails(self.0.scope())
149 }
150
151 #[doc(alias = "SettlDate")]
153 pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
154 self.0.get_date(Tag(64))
155 }
156
157 #[doc(alias = "Quantity")]
159 pub fn quantity(&self) -> Result<Option<Decimal>, InvalidValue> {
160 self.0.get_decimal(Tag(53))
161 }
162
163 #[doc(alias = "QtyType")]
165 pub fn qty_type(&self) -> Result<Option<QtyType>, InvalidValue> {
166 Ok(self.0.get_int(Tag(854))?.map(QtyType::from_value))
167 }
168
169 #[doc(alias = "Currency")]
171 pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
172 self.0.get_str(Tag(15))
173 }
174
175 #[doc(alias = "NoLegs")]
177 pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
178 self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
179 }
180
181 #[doc(alias = "NoUnderlyings")]
183 pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
184 self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
185 }
186
187 #[doc(alias = "MarginExcess")]
189 pub fn margin_excess(&self) -> Result<Option<Decimal>, InvalidValue> {
190 self.0.get_decimal(Tag(899))
191 }
192
193 #[doc(alias = "TotalNetValue")]
195 pub fn total_net_value(&self) -> Result<Option<Decimal>, InvalidValue> {
196 self.0.get_decimal(Tag(900))
197 }
198
199 #[doc(alias = "CashOutstanding")]
201 pub fn cash_outstanding(&self) -> Result<Option<Decimal>, InvalidValue> {
202 self.0.get_decimal(Tag(901))
203 }
204
205 #[doc(alias = "NoTrdRegTimestamps")]
207 pub fn trd_reg_timestamps(&self) -> Result<Instances<'_, TrdRegTimestamps<'_>>, InvalidValue> {
208 self.0.get_group(&TrdRegTimestamps::TABLE, &Self::known_tags().get()).map(Instances::from)
209 }
210
211 #[doc(alias = "Side")]
213 pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
214 Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
215 }
216
217 #[doc(alias = "NoMiscFees")]
219 pub fn misc_fees(&self) -> Result<Instances<'_, MiscFeesGrp<'_>>, InvalidValue> {
220 self.0.get_group(&MiscFeesGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
221 }
222
223 #[doc(alias = "Price")]
225 pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
226 self.0.get_decimal(Tag(44))
227 }
228
229 #[doc(alias = "PriceType")]
231 pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
232 Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
233 }
234
235 #[doc(alias = "AccruedInterestAmt")]
237 pub fn accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
238 self.0.get_decimal(Tag(159))
239 }
240
241 #[doc(alias = "EndAccruedInterestAmt")]
243 pub fn end_accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
244 self.0.get_decimal(Tag(920))
245 }
246
247 #[doc(alias = "StartCash")]
249 pub fn start_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
250 self.0.get_decimal(Tag(921))
251 }
252
253 #[doc(alias = "EndCash")]
255 pub fn end_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
256 self.0.get_decimal(Tag(922))
257 }
258
259 pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'_> {
261 SpreadOrBenchmarkCurveData(self.0.scope())
262 }
263
264 #[doc(alias = "NoStipulations")]
266 pub fn stipulations(&self) -> Result<Instances<'_, Stipulations<'_>>, InvalidValue> {
267 self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
268 }
269
270 pub fn settl_instructions_data(&self) -> SettlInstructionsData<'_> {
272 SettlInstructionsData(self.0.scope(), Self::known_tags().get())
273 }
274
275 #[doc(alias = "TradingSessionID")]
277 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
278 self.0.get_str(Tag(336))
279 }
280
281 #[doc(alias = "TradingSessionSubID")]
283 pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
284 self.0.get_str(Tag(625))
285 }
286
287 #[doc(alias = "SettlSessID")]
289 pub fn settl_sess_id(&self) -> Result<Option<SettlSessID<'_>>, InvalidValue> {
290 Ok(self.0.get_str(Tag(716))?.map(SettlSessID::from_value))
291 }
292
293 #[doc(alias = "SettlSessSubID")]
295 pub fn settl_sess_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
296 self.0.get_str(Tag(717))
297 }
298
299 #[doc(alias = "ClearingBusinessDate")]
301 pub fn clearing_business_date(&self) -> Result<Option<Date>, InvalidValue> {
302 self.0.get_date(Tag(715))
303 }
304
305 #[doc(alias = "Text")]
307 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
308 self.0.get_str(Tag(58))
309 }
310
311 #[doc(alias = "EncodedTextLen")]
313 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
314 self.0.get_int(Tag(354))
315 }
316
317 #[doc(alias = "EncodedText")]
319 pub fn encoded_text(&self) -> Option<&[u8]> {
320 self.0.get(Tag(355))
321 }
322}
323
324impl std::fmt::Debug for CollateralReport {
325 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
326 write!(f, "CollateralReport({})", self.0)
327 }
328}
329
330impl std::fmt::Display for CollateralReport {
331 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
332 std::fmt::Display::fmt(&self.0, f)
333 }
334}