refix_fix44/generated/messages/
assignment_report.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Date, Decimal, Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{
7 Header, InstrmtLegGrp, Instrument, Parties, PositionAmountData, PositionQty, Trailer,
8 UndInstrmtGrp,
9};
10use super::super::enums::{
11 AccountType, AssignmentMethod, ExerciseMethod, SettlPriceType, SettlSessID,
12};
13
14pub struct AssignmentReport(RawMessage);
16
17impl AssignmentReport {
18 pub const MSG_TYPE: &[u8] = b"AW";
19
20 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
21 static TAGS: LazyKnownTags = LazyKnownTags::new(
22 &[
23 Tag(833), Tag(832), Tag(912), Tag(453), Tag(1), Tag(581), Tag(15), Tag(555),
24 Tag(711), Tag(702), Tag(753), Tag(834), Tag(730), Tag(731), Tag(732), Tag(432),
25 Tag(744), Tag(745), Tag(746), Tag(747), Tag(716), Tag(717), Tag(715), Tag(58),
26 Tag(354), Tag(355),
27 ],
28 &[
29 Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
30 Instrument::known_tags(), InstrmtLegGrp::known_tags(), UndInstrmtGrp::known_tags(),
31 PositionQty::known_tags(), PositionAmountData::known_tags(),
32 ],
33 );
34 &TAGS
35 }
36
37 pub fn from_raw(raw: RawMessage) -> Self {
38 Self(raw)
39 }
40
41 pub fn raw(&self) -> &RawMessage {
42 &self.0
43 }
44
45 pub fn header(&self) -> Header<'_> {
46 Header(self.0.scope(), Self::known_tags().get())
47 }
48
49 pub fn trailer(&self) -> Trailer<'_> {
50 Trailer(self.0.scope())
51 }
52
53 #[doc(alias = "AsgnRptID")]
55 pub fn asgn_rpt_id(&self) -> Result<Option<&str>, InvalidValue> {
56 self.0.get_str(Tag(833))
57 }
58
59 #[doc(alias = "TotNumAssignmentReports")]
61 pub fn tot_num_assignment_reports(&self) -> Result<Option<i64>, InvalidValue> {
62 self.0.get_int(Tag(832))
63 }
64
65 #[doc(alias = "LastRptRequested")]
67 pub fn last_rpt_requested(&self) -> Result<Option<bool>, InvalidValue> {
68 self.0.get_bool(Tag(912))
69 }
70
71 #[doc(alias = "NoPartyIDs")]
73 pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
74 self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
75 }
76
77 #[doc(alias = "Account")]
79 pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
80 self.0.get_str(Tag(1))
81 }
82
83 #[doc(alias = "AccountType")]
85 pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
86 Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
87 }
88
89 pub fn instrument(&self) -> Instrument<'_> {
91 Instrument(self.0.scope(), Self::known_tags().get())
92 }
93
94 #[doc(alias = "Currency")]
96 pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
97 self.0.get_str(Tag(15))
98 }
99
100 #[doc(alias = "NoLegs")]
102 pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
103 self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
104 }
105
106 #[doc(alias = "NoUnderlyings")]
108 pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
109 self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
110 }
111
112 #[doc(alias = "NoPositions")]
114 pub fn positions(&self) -> Result<Instances<'_, PositionQty<'_>>, InvalidValue> {
115 self.0.get_group(&PositionQty::TABLE, &Self::known_tags().get()).map(Instances::from)
116 }
117
118 #[doc(alias = "NoPosAmt")]
120 pub fn pos_amt(&self) -> Result<Instances<'_, PositionAmountData<'_>>, InvalidValue> {
121 self.0.get_group(&PositionAmountData::TABLE, &Self::known_tags().get()).map(Instances::from)
122 }
123
124 #[doc(alias = "ThresholdAmount")]
126 pub fn threshold_amount(&self) -> Result<Option<Decimal>, InvalidValue> {
127 self.0.get_decimal(Tag(834))
128 }
129
130 #[doc(alias = "SettlPrice")]
132 pub fn settl_price(&self) -> Result<Option<Decimal>, InvalidValue> {
133 self.0.get_decimal(Tag(730))
134 }
135
136 #[doc(alias = "SettlPriceType")]
138 pub fn settl_price_type(&self) -> Result<Option<SettlPriceType>, InvalidValue> {
139 Ok(self.0.get_int(Tag(731))?.map(SettlPriceType::from_value))
140 }
141
142 #[doc(alias = "UnderlyingSettlPrice")]
144 pub fn underlying_settl_price(&self) -> Result<Option<Decimal>, InvalidValue> {
145 self.0.get_decimal(Tag(732))
146 }
147
148 #[doc(alias = "ExpireDate")]
150 pub fn expire_date(&self) -> Result<Option<Date>, InvalidValue> {
151 self.0.get_date(Tag(432))
152 }
153
154 #[doc(alias = "AssignmentMethod")]
156 pub fn assignment_method(&self) -> Result<Option<AssignmentMethod<'_>>, InvalidValue> {
157 Ok(self.0.get_str(Tag(744))?.map(AssignmentMethod::from_value))
158 }
159
160 #[doc(alias = "AssignmentUnit")]
162 pub fn assignment_unit(&self) -> Result<Option<Decimal>, InvalidValue> {
163 self.0.get_decimal(Tag(745))
164 }
165
166 #[doc(alias = "OpenInterest")]
168 pub fn open_interest(&self) -> Result<Option<Decimal>, InvalidValue> {
169 self.0.get_decimal(Tag(746))
170 }
171
172 #[doc(alias = "ExerciseMethod")]
174 pub fn exercise_method(&self) -> Result<Option<ExerciseMethod<'_>>, InvalidValue> {
175 Ok(self.0.get_str(Tag(747))?.map(ExerciseMethod::from_value))
176 }
177
178 #[doc(alias = "SettlSessID")]
180 pub fn settl_sess_id(&self) -> Result<Option<SettlSessID<'_>>, InvalidValue> {
181 Ok(self.0.get_str(Tag(716))?.map(SettlSessID::from_value))
182 }
183
184 #[doc(alias = "SettlSessSubID")]
186 pub fn settl_sess_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
187 self.0.get_str(Tag(717))
188 }
189
190 #[doc(alias = "ClearingBusinessDate")]
192 pub fn clearing_business_date(&self) -> Result<Option<Date>, InvalidValue> {
193 self.0.get_date(Tag(715))
194 }
195
196 #[doc(alias = "Text")]
198 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
199 self.0.get_str(Tag(58))
200 }
201
202 #[doc(alias = "EncodedTextLen")]
204 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
205 self.0.get_int(Tag(354))
206 }
207
208 #[doc(alias = "EncodedText")]
210 pub fn encoded_text(&self) -> Option<&[u8]> {
211 self.0.get(Tag(355))
212 }
213}
214
215impl std::fmt::Debug for AssignmentReport {
216 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
217 write!(f, "AssignmentReport({})", self.0)
218 }
219}
220
221impl std::fmt::Display for AssignmentReport {
222 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
223 std::fmt::Display::fmt(&self.0, f)
224 }
225}