Skip to main content

refix_fix44/generated/messages/
confirmation_ack.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Date, InvalidValue, LazyKnownTags, RawMessage, Tag, UtcTimestamp};
5
6use super::super::components::{Header, Trailer};
7use super::super::enums::{AffirmStatus, ConfirmRejReason, MatchStatus};
8
9/// The `ConfirmationAck` (35=AU) message.
10pub struct ConfirmationAck(RawMessage);
11
12impl ConfirmationAck {
13    pub const MSG_TYPE: &[u8] = b"AU";
14
15    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
16        static TAGS: LazyKnownTags = LazyKnownTags::new(
17            &[
18                Tag(664), Tag(75), Tag(60), Tag(940), Tag(774), Tag(573), Tag(58), Tag(354),
19                Tag(355),
20            ],
21            &[Header::known_tags(), Trailer::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    /// The `ConfirmID` (664) field.
43    #[doc(alias = "ConfirmID")]
44    pub fn confirm_id(&self) -> Result<Option<&str>, InvalidValue> {
45        self.0.get_str(Tag(664))
46    }
47
48    /// The `TradeDate` (75) field.
49    #[doc(alias = "TradeDate")]
50    pub fn trade_date(&self) -> Result<Option<Date>, InvalidValue> {
51        self.0.get_date(Tag(75))
52    }
53
54    /// The `TransactTime` (60) field.
55    #[doc(alias = "TransactTime")]
56    pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
57        self.0.get_utc_timestamp(Tag(60))
58    }
59
60    /// The `AffirmStatus` (940) field.
61    #[doc(alias = "AffirmStatus")]
62    pub fn affirm_status(&self) -> Result<Option<AffirmStatus>, InvalidValue> {
63        Ok(self.0.get_int(Tag(940))?.map(AffirmStatus::from_value))
64    }
65
66    /// The `ConfirmRejReason` (774) field.
67    #[doc(alias = "ConfirmRejReason")]
68    pub fn confirm_rej_reason(&self) -> Result<Option<ConfirmRejReason>, InvalidValue> {
69        Ok(self.0.get_int(Tag(774))?.map(ConfirmRejReason::from_value))
70    }
71
72    /// The `MatchStatus` (573) field.
73    #[doc(alias = "MatchStatus")]
74    pub fn match_status(&self) -> Result<Option<MatchStatus<'_>>, InvalidValue> {
75        Ok(self.0.get_str(Tag(573))?.map(MatchStatus::from_value))
76    }
77
78    /// The `Text` (58) field.
79    #[doc(alias = "Text")]
80    pub fn text(&self) -> Result<Option<&str>, InvalidValue> {
81        self.0.get_str(Tag(58))
82    }
83
84    /// The `EncodedTextLen` (354) field.
85    #[doc(alias = "EncodedTextLen")]
86    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
87        self.0.get_int(Tag(354))
88    }
89
90    /// The `EncodedText` (355) field.
91    #[doc(alias = "EncodedText")]
92    pub fn encoded_text(&self) -> Option<&[u8]> {
93        self.0.get(Tag(355))
94    }
95}
96
97impl std::fmt::Debug for ConfirmationAck {
98    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
99        write!(f, "ConfirmationAck({})", self.0)
100    }
101}
102
103impl std::fmt::Display for ConfirmationAck {
104    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
105        std::fmt::Display::fmt(&self.0, f)
106    }
107}