refix_fix44/generated/messages/
quote_status_request.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Instances, InvalidValue, LazyKnownTags, RawMessage, Tag};
5
6use super::super::components::{
7 FinancingDetails, Header, InstrmtLegGrp, Instrument, Parties, Trailer, UndInstrmtGrp,
8};
9use super::super::enums::{AccountType, AcctIDSource, SubscriptionRequestType};
10
11pub struct QuoteStatusRequest(RawMessage);
13
14impl QuoteStatusRequest {
15 pub const MSG_TYPE: &[u8] = b"a";
16
17 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
18 static TAGS: LazyKnownTags = LazyKnownTags::new(
19 &[
20 Tag(649), Tag(117), Tag(711), Tag(555), Tag(453), Tag(1), Tag(660), Tag(581),
21 Tag(336), Tag(625), Tag(263),
22 ],
23 &[
24 Header::known_tags(), Trailer::known_tags(), Instrument::known_tags(),
25 FinancingDetails::known_tags(), UndInstrmtGrp::known_tags(),
26 InstrmtLegGrp::known_tags(), Parties::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 #[doc(alias = "QuoteStatusReqID")]
50 pub fn quote_status_req_id(&self) -> Result<Option<&str>, InvalidValue> {
51 self.0.get_str(Tag(649))
52 }
53
54 #[doc(alias = "QuoteID")]
56 pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
57 self.0.get_str(Tag(117))
58 }
59
60 pub fn instrument(&self) -> Instrument<'_> {
62 Instrument(self.0.scope(), Self::known_tags().get())
63 }
64
65 pub fn financing_details(&self) -> FinancingDetails<'_> {
67 FinancingDetails(self.0.scope())
68 }
69
70 #[doc(alias = "NoUnderlyings")]
72 pub fn underlyings(&self) -> Result<Instances<'_, UndInstrmtGrp<'_>>, InvalidValue> {
73 self.0.get_group(&UndInstrmtGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
74 }
75
76 #[doc(alias = "NoLegs")]
78 pub fn legs(&self) -> Result<Instances<'_, InstrmtLegGrp<'_>>, InvalidValue> {
79 self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
80 }
81
82 #[doc(alias = "NoPartyIDs")]
84 pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
85 self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
86 }
87
88 #[doc(alias = "Account")]
90 pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
91 self.0.get_str(Tag(1))
92 }
93
94 #[doc(alias = "AcctIDSource")]
96 pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
97 Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
98 }
99
100 #[doc(alias = "AccountType")]
102 pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
103 Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
104 }
105
106 #[doc(alias = "TradingSessionID")]
108 pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
109 self.0.get_str(Tag(336))
110 }
111
112 #[doc(alias = "TradingSessionSubID")]
114 pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
115 self.0.get_str(Tag(625))
116 }
117
118 #[doc(alias = "SubscriptionRequestType")]
120 pub fn subscription_request_type(&self) -> Result<Option<SubscriptionRequestType<'_>>, InvalidValue> {
121 Ok(self.0.get_str(Tag(263))?.map(SubscriptionRequestType::from_value))
122 }
123}
124
125impl std::fmt::Debug for QuoteStatusRequest {
126 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
127 write!(f, "QuoteStatusRequest({})", self.0)
128 }
129}
130
131impl std::fmt::Display for QuoteStatusRequest {
132 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
133 std::fmt::Display::fmt(&self.0, f)
134 }
135}