refix_fix44/generated/components/
leg_pre_alloc_grp.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, Tag};
5
6use super::NestedParties2;
7
8#[derive(Clone, Copy)]
10pub struct LegPreAllocGrp<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for LegPreAllocGrp<'a> {
13 fn from(scope: refix_message::Scope<'a>) -> Self {
14 Self(scope)
15 }
16}
17
18impl<'a> LegPreAllocGrp<'a> {
19 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20 Tag(670),
21 Tag(671),
22 &[Tag(671), Tag(672), Tag(673), Tag(674), Tag(675), Tag(756)],
23 &[NestedParties2::TABLE],
24 );
25
26 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
27 static TAGS: LazyKnownTags = LazyKnownTags::new(
28 &[Tag(671), Tag(672), Tag(756), Tag(673), Tag(674), Tag(675)],
29 &[NestedParties2::known_tags()],
30 );
31 &TAGS
32 }
33
34 pub fn raw(&self) -> refix_message::Scope<'a> {
35 self.0
36 }
37
38 #[doc(alias = "LegAllocAccount")]
40 pub fn leg_alloc_account(&self) -> Result<Option<&'a str>, InvalidValue> {
41 self.0.get_str(Tag(671))
42 }
43
44 #[doc(alias = "LegIndividualAllocID")]
46 pub fn leg_individual_alloc_id(&self) -> Result<Option<&'a str>, InvalidValue> {
47 self.0.get_str(Tag(672))
48 }
49
50 #[doc(alias = "NoNested2PartyIDs")]
52 pub fn nested2_party_ids(&self) -> Result<Instances<'a, NestedParties2<'a>>, InvalidValue> {
53 self.0.get_group(&NestedParties2::TABLE, &Self::known_tags().get()).map(Instances::from)
54 }
55
56 #[doc(alias = "LegAllocQty")]
58 pub fn leg_alloc_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
59 self.0.get_decimal(Tag(673))
60 }
61
62 #[doc(alias = "LegAllocAcctIDSource")]
64 pub fn leg_alloc_acct_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
65 self.0.get_str(Tag(674))
66 }
67
68 #[doc(alias = "LegSettlCurrency")]
70 pub fn leg_settl_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
71 self.0.get_str(Tag(675))
72 }
73}
74
75impl std::fmt::Debug for LegPreAllocGrp<'_> {
76 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
77 write!(f, "LegPreAllocGrp({})", self.0)
78 }
79}