Skip to main content

refix_fix44/generated/messages/
new_order_list.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{Header, ListOrdGrp, Trailer};
7use super::super::enums::{
8    BidType, CancellationRights, ListExecInstType, MoneyLaunderingStatus, ProgRptReqs,
9};
10
11/// The `NewOrderList` (35=E) message.
12pub struct NewOrderList(RawMessage);
13
14impl NewOrderList {
15    pub const MSG_TYPE: &[u8] = b"E";
16
17    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
18        static TAGS: LazyKnownTags = LazyKnownTags::new(
19            &[
20                Tag(66), Tag(390), Tag(391), Tag(414), Tag(394), Tag(415), Tag(480), Tag(481),
21                Tag(513), Tag(433), Tag(69), Tag(352), Tag(353), Tag(765), Tag(766), Tag(767),
22                Tag(68), Tag(893), Tag(73),
23            ],
24            &[Header::known_tags(), Trailer::known_tags(), ListOrdGrp::known_tags()],
25        );
26        &TAGS
27    }
28
29    pub fn from_raw(raw: RawMessage) -> Self {
30        Self(raw)
31    }
32
33    pub fn raw(&self) -> &RawMessage {
34        &self.0
35    }
36
37    pub fn header(&self) -> Header<'_> {
38        Header(self.0.scope(), Self::known_tags().get())
39    }
40
41    pub fn trailer(&self) -> Trailer<'_> {
42        Trailer(self.0.scope())
43    }
44
45    /// The `ListID` (66) field.
46    #[doc(alias = "ListID")]
47    pub fn list_id(&self) -> Result<Option<&str>, InvalidValue> {
48        self.0.get_str(Tag(66))
49    }
50
51    /// The `BidID` (390) field.
52    #[doc(alias = "BidID")]
53    pub fn bid_id(&self) -> Result<Option<&str>, InvalidValue> {
54        self.0.get_str(Tag(390))
55    }
56
57    /// The `ClientBidID` (391) field.
58    #[doc(alias = "ClientBidID")]
59    pub fn client_bid_id(&self) -> Result<Option<&str>, InvalidValue> {
60        self.0.get_str(Tag(391))
61    }
62
63    /// The `ProgRptReqs` (414) field.
64    #[doc(alias = "ProgRptReqs")]
65    pub fn prog_rpt_reqs(&self) -> Result<Option<ProgRptReqs>, InvalidValue> {
66        Ok(self.0.get_int(Tag(414))?.map(ProgRptReqs::from_value))
67    }
68
69    /// The `BidType` (394) field.
70    #[doc(alias = "BidType")]
71    pub fn bid_type(&self) -> Result<Option<BidType>, InvalidValue> {
72        Ok(self.0.get_int(Tag(394))?.map(BidType::from_value))
73    }
74
75    /// The `ProgPeriodInterval` (415) field.
76    #[doc(alias = "ProgPeriodInterval")]
77    pub fn prog_period_interval(&self) -> Result<Option<i64>, InvalidValue> {
78        self.0.get_int(Tag(415))
79    }
80
81    /// The `CancellationRights` (480) field.
82    #[doc(alias = "CancellationRights")]
83    pub fn cancellation_rights(&self) -> Result<Option<CancellationRights<'_>>, InvalidValue> {
84        Ok(self.0.get_str(Tag(480))?.map(CancellationRights::from_value))
85    }
86
87    /// The `MoneyLaunderingStatus` (481) field.
88    #[doc(alias = "MoneyLaunderingStatus")]
89    pub fn money_laundering_status(&self) -> Result<Option<MoneyLaunderingStatus<'_>>, InvalidValue> {
90        Ok(self.0.get_str(Tag(481))?.map(MoneyLaunderingStatus::from_value))
91    }
92
93    /// The `RegistID` (513) field.
94    #[doc(alias = "RegistID")]
95    pub fn regist_id(&self) -> Result<Option<&str>, InvalidValue> {
96        self.0.get_str(Tag(513))
97    }
98
99    /// The `ListExecInstType` (433) field.
100    #[doc(alias = "ListExecInstType")]
101    pub fn list_exec_inst_type(&self) -> Result<Option<ListExecInstType<'_>>, InvalidValue> {
102        Ok(self.0.get_str(Tag(433))?.map(ListExecInstType::from_value))
103    }
104
105    /// The `ListExecInst` (69) field.
106    #[doc(alias = "ListExecInst")]
107    pub fn list_exec_inst(&self) -> Result<Option<&str>, InvalidValue> {
108        self.0.get_str(Tag(69))
109    }
110
111    /// The `EncodedListExecInstLen` (352) field.
112    #[doc(alias = "EncodedListExecInstLen")]
113    pub fn encoded_list_exec_inst_len(&self) -> Result<Option<i64>, InvalidValue> {
114        self.0.get_int(Tag(352))
115    }
116
117    /// The `EncodedListExecInst` (353) field.
118    #[doc(alias = "EncodedListExecInst")]
119    pub fn encoded_list_exec_inst(&self) -> Option<&[u8]> {
120        self.0.get(Tag(353))
121    }
122
123    /// The `AllowableOneSidednessPct` (765) field.
124    #[doc(alias = "AllowableOneSidednessPct")]
125    pub fn allowable_one_sidedness_pct(&self) -> Result<Option<Decimal>, InvalidValue> {
126        self.0.get_decimal(Tag(765))
127    }
128
129    /// The `AllowableOneSidednessValue` (766) field.
130    #[doc(alias = "AllowableOneSidednessValue")]
131    pub fn allowable_one_sidedness_value(&self) -> Result<Option<Decimal>, InvalidValue> {
132        self.0.get_decimal(Tag(766))
133    }
134
135    /// The `AllowableOneSidednessCurr` (767) field.
136    #[doc(alias = "AllowableOneSidednessCurr")]
137    pub fn allowable_one_sidedness_curr(&self) -> Result<Option<&str>, InvalidValue> {
138        self.0.get_str(Tag(767))
139    }
140
141    /// The `TotNoOrders` (68) field.
142    #[doc(alias = "TotNoOrders")]
143    pub fn tot_no_orders(&self) -> Result<Option<i64>, InvalidValue> {
144        self.0.get_int(Tag(68))
145    }
146
147    /// The `LastFragment` (893) field.
148    #[doc(alias = "LastFragment")]
149    pub fn last_fragment(&self) -> Result<Option<bool>, InvalidValue> {
150        self.0.get_bool(Tag(893))
151    }
152
153    /// The instances of the `NoOrders` (73) group.
154    #[doc(alias = "NoOrders")]
155    pub fn orders(&self) -> Result<Instances<'_, ListOrdGrp<'_>>, InvalidValue> {
156        self.0.get_group(&ListOrdGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
157    }
158}
159
160impl std::fmt::Debug for NewOrderList {
161    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
162        write!(f, "NewOrderList({})", self.0)
163    }
164}
165
166impl std::fmt::Display for NewOrderList {
167    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
168        std::fmt::Display::fmt(&self.0, f)
169    }
170}