refix_fix44/generated/messages/
mass_quote_acknowledgement.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{Header, Parties, QuotSetAckGrp, Trailer};
7use super::super::enums::{
8 AccountType, AcctIDSource, QuoteRejectReason, QuoteResponseLevel, QuoteStatus, QuoteType,
9};
10
11pub struct MassQuoteAcknowledgement(RawMessage);
13
14impl MassQuoteAcknowledgement {
15 pub const MSG_TYPE: &[u8] = b"b";
16
17 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
18 static TAGS: LazyKnownTags = LazyKnownTags::new(
19 &[
20 Tag(131), Tag(117), Tag(297), Tag(300), Tag(301), Tag(537), Tag(453), Tag(1),
21 Tag(660), Tag(581), Tag(58), Tag(354), Tag(355), Tag(296),
22 ],
23 &[
24 Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
25 QuotSetAckGrp::known_tags(),
26 ],
27 );
28 &TAGS
29 }
30
31 pub fn from_raw(raw: RawMessage) -> Self {
32 Self(raw)
33 }
34
35 pub fn raw(&self) -> &RawMessage {
36 &self.0
37 }
38
39 pub fn header(&self) -> Header<'_> {
40 Header(self.0.scope(), Self::known_tags().get())
41 }
42
43 pub fn trailer(&self) -> Trailer<'_> {
44 Trailer(self.0.scope())
45 }
46
47 #[doc(alias = "QuoteReqID")]
49 pub fn quote_req_id(&self) -> Result<Option<&str>, InvalidValue> {
50 self.0.get_str(Tag(131))
51 }
52
53 #[doc(alias = "QuoteID")]
55 pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
56 self.0.get_str(Tag(117))
57 }
58
59 #[doc(alias = "QuoteStatus")]
61 pub fn quote_status(&self) -> Result<Option<QuoteStatus>, InvalidValue> {
62 Ok(self.0.get_int(Tag(297))?.map(QuoteStatus::from_value))
63 }
64
65 #[doc(alias = "QuoteRejectReason")]
67 pub fn quote_reject_reason(&self) -> Result<Option<QuoteRejectReason>, InvalidValue> {
68 Ok(self.0.get_int(Tag(300))?.map(QuoteRejectReason::from_value))
69 }
70
71 #[doc(alias = "QuoteResponseLevel")]
73 pub fn quote_response_level(&self) -> Result<Option<QuoteResponseLevel>, InvalidValue> {
74 Ok(self.0.get_int(Tag(301))?.map(QuoteResponseLevel::from_value))
75 }
76
77 #[doc(alias = "QuoteType")]
79 pub fn quote_type(&self) -> Result<Option<QuoteType>, InvalidValue> {
80 Ok(self.0.get_int(Tag(537))?.map(QuoteType::from_value))
81 }
82
83 #[doc(alias = "NoPartyIDs")]
85 pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
86 self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
87 }
88
89 #[doc(alias = "Account")]
91 pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
92 self.0.get_str(Tag(1))
93 }
94
95 #[doc(alias = "AcctIDSource")]
97 pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
98 Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
99 }
100
101 #[doc(alias = "AccountType")]
103 pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
104 Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
105 }
106
107 #[doc(alias = "Text")]
109 pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
110 self.0.get_str(Tag(58))
111 }
112
113 #[doc(alias = "EncodedTextLen")]
115 pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
116 self.0.get_int(Tag(354))
117 }
118
119 #[doc(alias = "EncodedText")]
121 pub fn encoded_text(&self) -> Option<&[u8]> {
122 self.0.get(Tag(355))
123 }
124
125 #[doc(alias = "NoQuoteSets")]
127 pub fn quote_sets(&self) -> Result<Instances<'_, QuotSetAckGrp<'_>>, InvalidValue> {
128 self.0.get_group(&QuotSetAckGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
129 }
130}
131
132impl std::fmt::Debug for MassQuoteAcknowledgement {
133 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
134 write!(f, "MassQuoteAcknowledgement({})", self.0)
135 }
136}
137
138impl std::fmt::Display for MassQuoteAcknowledgement {
139 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
140 std::fmt::Display::fmt(&self.0, f)
141 }
142}