Skip to main content

refix_fix44/generated/messages/
request_for_positions_ack.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{Header, InstrmtLegGrp, Instrument, Parties, Trailer, UndInstrmtGrp};
7use super::super::enums::{
8    AccountType, AcctIDSource, PosReqResult, PosReqStatus, ResponseTransportType,
9};
10
11/// The `RequestForPositionsAck` (35=AO) message.
12pub struct RequestForPositionsAck(RawMessage);
13
14impl RequestForPositionsAck {
15    pub const MSG_TYPE: &[u8] = b"AO";
16
17    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
18        static TAGS: LazyKnownTags = LazyKnownTags::new(
19            &[
20                Tag(721), Tag(710), Tag(727), Tag(325), Tag(728), Tag(729), Tag(453), Tag(1),
21                Tag(660), Tag(581), Tag(15), Tag(555), Tag(711), Tag(725), Tag(726), Tag(58),
22                Tag(354), Tag(355),
23            ],
24            &[
25                Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
26                Instrument::known_tags(), InstrmtLegGrp::known_tags(), UndInstrmtGrp::known_tags(),
27            ],
28        );
29        &TAGS
30    }
31
32    pub fn from_raw(raw: RawMessage) -> Self {
33        Self(raw)
34    }
35
36    pub fn raw(&self) -> &RawMessage {
37        &self.0
38    }
39
40    pub fn header(&self) -> Header<'_> {
41        Header(self.0.scope(), Self::known_tags().get())
42    }
43
44    pub fn trailer(&self) -> Trailer<'_> {
45        Trailer(self.0.scope())
46    }
47
48    /// The `PosMaintRptID` (721) field.
49    #[doc(alias = "PosMaintRptID")]
50    pub fn pos_maint_rpt_id(&self) -> Result<Option<&str>, InvalidValue> {
51        self.0.get_str(Tag(721))
52    }
53
54    /// The `PosReqID` (710) field.
55    #[doc(alias = "PosReqID")]
56    pub fn pos_req_id(&self) -> Result<Option<&str>, InvalidValue> {
57        self.0.get_str(Tag(710))
58    }
59
60    /// The `TotalNumPosReports` (727) field.
61    #[doc(alias = "TotalNumPosReports")]
62    pub fn total_num_pos_reports(&self) -> Result<Option<i64>, InvalidValue> {
63        self.0.get_int(Tag(727))
64    }
65
66    /// The `UnsolicitedIndicator` (325) field.
67    #[doc(alias = "UnsolicitedIndicator")]
68    pub fn unsolicited_indicator(&self) -> Result<Option<bool>, InvalidValue> {
69        self.0.get_bool(Tag(325))
70    }
71
72    /// The `PosReqResult` (728) field.
73    #[doc(alias = "PosReqResult")]
74    pub fn pos_req_result(&self) -> Result<Option<PosReqResult>, InvalidValue> {
75        Ok(self.0.get_int(Tag(728))?.map(PosReqResult::from_value))
76    }
77
78    /// The `PosReqStatus` (729) field.
79    #[doc(alias = "PosReqStatus")]
80    pub fn pos_req_status(&self) -> Result<Option<PosReqStatus>, InvalidValue> {
81        Ok(self.0.get_int(Tag(729))?.map(PosReqStatus::from_value))
82    }
83
84    /// The instances of the `NoPartyIDs` (453) group.
85    #[doc(alias = "NoPartyIDs")]
86    pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
87        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
88    }
89
90    /// The `Account` (1) field.
91    #[doc(alias = "Account")]
92    pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
93        self.0.get_str(Tag(1))
94    }
95
96    /// The `AcctIDSource` (660) field.
97    #[doc(alias = "AcctIDSource")]
98    pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
99        Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
100    }
101
102    /// The `AccountType` (581) field.
103    #[doc(alias = "AccountType")]
104    pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
105        Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
106    }
107
108    /// The `Instrument` component.
109    pub fn instrument(&self) -> Instrument<'_> {
110        Instrument(self.0.scope(), Self::known_tags().get())
111    }
112
113    /// The `Currency` (15) field.
114    #[doc(alias = "Currency")]
115    pub fn currency(&self) -> Result<Option<&str>, InvalidValue> {
116        self.0.get_str(Tag(15))
117    }
118
119    /// The instances of the `NoLegs` (555) group.
120    #[doc(alias = "NoLegs")]
121    pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
122        self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
123    }
124
125    /// The instances of the `NoUnderlyings` (711) group.
126    #[doc(alias = "NoUnderlyings")]
127    pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
128        self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
129    }
130
131    /// The `ResponseTransportType` (725) field.
132    #[doc(alias = "ResponseTransportType")]
133    pub fn response_transport_type(&self) -> Result<Option<ResponseTransportType>, InvalidValue> {
134        Ok(self.0.get_int(Tag(725))?.map(ResponseTransportType::from_value))
135    }
136
137    /// The `ResponseDestination` (726) field.
138    #[doc(alias = "ResponseDestination")]
139    pub fn response_destination(&self) -> Result<Option<&str>, InvalidValue> {
140        self.0.get_str(Tag(726))
141    }
142
143    /// The `Text` (58) field.
144    #[doc(alias = "Text")]
145    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
146        self.0.get_str(Tag(58))
147    }
148
149    /// The `EncodedTextLen` (354) field.
150    #[doc(alias = "EncodedTextLen")]
151    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
152        self.0.get_int(Tag(354))
153    }
154
155    /// The `EncodedText` (355) field.
156    #[doc(alias = "EncodedText")]
157    pub fn encoded_text(&self) -> Option<&[u8]> {
158        self.0.get(Tag(355))
159    }
160}
161
162impl std::fmt::Debug for RequestForPositionsAck {
163    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
164        write!(f, "RequestForPositionsAck({})", self.0)
165    }
166}
167
168impl std::fmt::Display for RequestForPositionsAck {
169    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
170        std::fmt::Display::fmt(&self.0, f)
171    }
172}