Skip to main content

refix_fix44/generated/components/
nested_parties2.rs

1// @generated by refix codegen from FIX44.xml. Do not edit.
2#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{GroupTable, Instances, InvalidValue, LazyKnownTags, Tag};
5
6use super::NstdPtys2SubGrp;
7
8/// An instance of the `NoNested2PartyIDs` (756) group.
9#[derive(Clone, Copy)]
10pub struct NestedParties2<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for NestedParties2<'a> {
13    fn from(scope: refix_message::Scope<'a>) -> Self {
14        Self(scope)
15    }
16}
17
18impl<'a> NestedParties2<'a> {
19    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20        Tag(756),
21        Tag(757),
22        &[Tag(757), Tag(758), Tag(759), Tag(806)],
23        &[NstdPtys2SubGrp::TABLE],
24    );
25
26    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
27        static TAGS: LazyKnownTags = LazyKnownTags::new(
28            &[Tag(757), Tag(758), Tag(759), Tag(806)],
29            &[NstdPtys2SubGrp::known_tags()],
30        );
31        &TAGS
32    }
33
34    pub fn raw(&self) -> refix_message::Scope<'a> {
35        self.0
36    }
37
38    /// The `Nested2PartyID` (757) field.
39    #[doc(alias = "Nested2PartyID")]
40    pub fn nested2_party_id(&self) -> Result<Option<&'a str>, InvalidValue> {
41        self.0.get_str(Tag(757))
42    }
43
44    /// The `Nested2PartyIDSource` (758) field.
45    #[doc(alias = "Nested2PartyIDSource")]
46    pub fn nested2_party_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
47        self.0.get_str(Tag(758))
48    }
49
50    /// The `Nested2PartyRole` (759) field.
51    #[doc(alias = "Nested2PartyRole")]
52    pub fn nested2_party_role(&self) -> Result<Option<i64>, InvalidValue> {
53        self.0.get_int(Tag(759))
54    }
55
56    /// The instances of the `NoNested2PartySubIDs` (806) group.
57    #[doc(alias = "NoNested2PartySubIDs")]
58    pub fn nested2_party_sub_ids(&self) -> Result<Instances<'a, NstdPtys2SubGrp<'a>>, InvalidValue> {
59        self.0.get_group(&NstdPtys2SubGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
60    }
61}
62
63impl std::fmt::Debug for NestedParties2<'_> {
64    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
65        write!(f, "NestedParties2({})", self.0)
66    }
67}