refix_fix44/generated/messages/
registration_instructions_response.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{Header, Parties, Trailer};
7use super::super::enums::{AcctIDSource, RegistRejReasonCode, RegistStatus, RegistTransType};
8
9pub struct RegistrationInstructionsResponse(RawMessage);
11
12impl RegistrationInstructionsResponse {
13 pub const MSG_TYPE: &[u8] = b"p";
14
15 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
16 static TAGS: LazyKnownTags = LazyKnownTags::new(
17 &[
18 Tag(513), Tag(514), Tag(508), Tag(11), Tag(453), Tag(1), Tag(660), Tag(506),
19 Tag(507), Tag(496),
20 ],
21 &[Header::known_tags(), Trailer::known_tags(), Parties::known_tags()],
22 );
23 &TAGS
24 }
25
26 pub fn from_raw(raw: RawMessage) -> Self {
27 Self(raw)
28 }
29
30 pub fn raw(&self) -> &RawMessage {
31 &self.0
32 }
33
34 pub fn header(&self) -> Header<'_> {
35 Header(self.0.scope(), Self::known_tags().get())
36 }
37
38 pub fn trailer(&self) -> Trailer<'_> {
39 Trailer(self.0.scope())
40 }
41
42 #[doc(alias = "RegistID")]
44 pub fn regist_id(&self) -> Result<Option<&str>, InvalidValue> {
45 self.0.get_str(Tag(513))
46 }
47
48 #[doc(alias = "RegistTransType")]
50 pub fn regist_trans_type(&self) -> Result<Option<RegistTransType<'_>>, InvalidValue> {
51 Ok(self.0.get_str(Tag(514))?.map(RegistTransType::from_value))
52 }
53
54 #[doc(alias = "RegistRefID")]
56 pub fn regist_ref_id(&self) -> Result<Option<&str>, InvalidValue> {
57 self.0.get_str(Tag(508))
58 }
59
60 #[doc(alias = "ClOrdID")]
62 pub fn cl_ord_id(&self) -> Result<Option<&str>, InvalidValue> {
63 self.0.get_str(Tag(11))
64 }
65
66 #[doc(alias = "NoPartyIDs")]
68 pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
69 self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
70 }
71
72 #[doc(alias = "Account")]
74 pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
75 self.0.get_str(Tag(1))
76 }
77
78 #[doc(alias = "AcctIDSource")]
80 pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
81 Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
82 }
83
84 #[doc(alias = "RegistStatus")]
86 pub fn regist_status(&self) -> Result<Option<RegistStatus<'_>>, InvalidValue> {
87 Ok(self.0.get_str(Tag(506))?.map(RegistStatus::from_value))
88 }
89
90 #[doc(alias = "RegistRejReasonCode")]
92 pub fn regist_rej_reason_code(&self) -> Result<Option<RegistRejReasonCode>, InvalidValue> {
93 Ok(self.0.get_int(Tag(507))?.map(RegistRejReasonCode::from_value))
94 }
95
96 #[doc(alias = "RegistRejReasonText")]
98 pub fn regist_rej_reason_text(&self) -> Result<Option<&str>, InvalidValue> {
99 self.0.get_str(Tag(496))
100 }
101}
102
103impl std::fmt::Debug for RegistrationInstructionsResponse {
104 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
105 write!(f, "RegistrationInstructionsResponse({})", self.0)
106 }
107}
108
109impl std::fmt::Display for RegistrationInstructionsResponse {
110 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
111 std::fmt::Display::fmt(&self.0, f)
112 }
113}