refix_fix44/generated/components/
rgst_dist_inst_grp.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, GroupTable, InvalidValue, LazyKnownTags, Tag};
5
6use super::super::enums::DistribPaymentMethod;
7
8#[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 #[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 #[doc(alias = "DistribPercentage")]
46 pub fn distrib_percentage(&self) -> Result<Option<Decimal>, InvalidValue> {
47 self.0.get_decimal(Tag(512))
48 }
49
50 #[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 #[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 #[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 #[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 #[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 #[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}