#![cfg_attr(rustfmt, rustfmt::skip)]
use refix_message::{GroupTable, Instances, InvalidValue, LazyKnownTags, Tag};
use super::NstdPtys2SubGrp;
#[derive(Clone, Copy)]
pub struct NestedParties2<'a>(refix_message::Scope<'a>);
impl<'a> From<refix_message::Scope<'a>> for NestedParties2<'a> {
fn from(scope: refix_message::Scope<'a>) -> Self {
Self(scope)
}
}
impl<'a> NestedParties2<'a> {
pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
Tag(756),
Tag(757),
&[Tag(757), Tag(758), Tag(759), Tag(806)],
&[NstdPtys2SubGrp::TABLE],
);
pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
static TAGS: LazyKnownTags = LazyKnownTags::new(
&[Tag(757), Tag(758), Tag(759), Tag(806)],
&[NstdPtys2SubGrp::known_tags()],
);
&TAGS
}
pub fn raw(&self) -> refix_message::Scope<'a> {
self.0
}
#[doc(alias = "Nested2PartyID")]
pub fn nested2_party_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(757))
}
#[doc(alias = "Nested2PartyIDSource")]
pub fn nested2_party_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(758))
}
#[doc(alias = "Nested2PartyRole")]
pub fn nested2_party_role(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(759))
}
#[doc(alias = "NoNested2PartySubIDs")]
pub fn nested2_party_sub_ids(&self) -> Result<Instances<'a, NstdPtys2SubGrp<'a>>, InvalidValue> {
self.0.get_group(&NstdPtys2SubGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
}
}
impl std::fmt::Debug for NestedParties2<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "NestedParties2({})", self.0)
}
}