Skip to main content

refix_fix44/generated/messages/
collateral_response.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![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    SpreadOrBenchmarkCurveData, Stipulations, Trailer, TrdCollGrp, TrdRegTimestamps,
11    UndInstrmtCollGrp,
12};
13use super::super::enums::{
14    AccountType, CollAsgnReason, CollAsgnRejectReason, CollAsgnRespType, CollAsgnTransType,
15    PriceType, QtyType, Side,
16};
17
18/// The `CollateralResponse` (35=AZ) message.
19pub struct CollateralResponse(RawMessage);
20
21impl CollateralResponse {
22    pub const MSG_TYPE: &[u8] = b"AZ";
23
24    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
25        static TAGS: LazyKnownTags = LazyKnownTags::new(
26            &[
27                Tag(904), Tag(902), Tag(894), Tag(895), Tag(903), Tag(905), Tag(906), Tag(60),
28                Tag(453), Tag(1), Tag(581), Tag(11), Tag(37), Tag(198), Tag(526), Tag(124),
29                Tag(897), Tag(64), Tag(53), Tag(854), Tag(15), Tag(555), Tag(711), Tag(899),
30                Tag(900), Tag(901), Tag(768), Tag(54), Tag(136), Tag(44), Tag(423), Tag(159),
31                Tag(920), Tag(921), Tag(922), Tag(232), Tag(58), 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(),
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    /// The `CollRespID` (904) field.
62    #[doc(alias = "CollRespID")]
63    pub fn coll_resp_id(&self) -> Result<Option<&str>, InvalidValue> {
64        self.0.get_str(Tag(904))
65    }
66
67    /// The `CollAsgnID` (902) field.
68    #[doc(alias = "CollAsgnID")]
69    pub fn coll_asgn_id(&self) -> Result<Option<&str>, InvalidValue> {
70        self.0.get_str(Tag(902))
71    }
72
73    /// The `CollReqID` (894) field.
74    #[doc(alias = "CollReqID")]
75    pub fn coll_req_id(&self) -> Result<Option<&str>, InvalidValue> {
76        self.0.get_str(Tag(894))
77    }
78
79    /// The `CollAsgnReason` (895) field.
80    #[doc(alias = "CollAsgnReason")]
81    pub fn coll_asgn_reason(&self) -> Result<Option<CollAsgnReason>, InvalidValue> {
82        Ok(self.0.get_int(Tag(895))?.map(CollAsgnReason::from_value))
83    }
84
85    /// The `CollAsgnTransType` (903) field.
86    #[doc(alias = "CollAsgnTransType")]
87    pub fn coll_asgn_trans_type(&self) -> Result<Option<CollAsgnTransType>, InvalidValue> {
88        Ok(self.0.get_int(Tag(903))?.map(CollAsgnTransType::from_value))
89    }
90
91    /// The `CollAsgnRespType` (905) field.
92    #[doc(alias = "CollAsgnRespType")]
93    pub fn coll_asgn_resp_type(&self) -> Result<Option<CollAsgnRespType>, InvalidValue> {
94        Ok(self.0.get_int(Tag(905))?.map(CollAsgnRespType::from_value))
95    }
96
97    /// The `CollAsgnRejectReason` (906) field.
98    #[doc(alias = "CollAsgnRejectReason")]
99    pub fn coll_asgn_reject_reason(&self) -> Result<Option<CollAsgnRejectReason>, InvalidValue> {
100        Ok(self.0.get_int(Tag(906))?.map(CollAsgnRejectReason::from_value))
101    }
102
103    /// The `TransactTime` (60) field.
104    #[doc(alias = "TransactTime")]
105    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
106        self.0.get_utc_timestamp(Tag(60))
107    }
108
109    /// The instances of the `NoPartyIDs` (453) group.
110    #[doc(alias = "NoPartyIDs")]
111    pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
112        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
113    }
114
115    /// The `Account` (1) field.
116    #[doc(alias = "Account")]
117    pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
118        self.0.get_str(Tag(1))
119    }
120
121    /// The `AccountType` (581) field.
122    #[doc(alias = "AccountType")]
123    pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
124        Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
125    }
126
127    /// The `ClOrdID` (11) field.
128    #[doc(alias = "ClOrdID")]
129    pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
130        self.0.get_str(Tag(11))
131    }
132
133    /// The `OrderID` (37) field.
134    #[doc(alias = "OrderID")]
135    pub fn order_id(&self) -> Result<Option<&str>, InvalidValue> {
136        self.0.get_str(Tag(37))
137    }
138
139    /// The `SecondaryOrderID` (198) field.
140    #[doc(alias = "SecondaryOrderID")]
141    pub fn secondary_order_id(&self) -> Result<Option<&str>, InvalidValue> {
142        self.0.get_str(Tag(198))
143    }
144
145    /// The `SecondaryClOrdID` (526) field.
146    #[doc(alias = "SecondaryClOrdID")]
147    pub fn secondary_cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
148        self.0.get_str(Tag(526))
149    }
150
151    /// The instances of the `NoExecs` (124) group.
152    #[doc(alias = "NoExecs")]
153    pub fn execs(&self) -> Result<Instances<'_, ExecCollGrp<'_>>, InvalidValue> {
154        self.0.get_group(&ExecCollGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
155    }
156
157    /// The instances of the `NoTrades` (897) group.
158    #[doc(alias = "NoTrades")]
159    pub fn trades(&self) -> Result<Instances<'_, TrdCollGrp<'_>>, InvalidValue> {
160        self.0.get_group(&TrdCollGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
161    }
162
163    /// The `Instrument` component.
164    pub fn instrument(&self) -> Instrument<'_> {
165        Instrument(self.0.scope(), Self::known_tags().get())
166    }
167
168    /// The `FinancingDetails` component.
169    pub fn financing_details(&self) -> FinancingDetails<'_> {
170        FinancingDetails(self.0.scope())
171    }
172
173    /// The `SettlDate` (64) field.
174    #[doc(alias = "SettlDate")]
175    pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
176        self.0.get_date(Tag(64))
177    }
178
179    /// The `Quantity` (53) field.
180    #[doc(alias = "Quantity")]
181    pub fn quantity(&self) -> Result<Option<Decimal>, InvalidValue> {
182        self.0.get_decimal(Tag(53))
183    }
184
185    /// The `QtyType` (854) field.
186    #[doc(alias = "QtyType")]
187    pub fn qty_type(&self) -> Result<Option<QtyType>, InvalidValue> {
188        Ok(self.0.get_int(Tag(854))?.map(QtyType::from_value))
189    }
190
191    /// The `Currency` (15) field.
192    #[doc(alias = "Currency")]
193    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
194        self.0.get_str(Tag(15))
195    }
196
197    /// The instances of the `NoLegs` (555) group.
198    #[doc(alias = "NoLegs")]
199    pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
200        self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
201    }
202
203    /// The instances of the `NoUnderlyings` (711) group.
204    #[doc(alias = "NoUnderlyings")]
205    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtCollGrp<'_>>, InvalidValue> {
206        self.0.get_group(&UndInstrmtCollGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
207    }
208
209    /// The `MarginExcess` (899) field.
210    #[doc(alias = "MarginExcess")]
211    pub fn margin_excess(&self) -> Result<Option<Decimal>, InvalidValue> {
212        self.0.get_decimal(Tag(899))
213    }
214
215    /// The `TotalNetValue` (900) field.
216    #[doc(alias = "TotalNetValue")]
217    pub fn total_net_value(&self) -> Result<Option<Decimal>, InvalidValue> {
218        self.0.get_decimal(Tag(900))
219    }
220
221    /// The `CashOutstanding` (901) field.
222    #[doc(alias = "CashOutstanding")]
223    pub fn cash_outstanding(&self) -> Result<Option<Decimal>, InvalidValue> {
224        self.0.get_decimal(Tag(901))
225    }
226
227    /// The instances of the `NoTrdRegTimestamps` (768) group.
228    #[doc(alias = "NoTrdRegTimestamps")]
229    pub fn trd_reg_timestamps(&self) -> Result<Instances<'_, TrdRegTimestamps<'_>>, InvalidValue> {
230        self.0.get_group(&TrdRegTimestamps::TABLE, &Self::known_tags().get()).map(Instances::from)
231    }
232
233    /// The `Side` (54) field.
234    #[doc(alias = "Side")]
235    pub fn side(&self) -> Result<Option<Side<'_>>, InvalidValue> {
236        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
237    }
238
239    /// The instances of the `NoMiscFees` (136) group.
240    #[doc(alias = "NoMiscFees")]
241    pub fn misc_fees(&self) -> Result<Instances<'_, MiscFeesGrp<'_>>, InvalidValue> {
242        self.0.get_group(&MiscFeesGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
243    }
244
245    /// The `Price` (44) field.
246    #[doc(alias = "Price")]
247    pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
248        self.0.get_decimal(Tag(44))
249    }
250
251    /// The `PriceType` (423) field.
252    #[doc(alias = "PriceType")]
253    pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
254        Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
255    }
256
257    /// The `AccruedInterestAmt` (159) field.
258    #[doc(alias = "AccruedInterestAmt")]
259    pub fn accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
260        self.0.get_decimal(Tag(159))
261    }
262
263    /// The `EndAccruedInterestAmt` (920) field.
264    #[doc(alias = "EndAccruedInterestAmt")]
265    pub fn end_accrued_interest_amt(&self) -> Result<Option<Decimal>, InvalidValue> {
266        self.0.get_decimal(Tag(920))
267    }
268
269    /// The `StartCash` (921) field.
270    #[doc(alias = "StartCash")]
271    pub fn start_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
272        self.0.get_decimal(Tag(921))
273    }
274
275    /// The `EndCash` (922) field.
276    #[doc(alias = "EndCash")]
277    pub fn end_cash(&self) -> Result<Option<Decimal>, InvalidValue> {
278        self.0.get_decimal(Tag(922))
279    }
280
281    /// The `SpreadOrBenchmarkCurveData` component.
282    pub fn spread_or_benchmark_curve_data(&self) -> SpreadOrBenchmarkCurveData<'_> {
283        SpreadOrBenchmarkCurveData(self.0.scope())
284    }
285
286    /// The instances of the `NoStipulations` (232) group.
287    #[doc(alias = "NoStipulations")]
288    pub fn stipulations(&self) -> Result<Instances<'_, Stipulations<'_>>, InvalidValue> {
289        self.0.get_group(&Stipulations::TABLE, &Self::known_tags().get()).map(Instances::from)
290    }
291
292    /// The `Text` (58) field.
293    #[doc(alias = "Text")]
294    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
295        self.0.get_str(Tag(58))
296    }
297
298    /// The `EncodedTextLen` (354) field.
299    #[doc(alias = "EncodedTextLen")]
300    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
301        self.0.get_int(Tag(354))
302    }
303
304    /// The `EncodedText` (355) field.
305    #[doc(alias = "EncodedText")]
306    pub fn encoded_text(&self) -> Option<&[u8]> {
307        self.0.get(Tag(355))
308    }
309}
310
311impl std::fmt::Debug for CollateralResponse {
312    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
313        write!(f, "CollateralResponse({})", self.0)
314    }
315}
316
317impl std::fmt::Display for CollateralResponse {
318    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
319        std::fmt::Display::fmt(&self.0, f)
320    }
321}