Skip to main content

refix_fix44/generated/components/
rgst_dist_inst_grp.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, GroupTable, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::DistribPaymentMethod;
7
8/// An instance of the `NoDistribInsts` (510) group.
9#[derive(Clone, Copy)]
10pub struct RgstDistInstGrp<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for RgstDistInstGrp<'a> {
13    fn from(scope: refix_message::Scope<'a>) -> Self {
14        Self(scope)
15    }
16}
17
18impl<'a> RgstDistInstGrp<'a> {
19    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20        Tag(510),
21        Tag(477),
22        &[Tag(477), Tag(478), Tag(498), Tag(499), Tag(500), Tag(501), Tag(502), Tag(512)],
23        &[],
24    );
25
26    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
27        static TAGS: LazyKnownTags = LazyKnownTags::new(
28            &[Tag(477), Tag(512), Tag(478), Tag(498), Tag(499), Tag(500), Tag(501), Tag(502)],
29            &[],
30        );
31        &TAGS
32    }
33
34    pub fn raw(&self) -> refix_message::Scope<'a> {
35        self.0
36    }
37
38    /// The `DistribPaymentMethod` (477) field.
39    #[doc(alias = "DistribPaymentMethod")]
40    pub fn distrib_payment_method(&self) -> Result<Option<DistribPaymentMethod>, InvalidValue> {
41        Ok(self.0.get_int(Tag(477))?.map(DistribPaymentMethod::from_value))
42    }
43
44    /// The `DistribPercentage` (512) field.
45    #[doc(alias = "DistribPercentage")]
46    pub fn distrib_percentage(&self) -> Result<Option<Decimal>, InvalidValue> {
47        self.0.get_decimal(Tag(512))
48    }
49
50    /// The `CashDistribCurr` (478) field.
51    #[doc(alias = "CashDistribCurr")]
52    pub fn cash_distrib_curr(&self) -> Result<Option<&'a str>, InvalidValue> {
53        self.0.get_str(Tag(478))
54    }
55
56    /// The `CashDistribAgentName` (498) field.
57    #[doc(alias = "CashDistribAgentName")]
58    pub fn cash_distrib_agent_name(&self) -> Result<Option<&'a str>, InvalidValue> {
59        self.0.get_str(Tag(498))
60    }
61
62    /// The `CashDistribAgentCode` (499) field.
63    #[doc(alias = "CashDistribAgentCode")]
64    pub fn cash_distrib_agent_code(&self) -> Result<Option<&'a str>, InvalidValue> {
65        self.0.get_str(Tag(499))
66    }
67
68    /// The `CashDistribAgentAcctNumber` (500) field.
69    #[doc(alias = "CashDistribAgentAcctNumber")]
70    pub fn cash_distrib_agent_acct_number(&self) -> Result<Option<&'a str>, InvalidValue> {
71        self.0.get_str(Tag(500))
72    }
73
74    /// The `CashDistribPayRef` (501) field.
75    #[doc(alias = "CashDistribPayRef")]
76    pub fn cash_distrib_pay_ref(&self) -> Result<Option<&'a str>, InvalidValue> {
77        self.0.get_str(Tag(501))
78    }
79
80    /// The `CashDistribAgentAcctName` (502) field.
81    #[doc(alias = "CashDistribAgentAcctName")]
82    pub fn cash_distrib_agent_acct_name(&self) -> Result<Option<&'a str>, InvalidValue> {
83        self.0.get_str(Tag(502))
84    }
85}
86
87impl std::fmt::Debug for RgstDistInstGrp<'_> {
88    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
89        write!(f, "RgstDistInstGrp({})", self.0)
90    }
91}