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::{
    Date, Decimal, Instances, InvalidValue, KnownTags, LazyKnownTags, MonthYear, Tag,
};

use super::{UndSecAltIDGrp, UnderlyingStipulations};

/// The fields of the `UnderlyingInstrument` component.
#[derive(Clone, Copy)]
pub struct UnderlyingInstrument<'a>(
    pub(in super::super) refix_message::Scope<'a>,
    pub(in super::super) KnownTags<'static>,
);

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

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

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

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

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

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

    /// The instances of the `NoUnderlyingSecurityAltID` (457) group.
    #[doc(alias = "NoUnderlyingSecurityAltID")]
    pub fn underlying_security_alt_id(&self) -> Result<Instances<'a, UndSecAltIDGrp<'a>>, InvalidValue> {
        self.0.get_group(&UndSecAltIDGrp::TABLE, &self.1).map(Instances::from)
    }

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

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

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

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

    /// The `UnderlyingMaturityMonthYear` (313) field.
    #[doc(alias = "UnderlyingMaturityMonthYear")]
    pub fn underlying_maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
        self.0.get_month_year(Tag(313))
    }

    /// The `UnderlyingMaturityDate` (542) field.
    #[doc(alias = "UnderlyingMaturityDate")]
    pub fn underlying_maturity_date(&self) -> Result<Option<Date>, InvalidValue> {
        self.0.get_date(Tag(542))
    }

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

    /// The `UnderlyingCouponPaymentDate` (241) field.
    #[doc(alias = "UnderlyingCouponPaymentDate")]
    pub fn underlying_coupon_payment_date(&self) -> Result<Option<Date>, InvalidValue> {
        self.0.get_date(Tag(241))
    }

    /// The `UnderlyingIssueDate` (242) field.
    #[doc(alias = "UnderlyingIssueDate")]
    pub fn underlying_issue_date(&self) -> Result<Option<Date>, InvalidValue> {
        self.0.get_date(Tag(242))
    }

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

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

    /// The `UnderlyingRepurchaseRate` (245) field.
    #[doc(alias = "UnderlyingRepurchaseRate")]
    pub fn underlying_repurchase_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(245))
    }

    /// The `UnderlyingFactor` (246) field.
    #[doc(alias = "UnderlyingFactor")]
    pub fn underlying_factor(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(246))
    }

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

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

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

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

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

    /// The `UnderlyingRedemptionDate` (247) field.
    #[doc(alias = "UnderlyingRedemptionDate")]
    pub fn underlying_redemption_date(&self) -> Result<Option<Date>, InvalidValue> {
        self.0.get_date(Tag(247))
    }

    /// The `UnderlyingStrikePrice` (316) field.
    #[doc(alias = "UnderlyingStrikePrice")]
    pub fn underlying_strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(316))
    }

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

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

    /// The `UnderlyingContractMultiplier` (436) field.
    #[doc(alias = "UnderlyingContractMultiplier")]
    pub fn underlying_contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(436))
    }

    /// The `UnderlyingCouponRate` (435) field.
    #[doc(alias = "UnderlyingCouponRate")]
    pub fn underlying_coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(435))
    }

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

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

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

    /// The `EncodedUnderlyingIssuer` (363) field.
    #[doc(alias = "EncodedUnderlyingIssuer")]
    pub fn encoded_underlying_issuer(&self) -> Option<&'a [u8]> {
        self.0.get(Tag(363))
    }

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

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

    /// The `EncodedUnderlyingSecurityDesc` (365) field.
    #[doc(alias = "EncodedUnderlyingSecurityDesc")]
    pub fn encoded_underlying_security_desc(&self) -> Option<&'a [u8]> {
        self.0.get(Tag(365))
    }

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

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

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

    /// The `UnderlyingQty` (879) field.
    #[doc(alias = "UnderlyingQty")]
    pub fn underlying_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(879))
    }

    /// The `UnderlyingPx` (810) field.
    #[doc(alias = "UnderlyingPx")]
    pub fn underlying_px(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(810))
    }

    /// The `UnderlyingDirtyPrice` (882) field.
    #[doc(alias = "UnderlyingDirtyPrice")]
    pub fn underlying_dirty_price(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(882))
    }

    /// The `UnderlyingEndPrice` (883) field.
    #[doc(alias = "UnderlyingEndPrice")]
    pub fn underlying_end_price(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(883))
    }

    /// The `UnderlyingStartValue` (884) field.
    #[doc(alias = "UnderlyingStartValue")]
    pub fn underlying_start_value(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(884))
    }

    /// The `UnderlyingCurrentValue` (885) field.
    #[doc(alias = "UnderlyingCurrentValue")]
    pub fn underlying_current_value(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(885))
    }

    /// The `UnderlyingEndValue` (886) field.
    #[doc(alias = "UnderlyingEndValue")]
    pub fn underlying_end_value(&self) -> Result<Option<Decimal>, InvalidValue> {
        self.0.get_decimal(Tag(886))
    }

    /// The instances of the `NoUnderlyingStips` (887) group.
    #[doc(alias = "NoUnderlyingStips")]
    pub fn underlying_stips(&self) -> Result<Instances<'a, UnderlyingStipulations<'a>>, InvalidValue> {
        self.0.get_group(&UnderlyingStipulations::TABLE, &self.1).map(Instances::from)
    }
}

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