#![cfg_attr(rustfmt, rustfmt::skip)]
use refix_message::{
Date, Decimal, Instances, InvalidValue, KnownTags, LazyKnownTags, MonthYear, Tag,
};
use super::{UndSecAltIDGrp, UnderlyingStipulations};
#[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
}
#[doc(alias = "UnderlyingSymbol")]
pub fn underlying_symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(311))
}
#[doc(alias = "UnderlyingSymbolSfx")]
pub fn underlying_symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(312))
}
#[doc(alias = "UnderlyingSecurityID")]
pub fn underlying_security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(309))
}
#[doc(alias = "UnderlyingSecurityIDSource")]
pub fn underlying_security_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(305))
}
#[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)
}
#[doc(alias = "UnderlyingProduct")]
pub fn underlying_product(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(462))
}
#[doc(alias = "UnderlyingCFICode")]
pub fn underlying_cfi_code(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(463))
}
#[doc(alias = "UnderlyingSecurityType")]
pub fn underlying_security_type(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(310))
}
#[doc(alias = "UnderlyingSecuritySubType")]
pub fn underlying_security_sub_type(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(763))
}
#[doc(alias = "UnderlyingMaturityMonthYear")]
pub fn underlying_maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
self.0.get_month_year(Tag(313))
}
#[doc(alias = "UnderlyingMaturityDate")]
pub fn underlying_maturity_date(&self) -> Result<Option<Date>, InvalidValue> {
self.0.get_date(Tag(542))
}
#[doc(alias = "UnderlyingPutOrCall")]
pub fn underlying_put_or_call(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(315))
}
#[doc(alias = "UnderlyingCouponPaymentDate")]
pub fn underlying_coupon_payment_date(&self) -> Result<Option<Date>, InvalidValue> {
self.0.get_date(Tag(241))
}
#[doc(alias = "UnderlyingIssueDate")]
pub fn underlying_issue_date(&self) -> Result<Option<Date>, InvalidValue> {
self.0.get_date(Tag(242))
}
#[doc(alias = "UnderlyingRepoCollateralSecurityType")]
pub fn underlying_repo_collateral_security_type(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(243))
}
#[doc(alias = "UnderlyingRepurchaseTerm")]
pub fn underlying_repurchase_term(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(244))
}
#[doc(alias = "UnderlyingRepurchaseRate")]
pub fn underlying_repurchase_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(245))
}
#[doc(alias = "UnderlyingFactor")]
pub fn underlying_factor(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(246))
}
#[doc(alias = "UnderlyingCreditRating")]
pub fn underlying_credit_rating(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(256))
}
#[doc(alias = "UnderlyingInstrRegistry")]
pub fn underlying_instr_registry(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(595))
}
#[doc(alias = "UnderlyingCountryOfIssue")]
pub fn underlying_country_of_issue(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(592))
}
#[doc(alias = "UnderlyingStateOrProvinceOfIssue")]
pub fn underlying_state_or_province_of_issue(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(593))
}
#[doc(alias = "UnderlyingLocaleOfIssue")]
pub fn underlying_locale_of_issue(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(594))
}
#[doc(alias = "UnderlyingRedemptionDate")]
pub fn underlying_redemption_date(&self) -> Result<Option<Date>, InvalidValue> {
self.0.get_date(Tag(247))
}
#[doc(alias = "UnderlyingStrikePrice")]
pub fn underlying_strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(316))
}
#[doc(alias = "UnderlyingStrikeCurrency")]
pub fn underlying_strike_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(941))
}
#[doc(alias = "UnderlyingOptAttribute")]
pub fn underlying_opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(317))
}
#[doc(alias = "UnderlyingContractMultiplier")]
pub fn underlying_contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(436))
}
#[doc(alias = "UnderlyingCouponRate")]
pub fn underlying_coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(435))
}
#[doc(alias = "UnderlyingSecurityExchange")]
pub fn underlying_security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(308))
}
#[doc(alias = "UnderlyingIssuer")]
pub fn underlying_issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(306))
}
#[doc(alias = "EncodedUnderlyingIssuerLen")]
pub fn encoded_underlying_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(362))
}
#[doc(alias = "EncodedUnderlyingIssuer")]
pub fn encoded_underlying_issuer(&self) -> Option<&'a [u8]> {
self.0.get(Tag(363))
}
#[doc(alias = "UnderlyingSecurityDesc")]
pub fn underlying_security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(307))
}
#[doc(alias = "EncodedUnderlyingSecurityDescLen")]
pub fn encoded_underlying_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(364))
}
#[doc(alias = "EncodedUnderlyingSecurityDesc")]
pub fn encoded_underlying_security_desc(&self) -> Option<&'a [u8]> {
self.0.get(Tag(365))
}
#[doc(alias = "UnderlyingCPProgram")]
pub fn underlying_cp_program(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(877))
}
#[doc(alias = "UnderlyingCPRegType")]
pub fn underlying_cp_reg_type(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(878))
}
#[doc(alias = "UnderlyingCurrency")]
pub fn underlying_currency(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(318))
}
#[doc(alias = "UnderlyingQty")]
pub fn underlying_qty(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(879))
}
#[doc(alias = "UnderlyingPx")]
pub fn underlying_px(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(810))
}
#[doc(alias = "UnderlyingDirtyPrice")]
pub fn underlying_dirty_price(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(882))
}
#[doc(alias = "UnderlyingEndPrice")]
pub fn underlying_end_price(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(883))
}
#[doc(alias = "UnderlyingStartValue")]
pub fn underlying_start_value(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(884))
}
#[doc(alias = "UnderlyingCurrentValue")]
pub fn underlying_current_value(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(885))
}
#[doc(alias = "UnderlyingEndValue")]
pub fn underlying_end_value(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(886))
}
#[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()))
}
}