refix-fix44 0.12.0

Typed FIX 4.4 protocol messages for the ReFIX engine
Documentation
// @generated by refix codegen from FIX44.xml. Do not edit.
#![cfg_attr(rustfmt, rustfmt::skip)]

use refix_message::{GroupTable, Instances, InvalidValue, LazyKnownTags, Tag};

use super::{QuotEntryAckGrp, UndSecAltIDGrp, UnderlyingInstrument, UnderlyingStipulations};

/// An instance of the `NoQuoteSets` (296) group.
#[derive(Clone, Copy)]
pub struct QuotSetAckGrp<'a>(refix_message::Scope<'a>);

impl<'a> From<refix_message::Scope<'a>> for QuotSetAckGrp<'a> {
    fn from(scope: refix_message::Scope<'a>) -> Self {
        Self(scope)
    }
}

impl<'a> QuotSetAckGrp<'a> {
    pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
        Tag(296),
        Tag(302),
        &[
            Tag(241), Tag(242), Tag(243), Tag(244), Tag(245), Tag(246), Tag(247), Tag(256),
            Tag(295), Tag(302), Tag(304), Tag(305), Tag(306), Tag(307), Tag(308), Tag(309),
            Tag(310), Tag(311), Tag(312), Tag(313), Tag(315), Tag(316), Tag(317), Tag(318),
            Tag(362), Tag(363), Tag(364), Tag(365), Tag(435), Tag(436), Tag(457), Tag(462),
            Tag(463), Tag(542), Tag(592), Tag(593), Tag(594), Tag(595), Tag(763), Tag(810),
            Tag(877), Tag(878), Tag(879), Tag(882), Tag(883), Tag(884), Tag(885), Tag(886),
            Tag(887), Tag(893), Tag(941),
        ],
        &[UndSecAltIDGrp::TABLE, UnderlyingStipulations::TABLE, QuotEntryAckGrp::TABLE],
    );

    pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
        static TAGS: LazyKnownTags = LazyKnownTags::new(
            &[Tag(302), Tag(304), Tag(893), Tag(295)],
            &[UnderlyingInstrument::known_tags(), QuotEntryAckGrp::known_tags()],
        );
        &TAGS
    }

    pub fn raw(&self) -> refix_message::Scope<'a> {
        self.0
    }

    /// The `QuoteSetID` (302) field.
    #[doc(alias = "QuoteSetID")]
    pub fn quote_set_id(&self) -> Result<Option<&'a str>, InvalidValue> {
        self.0.get_str(Tag(302))
    }

    /// The `UnderlyingInstrument` component.
    pub fn underlying_instrument(&self) -> UnderlyingInstrument<'a> {
        UnderlyingInstrument(self.0, Self::known_tags().get())
    }

    /// The `TotNoQuoteEntries` (304) field.
    #[doc(alias = "TotNoQuoteEntries")]
    pub fn tot_no_quote_entries(&self) -> Result<Option<i64>, InvalidValue> {
        self.0.get_int(Tag(304))
    }

    /// The `LastFragment` (893) field.
    #[doc(alias = "LastFragment")]
    pub fn last_fragment(&self) -> Result<Option<bool>, InvalidValue> {
        self.0.get_bool(Tag(893))
    }

    /// The instances of the `NoQuoteEntries` (295) group.
    #[doc(alias = "NoQuoteEntries")]
    pub fn quote_entries(&self) -> Result<Instances<'a, QuotEntryAckGrp<'a>>, InvalidValue> {
        self.0.get_group(&QuotEntryAckGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
    }
}

impl std::fmt::Debug for QuotSetAckGrp<'_> {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "QuotSetAckGrp({})", self.0)
    }
}