Skip to main content

refix_fix44/generated/components/
bid_comp_req_grp.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Date, GroupTable, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::{AcctIDSource, NetGrossInd, SettlType, Side};
7
8/// An instance of the `NoBidComponents` (420) group.
9#[derive(Clone, Copy)]
10pub struct BidCompReqGrp<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for BidCompReqGrp<'a> {
13    fn from(scope: refix_message::Scope<'a>) -> Self {
14        Self(scope)
15    }
16}
17
18impl<'a> BidCompReqGrp<'a> {
19    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20        Tag(420),
21        Tag(66),
22        &[Tag(1), Tag(54), Tag(63), Tag(64), Tag(66), Tag(336), Tag(430), Tag(625), Tag(660)],
23        &[],
24    );
25
26    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
27        static TAGS: LazyKnownTags = LazyKnownTags::new(
28            &[Tag(66), Tag(54), Tag(336), Tag(625), Tag(430), Tag(63), Tag(64), Tag(1), Tag(660)],
29            &[],
30        );
31        &TAGS
32    }
33
34    pub fn raw(&self) -> refix_message::Scope<'a> {
35        self.0
36    }
37
38    /// The `ListID` (66) field.
39    #[doc(alias = "ListID")]
40    pub fn list_id(&self) -> Result<Option<&'a str>, InvalidValue> {
41        self.0.get_str(Tag(66))
42    }
43
44    /// The `Side` (54) field.
45    #[doc(alias = "Side")]
46    pub fn side(&self) -> Result<Option<Side<'a>>, InvalidValue> {
47        Ok(self.0.get_str(Tag(54))?.map(Side::from_value))
48    }
49
50    /// The `TradingSessionID` (336) field.
51    #[doc(alias = "TradingSessionID")]
52    pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
53        self.0.get_str(Tag(336))
54    }
55
56    /// The `TradingSessionSubID` (625) field.
57    #[doc(alias = "TradingSessionSubID")]
58    pub fn trading_session_sub_id(&self) -> Result<Option<&'a str>, InvalidValue> {
59        self.0.get_str(Tag(625))
60    }
61
62    /// The `NetGrossInd` (430) field.
63    #[doc(alias = "NetGrossInd")]
64    pub fn net_gross_ind(&self) -> Result<Option<NetGrossInd>, InvalidValue> {
65        Ok(self.0.get_int(Tag(430))?.map(NetGrossInd::from_value))
66    }
67
68    /// The `SettlType` (63) field.
69    #[doc(alias = "SettlType")]
70    pub fn settl_type(&self) -> Result<Option<SettlType<'a>>, InvalidValue> {
71        Ok(self.0.get_str(Tag(63))?.map(SettlType::from_value))
72    }
73
74    /// The `SettlDate` (64) field.
75    #[doc(alias = "SettlDate")]
76    pub fn settl_date(&self) -> Result<Option<Date>, InvalidValue> {
77        self.0.get_date(Tag(64))
78    }
79
80    /// The `Account` (1) field.
81    #[doc(alias = "Account")]
82    pub fn account(&self) -> Result<Option<&'a str>, InvalidValue> {
83        self.0.get_str(Tag(1))
84    }
85
86    /// The `AcctIDSource` (660) field.
87    #[doc(alias = "AcctIDSource")]
88    pub fn acct_id_source(&self) -> Result<Option<AcctIDSource>, InvalidValue> {
89        Ok(self.0.get_int(Tag(660))?.map(AcctIDSource::from_value))
90    }
91}
92
93impl std::fmt::Debug for BidCompReqGrp<'_> {
94    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
95        write!(f, "BidCompReqGrp({})", self.0)
96    }
97}