refix_fix44/generated/messages/
collateral_assignment.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{
5 Date, Decimal, Instances, InvalidValue, LazyKnownTags, RawMessage, Tag, UtcTimestamp,
6};
7
8use super::super::components::{
9 ExecCollGrp, FinancingDetails, Header, InstrmtLegGrp, Instrument, MiscFeesGrp, Parties,
10 SettlInstructionsData, SpreadOrBenchmarkCurveData, Stipulations, Trailer, TrdCollGrp,
11 TrdRegTimestamps, UndInstrmtCollGrp,
12};
13use super::super::enums::{
14 AccountType, CollAsgnReason, CollAsgnTransType, PriceType, QtyType, SettlSessID, Side,
15};
16
17pub struct CollateralAssignment(RawMessage);
19
20impl CollateralAssignment {
21 pub const MSG_TYPE: &[u8] = b"AY";
22
23 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
24 static TAGS: LazyKnownTags = LazyKnownTags::new(
25 &[
26 Tag(902), Tag(894), Tag(895), Tag(903), Tag(907), Tag(60), Tag(126), Tag(453),
27 Tag(1), Tag(581), Tag(11), Tag(37), Tag(198), Tag(526), Tag(124), Tag(897), Tag(64),
28 Tag(53), Tag(854), Tag(15), Tag(555), Tag(711), Tag(899), Tag(900), Tag(901),
29 Tag(768), Tag(54), Tag(136), Tag(44), Tag(423), Tag(159), Tag(920), Tag(921),
30 Tag(922), Tag(232), Tag(336), Tag(625), Tag(716), Tag(717), Tag(715), Tag(58),
31 Tag(354), Tag(355),
32 ],
33 &[
34 Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
35 ExecCollGrp::known_tags(), TrdCollGrp::known_tags(), Instrument::known_tags(),
36 FinancingDetails::known_tags(), InstrmtLegGrp::known_tags(),
37 UndInstrmtCollGrp::known_tags(), TrdRegTimestamps::known_tags(),
38 MiscFeesGrp::known_tags(), SpreadOrBenchmarkCurveData::known_tags(),
39 Stipulations::known_tags(), SettlInstructionsData::known_tags(),
40 ],
41 );
42 &TAGS
43 }
44
45 pub fn from_raw(raw: RawMessage) -> Self {
46 Self(raw)
47 }
48
49 pub fn raw(&self) -> &RawMessage {
50 &self.0
51 }
52
53 pub fn header(&self) -> Header<'_> {
54 Header(self.0.scope(), Self::known_tags().get())
55 }
56
57 pub fn trailer(&self) -> Trailer<'_> {
58 Trailer(self.0.scope())
59 }
60
61 #[doc(alias = "CollAsgnID")]
63 pub fn coll_asgn_id(&self) -> Result<Option<&str>, InvalidValue> {
64 self.0.get_str(Tag(902))
65 }
66
67 #[doc(alias = "CollReqID")]
69 pub fn coll_req_id(&self) -> Result<Option<&str>, InvalidValue> {
70 self.0.get_str(Tag(894))
71 }
72
73 #[doc(alias = "CollAsgnReason")]
75 pub fn coll_asgn_reason(&self) -> Result<Option<CollAsgnReason>, InvalidValue> {
76 Ok(self.0.get_int(Tag(895))?.map(CollAsgnReason::from_value))
77 }
78
79 #[doc(alias = "CollAsgnTransType")]
81 pub fn coll_asgn_trans_type(&self) -> Result<Option<CollAsgnTransType>, InvalidValue> {
82 Ok(self.0.get_int(Tag(903))?.map(CollAsgnTransType::from_value))
83 }
84
85 #[doc(alias = "CollAsgnRefID")]
87 pub fn coll_asgn_ref_id(&self) -> Result<Option<&str>, InvalidValue> {
88 self.0.get_str(Tag(907))
89 }
90
91 #[doc(alias = "TransactTime")]
93 pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
94 self.0.get_utc_timestamp(Tag(60))
95 }
96
97 #[doc(alias = "ExpireTime")]
99 pub fn expire_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
100 self.0.get_utc_timestamp(Tag(126))
101 }
102
103 #[doc(alias = "NoPartyIDs")]
105 pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
106 self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
107 }
108
109 #[doc(alias = "Account")]
111 pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
112 self.0.get_str(Tag(1))
113 }
114
115 #[doc(alias = "AccountType")]
117 pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
118 Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
119 }
120
121 #[doc(alias = "ClOrdID")]
123 pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
124 self.0.get_str(Tag(11))
125 }
126
127 #[doc(alias = "OrderID")]
129 pub fn order_id(&self) -> Result<Option<&str>, InvalidValue> {
130 self.0.get_str(Tag(37))
131 }
132
133 #[doc(alias = "SecondaryOrderID")]
135 pub fn secondary_order_id(&self) -> Result<Option<&str>, InvalidValue> {
136 self.0.get_str(Tag(198))
137 }
138
139 #[doc(alias = "SecondaryClOrdID")]
141 pub fn secondary_cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
142 self.0.get_str(Tag(526))
143 }
144
145 #[doc(alias = "NoExecs")]
147 pub fn execs(&self) -> Result<Instances<'_, ExecCollGrp<'_>>, InvalidValue> {
148 self.0.get_group(&ExecCollGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
149 }
150
151 #[doc(alias = "NoTrades")]
153 pub fn trades(&self) -> Result<Instances<'_, TrdCollGrp<'_>>, InvalidValue> {
154 self.0.get_group(&TrdCollGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
155 }
156
157 pub fn instrument(&self) -> Instrument<'_> {
159 Instrument(self.0.scope(), Self::known_tags().get())
160 }
161
162 pub fn financing_details(&self) -> FinancingDetails<'_> {
164 FinancingDetails(self.0.scope())
165 }
166
167 #[doc(alias = "SettlDate")]
169 pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
170 self.0.get_date(Tag(64))
171 }
172
173 #[doc(alias = "Quantity")]
175 pub fn quantity(&self) -> Result<Option<Decimal>, InvalidValue> {
176 self.0.get_decimal(Tag(53))
177 }
178
179 #[doc(alias = "QtyType")]
181 pub fn qty_type(&self) -> Result<Option<QtyType>, InvalidValue> {
182 Ok(self.0.get_int(Tag(854))?.map(QtyType::from_value))
183 }
184
185 #[doc(alias = "Currency")]
187 pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
188 self.0.get_str(Tag(15))
189 }
190
191 #[doc(alias = "NoLegs")]
193 pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
194 self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
195 }
196
197 #[doc(alias = "NoUnderlyings")]
199 pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtCollGrp<'_>>, InvalidValue> {
200 self.0.get_group(&UndInstrmtCollGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
201 }
202
203 #[doc(alias = "MarginExcess")]
205 pub fn margin_excess(&self) -> Result<Option<Decimal>, InvalidValue> {
206 self.0.get_decimal(Tag(899))
207 }
208
209 #[doc(alias = "TotalNetValue")]
211 pub fn total_net_value(&self) -> Result<Option<Decimal>, InvalidValue> {
212 self.0.get_decimal(Tag(900))
213 }
214
215 #[doc(alias = "CashOutstanding")]
217 pub fn cash_outstanding(&self) -> Result<Option<Decimal>, InvalidValue> {
218 self.0.get_decimal(Tag(901))
219 }
220
221 #[doc(alias = "NoTrdRegTimestamps")]
223 pub fn trd_reg_timestamps(&self) -> Result<Instances<'_, TrdRegTimestamps<'_>>, InvalidValue> {
224 self.0.get_group(&TrdRegTimestamps::TABLE, &Self::known_tags().get()).map(Instances::from)
225 }
226
227 #[doc(alias = "Side")]
229 pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
230 Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
231 }
232
233 #[doc(alias = "NoMiscFees")]
235 pub fn misc_fees(&self) -> Result<Instances<'_, MiscFeesGrp<'_>>, InvalidValue> {
236 self.0.get_group(&MiscFeesGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
237 }
238
239 #[doc(alias = "Price")]
241 pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
242 self.0.get_decimal(Tag(44))
243 }
244
245 #[doc(alias = "PriceType")]
247 pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
248 Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
249 }
250
251 #[doc(alias = "AccruedInterestAmt")]
253 pub fn accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
254 self.0.get_decimal(Tag(159))
255 }
256
257 #[doc(alias = "EndAccruedInterestAmt")]
259 pub fn end_accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
260 self.0.get_decimal(Tag(920))
261 }
262
263 #[doc(alias = "StartCash")]
265 pub fn start_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
266 self.0.get_decimal(Tag(921))
267 }
268
269 #[doc(alias = "EndCash")]
271 pub fn end_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
272 self.0.get_decimal(Tag(922))
273 }
274
275 pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'_> {
277 SpreadOrBenchmarkCurveData(self.0.scope())
278 }
279
280 #[doc(alias = "NoStipulations")]
282 pub fn stipulations(&self) -> Result<Instances<'_, Stipulations<'_>>, InvalidValue> {
283 self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
284 }
285
286 pub fn settl_instructions_data(&self) -> SettlInstructionsData<'_> {
288 SettlInstructionsData(self.0.scope(), Self::known_tags().get())
289 }
290
291 #[doc(alias = "TradingSessionID")]
293 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
294 self.0.get_str(Tag(336))
295 }
296
297 #[doc(alias = "TradingSessionSubID")]
299 pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
300 self.0.get_str(Tag(625))
301 }
302
303 #[doc(alias = "SettlSessID")]
305 pub fn settl_sess_id(&self) -> Result<Option<SettlSessID<'_>>, InvalidValue> {
306 Ok(self.0.get_str(Tag(716))?.map(SettlSessID::from_value))
307 }
308
309 #[doc(alias = "SettlSessSubID")]
311 pub fn settl_sess_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
312 self.0.get_str(Tag(717))
313 }
314
315 #[doc(alias = "ClearingBusinessDate")]
317 pub fn clearing_business_date(&self) -> Result<Option<Date>, InvalidValue> {
318 self.0.get_date(Tag(715))
319 }
320
321 #[doc(alias = "Text")]
323 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
324 self.0.get_str(Tag(58))
325 }
326
327 #[doc(alias = "EncodedTextLen")]
329 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
330 self.0.get_int(Tag(354))
331 }
332
333 #[doc(alias = "EncodedText")]
335 pub fn encoded_text(&self) -> Option<&[u8]> {
336 self.0.get(Tag(355))
337 }
338}
339
340impl std::fmt::Debug for CollateralAssignment {
341 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
342 write!(f, "CollateralAssignment({})", self.0)
343 }
344}
345
346impl std::fmt::Display for CollateralAssignment {
347 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
348 std::fmt::Display::fmt(&self.0, f)
349 }
350}