#![cfg_attr(rustfmt, rustfmt::skip)]
use refix_message::{
Date, Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, MonthYear, RawMessage, Tag,
UtcTimestamp,
};
use super::super::components::{Header, Trailer};
use super::super::enums::{IDSource, OrdType, PutOrCall, QuoteResponseLevel, SecurityType};
pub struct MassQuote(RawMessage);
impl MassQuote {
pub const MSG_TYPE: &[u8] = b"i";
pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
static TAGS: LazyKnownTags = LazyKnownTags::new(
&[Tag(131), Tag(117), Tag(301), Tag(293), Tag(294), Tag(296)],
&[Header::known_tags(), Trailer::known_tags(), MassQuoteQuoteSets::known_tags()],
);
&TAGS
}
pub fn from_raw(raw: RawMessage) -> Self {
Self(raw)
}
pub fn raw(&self) -> &RawMessage {
&self.0
}
pub fn header(&self) -> Header<'_> {
Header(self.0.scope())
}
pub fn trailer(&self) -> Trailer<'_> {
Trailer(self.0.scope())
}
#[doc(alias = "QuoteReqID")]
pub fn quote_req_id(&self) -> Result<Option<&str>, InvalidValue> {
self.0.get_str(Tag(131))
}
#[doc(alias = "QuoteID")]
pub fn quote_id(&self) -> Result<Option<&str>, InvalidValue> {
self.0.get_str(Tag(117))
}
#[doc(alias = "QuoteResponseLevel")]
pub fn quote_response_level(&self) -> Result<Option<QuoteResponseLevel>, InvalidValue> {
Ok(self.0.get_int(Tag(301))?.map(QuoteResponseLevel::from_value))
}
#[doc(alias = "DefBidSize")]
pub fn def_bid_size(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(293))
}
#[doc(alias = "DefOfferSize")]
pub fn def_offer_size(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(294))
}
#[doc(alias = "NoQuoteSets")]
pub fn quote_sets(&self) -> Result<Instances<'_, MassQuoteQuoteSets<'_>>, InvalidValue> {
self.0.get_group(&MassQuoteQuoteSets::TABLE, &Self::known_tags().get()).map(Instances::from)
}
}
impl std::fmt::Debug for MassQuote {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "MassQuote({})", self.0)
}
}
impl std::fmt::Display for MassQuote {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(&self.0, f)
}
}
#[derive(Clone, Copy)]
pub struct MassQuoteQuoteSets<'a>(refix_message::Scope<'a>);
impl<'a> From<refix_message::Scope<'a>> for MassQuoteQuoteSets<'a> {
fn from(scope: refix_message::Scope<'a>) -> Self {
Self(scope)
}
}
impl<'a> MassQuoteQuoteSets<'a> {
pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
Tag(296),
Tag(302),
&[
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(314), Tag(315), Tag(316), Tag(317),
Tag(362), Tag(363), Tag(364), Tag(365), Tag(367), Tag(435), Tag(436),
],
&[MassQuoteQuoteSetsQuoteEntries::TABLE],
);
pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
static TAGS: LazyKnownTags = LazyKnownTags::new(
&[
Tag(302), Tag(311), Tag(312), Tag(309), Tag(305), Tag(310), Tag(313), Tag(314),
Tag(315), Tag(316), Tag(317), Tag(436), Tag(435), Tag(308), Tag(306), Tag(362),
Tag(363), Tag(307), Tag(364), Tag(365), Tag(367), Tag(304), Tag(295),
],
&[MassQuoteQuoteSetsQuoteEntries::known_tags()],
);
&TAGS
}
pub fn raw(&self) -> refix_message::Scope<'a> {
self.0
}
#[doc(alias = "QuoteSetID")]
pub fn quote_set_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(302))
}
#[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 = "UnderlyingIDSource")]
pub fn underlying_id_source(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(305))
}
#[doc(alias = "UnderlyingSecurityType")]
pub fn underlying_security_type(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(310))
}
#[doc(alias = "UnderlyingMaturityMonthYear")]
pub fn underlying_maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
self.0.get_month_year(Tag(313))
}
#[doc(alias = "UnderlyingMaturityDay")]
pub fn underlying_maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(314))
}
#[doc(alias = "UnderlyingPutOrCall")]
pub fn underlying_put_or_call(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(315))
}
#[doc(alias = "UnderlyingStrikePrice")]
pub fn underlying_strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(316))
}
#[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 = "QuoteSetValidUntilTime")]
pub fn quote_set_valid_until_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
self.0.get_utc_timestamp(Tag(367))
}
#[doc(alias = "TotQuoteEntries")]
pub fn tot_quote_entries(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(304))
}
#[doc(alias = "NoQuoteEntries")]
pub fn quote_entries(&self) -> Result<Instances<'a, MassQuoteQuoteSetsQuoteEntries<'a>>, InvalidValue> {
self.0.get_group(&MassQuoteQuoteSetsQuoteEntries::TABLE, &Self::known_tags().get()).map(Instances::from)
}
}
impl std::fmt::Debug for MassQuoteQuoteSets<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "MassQuoteQuoteSets({})", self.0)
}
}
#[derive(Clone, Copy)]
pub struct MassQuoteQuoteSetsQuoteEntries<'a>(refix_message::Scope<'a>);
impl<'a> From<refix_message::Scope<'a>> for MassQuoteQuoteSetsQuoteEntries<'a> {
fn from(scope: refix_message::Scope<'a>) -> Self {
Self(scope)
}
}
impl<'a> MassQuoteQuoteSetsQuoteEntries<'a> {
pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
Tag(295),
Tag(299),
&[
Tag(15), Tag(22), Tag(40), Tag(48), Tag(55), Tag(60), Tag(62), Tag(64), Tag(65),
Tag(106), Tag(107), Tag(132), Tag(133), Tag(134), Tag(135), Tag(167), Tag(188),
Tag(189), Tag(190), Tag(191), Tag(192), Tag(193), Tag(200), Tag(201), Tag(202),
Tag(205), Tag(206), Tag(207), Tag(223), Tag(231), Tag(299), Tag(336), Tag(348),
Tag(349), Tag(350), Tag(351),
],
&[],
);
pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
static TAGS: LazyKnownTags = LazyKnownTags::new(
&[
Tag(299), Tag(55), Tag(65), Tag(48), Tag(22), Tag(167), Tag(200), Tag(205),
Tag(201), Tag(202), Tag(206), Tag(231), Tag(223), Tag(207), Tag(106), Tag(348),
Tag(349), Tag(107), Tag(350), Tag(351), Tag(132), Tag(133), Tag(134), Tag(135),
Tag(62), Tag(188), Tag(190), Tag(189), Tag(191), Tag(60), Tag(336), Tag(64),
Tag(40), Tag(193), Tag(192), Tag(15),
],
&[],
);
&TAGS
}
pub fn raw(&self) -> refix_message::Scope<'a> {
self.0
}
#[doc(alias = "QuoteEntryID")]
pub fn quote_entry_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(299))
}
#[doc(alias = "Symbol")]
pub fn symbol(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(55))
}
#[doc(alias = "SymbolSfx")]
pub fn symbol_sfx(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(65))
}
#[doc(alias = "SecurityID")]
pub fn security_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(48))
}
#[doc(alias = "IDSource")]
pub fn id_source(&self) -> Result<Option<IDSource<'a>>, InvalidValue> {
Ok(self.0.get_str(Tag(22))?.map(IDSource::from_value))
}
#[doc(alias = "SecurityType")]
pub fn security_type(&self) -> Result<Option<SecurityType<'a>>, InvalidValue> {
Ok(self.0.get_str(Tag(167))?.map(SecurityType::from_value))
}
#[doc(alias = "MaturityMonthYear")]
pub fn maturity_month_year(&self) -> Result<Option<MonthYear>, InvalidValue> {
self.0.get_month_year(Tag(200))
}
#[doc(alias = "MaturityDay")]
pub fn maturity_day(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(205))
}
#[doc(alias = "PutOrCall")]
pub fn put_or_call(&self) -> Result<Option<PutOrCall>, InvalidValue> {
Ok(self.0.get_int(Tag(201))?.map(PutOrCall::from_value))
}
#[doc(alias = "StrikePrice")]
pub fn strike_price(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(202))
}
#[doc(alias = "OptAttribute")]
pub fn opt_attribute(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(206))
}
#[doc(alias = "ContractMultiplier")]
pub fn contract_multiplier(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(231))
}
#[doc(alias = "CouponRate")]
pub fn coupon_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(223))
}
#[doc(alias = "SecurityExchange")]
pub fn security_exchange(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(207))
}
#[doc(alias = "Issuer")]
pub fn issuer(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(106))
}
#[doc(alias = "EncodedIssuerLen")]
pub fn encoded_issuer_len(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(348))
}
#[doc(alias = "EncodedIssuer")]
pub fn encoded_issuer(&self) -> Option<&'a [u8]> {
self.0.get(Tag(349))
}
#[doc(alias = "SecurityDesc")]
pub fn security_desc(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(107))
}
#[doc(alias = "EncodedSecurityDescLen")]
pub fn encoded_security_desc_len(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(350))
}
#[doc(alias = "EncodedSecurityDesc")]
pub fn encoded_security_desc(&self) -> Option<&'a [u8]> {
self.0.get(Tag(351))
}
#[doc(alias = "BidPx")]
pub fn bid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(132))
}
#[doc(alias = "OfferPx")]
pub fn offer_px(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(133))
}
#[doc(alias = "BidSize")]
pub fn bid_size(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(134))
}
#[doc(alias = "OfferSize")]
pub fn offer_size(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(135))
}
#[doc(alias = "ValidUntilTime")]
pub fn valid_until_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
self.0.get_utc_timestamp(Tag(62))
}
#[doc(alias = "BidSpotRate")]
pub fn bid_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(188))
}
#[doc(alias = "OfferSpotRate")]
pub fn offer_spot_rate(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(190))
}
#[doc(alias = "BidForwardPoints")]
pub fn bid_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(189))
}
#[doc(alias = "OfferForwardPoints")]
pub fn offer_forward_points(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(191))
}
#[doc(alias = "TransactTime")]
pub fn transact_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
self.0.get_utc_timestamp(Tag(60))
}
#[doc(alias = "TradingSessionID")]
pub fn trading_session_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(336))
}
#[doc(alias = "FutSettDate")]
pub fn fut_sett_date(&self) -> Result<Option<Date>, InvalidValue> {
self.0.get_date(Tag(64))
}
#[doc(alias = "OrdType")]
pub fn ord_type(&self) -> Result<Option<OrdType<'a>>, InvalidValue> {
Ok(self.0.get_str(Tag(40))?.map(OrdType::from_value))
}
#[doc(alias = "FutSettDate2")]
pub fn fut_sett_date2(&self) -> Result<Option<Date>, InvalidValue> {
self.0.get_date(Tag(193))
}
#[doc(alias = "OrderQty2")]
pub fn order_qty2(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(192))
}
#[doc(alias = "Currency")]
pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(15))
}
}
impl std::fmt::Debug for MassQuoteQuoteSetsQuoteEntries<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "MassQuoteQuoteSetsQuoteEntries({})", self.0)
}
}