Skip to main content

refix_fix44/generated/messages/
quote_cancel.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, Parties, QuotCxlEntriesGrp, Trailer};
7use super::super::enums::{AccountType, AcctIDSource, QuoteCancelType, QuoteResponseLevel};
8
9/// The `QuoteCancel` (35=Z) message.
10pub struct QuoteCancel(RawMessage);
11
12impl QuoteCancel {
13    pub const MSG_TYPE: &[u8] = b"Z";
14
15    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
16        static TAGS: LazyKnownTags = LazyKnownTags::new(
17            &[
18                Tag(131), Tag(117), Tag(298), Tag(301), Tag(453), Tag(1), Tag(660), Tag(581),
19                Tag(336), Tag(625), Tag(295),
20            ],
21            &[
22                Header::known_tags(), Trailer::known_tags(), Parties::known_tags(),
23                QuotCxlEntriesGrp::known_tags(),
24            ],
25        );
26        &TAGS
27    }
28
29    pub fn from_raw(raw: RawMessage) -> Self {
30        Self(raw)
31    }
32
33    pub fn raw(&self) -> &RawMessage {
34        &self.0
35    }
36
37    pub fn header(&self) -> Header<'_> {
38        Header(self.0.scope(), Self::known_tags().get())
39    }
40
41    pub fn trailer(&self) -> Trailer<'_> {
42        Trailer(self.0.scope())
43    }
44
45    /// The `QuoteReqID` (131) field.
46    #[doc(alias = "QuoteReqID")]
47    pub fn quote_req_id(&self) -> Result<Option<&str>, InvalidValue> {
48        self.0.get_str(Tag(131))
49    }
50
51    /// The `QuoteID` (117) field.
52    #[doc(alias = "QuoteID")]
53    pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
54        self.0.get_str(Tag(117))
55    }
56
57    /// The `QuoteCancelType` (298) field.
58    #[doc(alias = "QuoteCancelType")]
59    pub fn quote_cancel_type(&self) -> Result<Option<QuoteCancelType>, InvalidValue> {
60        Ok(self.0.get_int(Tag(298))?.map(QuoteCancelType::from_value))
61    }
62
63    /// The `QuoteResponseLevel` (301) field.
64    #[doc(alias = "QuoteResponseLevel")]
65    pub fn quote_response_level(&self) -> Result<Option<QuoteResponseLevel>, InvalidValue> {
66        Ok(self.0.get_int(Tag(301))?.map(QuoteResponseLevel::from_value))
67    }
68
69    /// The instances of the `NoPartyIDs` (453) group.
70    #[doc(alias = "NoPartyIDs")]
71    pub fn party_ids(&self) -> Result<Instances<'_, Parties<'_>>, InvalidValue> {
72        self.0.get_group(&Parties::TABLE, &Self::known_tags().get()).map(Instances::from)
73    }
74
75    /// The `Account` (1) field.
76    #[doc(alias = "Account")]
77    pub fn account(&self) -> Result<Option<&str>, InvalidValue> {
78        self.0.get_str(Tag(1))
79    }
80
81    /// The `AcctIDSource` (660) field.
82    #[doc(alias = "AcctIDSource")]
83    pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
84        Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
85    }
86
87    /// The `AccountType` (581) field.
88    #[doc(alias = "AccountType")]
89    pub fn account_type(&self) -> Result<Option<AccountType>, InvalidValue> {
90        Ok(self.0.get_int(Tag(581))?.map(AccountType::from_value))
91    }
92
93    /// The `TradingSessionID` (336) field.
94    #[doc(alias = "TradingSessionID")]
95    pub fn trading_session_id(&self) -> Result<Option<&str>, InvalidValue> {
96        self.0.get_str(Tag(336))
97    }
98
99    /// The `TradingSessionSubID` (625) field.
100    #[doc(alias = "TradingSessionSubID")]
101    pub fn trading_session_sub_id(&self) -> Result<Option<&str>, InvalidValue> {
102        self.0.get_str(Tag(625))
103    }
104
105    /// The instances of the `NoQuoteEntries` (295) group.
106    #[doc(alias = "NoQuoteEntries")]
107    pub fn quote_entries(&self) -> Result<Instances<'_, QuotCxlEntriesGrp<'_>>, InvalidValue> {
108        self.0.get_group(&QuotCxlEntriesGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
109    }
110}
111
112impl std::fmt::Debug for QuoteCancel {
113    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
114        write!(f, "QuoteCancel({})", self.0)
115    }
116}
117
118impl std::fmt::Display for QuoteCancel {
119    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
120        std::fmt::Display::fmt(&self.0, f)
121    }
122}