Skip to main content

refix_fix44/generated/messages/
collateral_inquiry.rs

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