refix_fix44/generated/messages/
new_order_list.rs1#![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
11pub 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 #[doc(alias = "ListID")]
47 pub fn list_id(&self) -> Result<Option<&str>, InvalidValue> {
48 self.0.get_str(Tag(66))
49 }
50
51 #[doc(alias = "BidID")]
53 pub fn bid_id(&self) -> Result<Option<&str>, InvalidValue> {
54 self.0.get_str(Tag(390))
55 }
56
57 #[doc(alias = "ClientBidID")]
59 pub fn client_bid_id(&self) -> Result<Option<&str>, InvalidValue> {
60 self.0.get_str(Tag(391))
61 }
62
63 #[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 #[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 #[doc(alias = "ProgPeriodInterval")]
77 pub fn prog_period_interval(&self) -> Result<Option<i64>, InvalidValue> {
78 self.0.get_int(Tag(415))
79 }
80
81 #[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 #[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 #[doc(alias = "RegistID")]
95 pub fn regist_id(&self) -> Result<Option<&str>, InvalidValue> {
96 self.0.get_str(Tag(513))
97 }
98
99 #[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 #[doc(alias = "ListExecInst")]
107 pub fn list_exec_inst(&self) -> Result<Option<&str>, InvalidValue> {
108 self.0.get_str(Tag(69))
109 }
110
111 #[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 #[doc(alias = "EncodedListExecInst")]
119 pub fn encoded_list_exec_inst(&self) -> Option<&[u8]> {
120 self.0.get(Tag(353))
121 }
122
123 #[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 #[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 #[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 #[doc(alias = "TotNoOrders")]
143 pub fn tot_no_orders(&self) -> Result<Option<i64>, InvalidValue> {
144 self.0.get_int(Tag(68))
145 }
146
147 #[doc(alias = "LastFragment")]
149 pub fn last_fragment(&self) -> Result<Option<bool>, InvalidValue> {
150 self.0.get_bool(Tag(893))
151 }
152
153 #[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}