Skip to main content

refix_fix44/generated/components/
nested_parties3.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::NstdPtys3SubGrp;
7
8/// An instance of the `NoNested3PartyIDs` (948) group.
9#[derive(Clone, Copy)]
10pub struct NestedParties3<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for NestedParties3<'a> {
13    fn from(scope: refix_message::Scope<'a>) -> Self {
14        Self(scope)
15    }
16}
17
18impl<'a> NestedParties3<'a> {
19    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20        Tag(948),
21        Tag(949),
22        &[Tag(949), Tag(950), Tag(951), Tag(952)],
23        &[NstdPtys3SubGrp::TABLE],
24    );
25
26    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
27        static TAGS: LazyKnownTags = LazyKnownTags::new(
28            &[Tag(949), Tag(950), Tag(951), Tag(952)],
29            &[NstdPtys3SubGrp::known_tags()],
30        );
31        &TAGS
32    }
33
34    pub fn raw(&self) -> refix_message::Scope<'a> {
35        self.0
36    }
37
38    /// The `Nested3PartyID` (949) field.
39    #[doc(alias = "Nested3PartyID")]
40    pub fn nested3_party_id(&self) -> Result<Option<&'a str>, InvalidValue> {
41        self.0.get_str(Tag(949))
42    }
43
44    /// The `Nested3PartyIDSource` (950) field.
45    #[doc(alias = "Nested3PartyIDSource")]
46    pub fn nested3_party_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
47        self.0.get_str(Tag(950))
48    }
49
50    /// The `Nested3PartyRole` (951) field.
51    #[doc(alias = "Nested3PartyRole")]
52    pub fn nested3_party_role(&self) -> Result<Option<i64>, InvalidValue> {
53        self.0.get_int(Tag(951))
54    }
55
56    /// The instances of the `NoNested3PartySubIDs` (952) group.
57    #[doc(alias = "NoNested3PartySubIDs")]
58    pub fn nested3_party_sub_ids(&self) -> Result<Instances<'a, NstdPtys3SubGrp<'a>>, InvalidValue> {
59        self.0.get_group(&NstdPtys3SubGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
60    }
61}
62
63impl std::fmt::Debug for NestedParties3<'_> {
64    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
65        write!(f, "NestedParties3({})", self.0)
66    }
67}