Skip to main content

refix_fix44/generated/components/
bid_comp_rsp_grp.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Date, Decimal, GroupTable, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::{NetGrossInd, PriceType, SettlType, Side};
7use super::CommissionData;
8
9/// An instance of the `NoBidComponents` (420) group.
10#[derive(Clone, Copy)]
11pub struct BidCompRspGrp<'a>(refix_message::Scope<'a>);
12
13impl<'a> From<refix_message::Scope<'a>> for BidCompRspGrp<'a> {
14    fn from(scope: refix_message::Scope<'a>) -> Self {
15        Self(scope)
16    }
17}
18
19impl<'a> BidCompRspGrp<'a> {
20    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
21        Tag(420),
22        Tag(12),
23        &[
24            Tag(12), Tag(13), Tag(44), Tag(54), Tag(58), Tag(63), Tag(64), Tag(66), Tag(336),
25            Tag(354), Tag(355), Tag(406), Tag(421), Tag(423), Tag(430), Tag(479), Tag(497),
26            Tag(625),
27        ],
28        &[],
29    );
30
31    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
32        static TAGS: LazyKnownTags = LazyKnownTags::new(
33            &[
34                Tag(66), Tag(421), Tag(54), Tag(44), Tag(423), Tag(406), Tag(430), Tag(63), Tag(64),
35                Tag(336), Tag(625), Tag(58), Tag(354), Tag(355),
36            ],
37            &[CommissionData::known_tags()],
38        );
39        &TAGS
40    }
41
42    pub fn raw(&self) -> refix_message::Scope<'a> {
43        self.0
44    }
45
46    /// The `CommissionData` component.
47    pub fn commission_data(&self) -> CommissionData<'a> {
48        CommissionData(self.0)
49    }
50
51    /// The `ListID` (66) field.
52    #[doc(alias = "ListID")]
53    pub fn list_id(&self) -> Result<Option<&'a str>, InvalidValue> {
54        self.0.get_str(Tag(66))
55    }
56
57    /// The `Country` (421) field.
58    #[doc(alias = "Country")]
59    pub fn country(&self) -> Result<Option<&'a str>, InvalidValue> {
60        self.0.get_str(Tag(421))
61    }
62
63    /// The `Side` (54) field.
64    #[doc(alias = "Side")]
65    pub fn side(&self) -> Result<Option<Side<'a>>, InvalidValue> {
66        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
67    }
68
69    /// The `Price` (44) field.
70    #[doc(alias = "Price")]
71    pub fn price(&self) -> Result<Option<Decimal>, InvalidValue> {
72        self.0.get_decimal(Tag(44))
73    }
74
75    /// The `PriceType` (423) field.
76    #[doc(alias = "PriceType")]
77    pub fn price_type(&self) -> Result<Option<PriceType>, InvalidValue> {
78        Ok(self.0.get_int(Tag(423))?.map(PriceType::from_value))
79    }
80
81    /// The `FairValue` (406) field.
82    #[doc(alias = "FairValue")]
83    pub fn fair_value(&self) -> Result<Option<Decimal>, InvalidValue> {
84        self.0.get_decimal(Tag(406))
85    }
86
87    /// The `NetGrossInd` (430) field.
88    #[doc(alias = "NetGrossInd")]
89    pub fn net_gross_ind(&self) -> Result<Option<NetGrossInd>, InvalidValue> {
90        Ok(self.0.get_int(Tag(430))?.map(NetGrossInd::from_value))
91    }
92
93    /// The `SettlType` (63) field.
94    #[doc(alias = "SettlType")]
95    pub fn settl_type(&self) -> Result<Option<SettlType<'a>>, InvalidValue> {
96        Ok(self.0.get_str(Tag(63))?.map(SettlType::from_value))
97    }
98
99    /// The `SettlDate` (64) field.
100    #[doc(alias = "SettlDate")]
101    pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
102        self.0.get_date(Tag(64))
103    }
104
105    /// The `TradingSessionID` (336) field.
106    #[doc(alias = "TradingSessionID")]
107    pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
108        self.0.get_str(Tag(336))
109    }
110
111    /// The `TradingSessionSubID` (625) field.
112    #[doc(alias = "TradingSessionSubID")]
113    pub fn trading_session_sub_id(&self) -> Result<Option<&'a str>, InvalidValue> {
114        self.0.get_str(Tag(625))
115    }
116
117    /// The `Text` (58) field.
118    #[doc(alias = "Text")]
119    pub fn text(&self) -> Result<Option<&'a str>, InvalidValue> {
120        self.0.get_str(Tag(58))
121    }
122
123    /// The `EncodedTextLen` (354) field.
124    #[doc(alias = "EncodedTextLen")]
125    pub fn encoded_text_len(&self) -> Result<Option<i64>, InvalidValue> {
126        self.0.get_int(Tag(354))
127    }
128
129    /// The `EncodedText` (355) field.
130    #[doc(alias = "EncodedText")]
131    pub fn encoded_text(&self) -> Option<&'a [u8]> {
132        self.0.get(Tag(355))
133    }
134}
135
136impl std::fmt::Debug for BidCompRspGrp<'_> {
137    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
138        write!(f, "BidCompRspGrp({})", self.0)
139    }
140}