refix_fix44/generated/components/
nested_parties.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{GroupTable, Instances, InvalidValue, LazyKnownTags, Tag};
5
6use super::NstdPtysSubGrp;
7
8#[derive(Clone, Copy)]
10pub struct NestedParties<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for NestedParties<'a> {
13 fn from(scope: refix_message::Scope<'a>) -> Self {
14 Self(scope)
15 }
16}
17
18impl<'a> NestedParties<'a> {
19 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20 Tag(539),
21 Tag(524),
22 &[Tag(524), Tag(525), Tag(538), Tag(804)],
23 &[NstdPtysSubGrp::TABLE],
24 );
25
26 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
27 static TAGS: LazyKnownTags = LazyKnownTags::new(
28 &[Tag(524), Tag(525), Tag(538), Tag(804)],
29 &[NstdPtysSubGrp::known_tags()],
30 );
31 &TAGS
32 }
33
34 pub fn raw(&self) -> refix_message::Scope<'a> {
35 self.0
36 }
37
38 #[doc(alias = "NestedPartyID")]
40 pub fn nested_party_id(&self) -> Result<Option<&'a str>, InvalidValue> {
41 self.0.get_str(Tag(524))
42 }
43
44 #[doc(alias = "NestedPartyIDSource")]
46 pub fn nested_party_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
47 self.0.get_str(Tag(525))
48 }
49
50 #[doc(alias = "NestedPartyRole")]
52 pub fn nested_party_role(&self) -> Result<Option<i64>, InvalidValue> {
53 self.0.get_int(Tag(538))
54 }
55
56 #[doc(alias = "NoNestedPartySubIDs")]
58 pub fn nested_party_sub_ids(&self) -> Result<Instances<'a, NstdPtysSubGrp<'a>>, InvalidValue> {
59 self.0.get_group(&NstdPtysSubGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
60 }
61}
62
63impl std::fmt::Debug for NestedParties<'_> {
64 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
65 write!(f, "NestedParties({})", self.0)
66 }
67}