#![cfg_attr(rustfmt, rustfmt::skip)]
use refix_message::{
Date, Decimal, GroupTable, Instances, InvalidValue, LazyKnownTags, Tag, UtcTimestamp,
};
use super::super::enums::OrdType;
use super::{EvntGrp, InstrmtLegGrp, Instrument, SecAltIDGrp};
#[derive(Clone, Copy)]
pub struct QuotEntryAckGrp<'a>(refix_message::Scope<'a>);
impl<'a> From<refix_message::Scope<'a>> for QuotEntryAckGrp<'a> {
fn from(scope: refix_message::Scope<'a>) -> Self {
Self(scope)
}
}
impl<'a> QuotEntryAckGrp<'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(206), Tag(207), Tag(223), Tag(224), Tag(225), Tag(226), Tag(227), Tag(228),
Tag(231), Tag(239), Tag(240), Tag(255), Tag(299), Tag(336), Tag(348), Tag(349),
Tag(350), Tag(351), Tag(368), Tag(454), Tag(460), Tag(461), Tag(470), Tag(471),
Tag(472), Tag(541), Tag(543), Tag(555), Tag(625), Tag(631), Tag(632), Tag(633),
Tag(634), Tag(642), Tag(643), Tag(667), Tag(691), Tag(762), Tag(864), Tag(873),
Tag(874), Tag(875), Tag(876), Tag(947),
],
&[SecAltIDGrp::TABLE, EvntGrp::TABLE, InstrmtLegGrp::TABLE],
);
pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
static TAGS: LazyKnownTags = LazyKnownTags::new(
&[
Tag(299), Tag(555), Tag(132), Tag(133), Tag(134), Tag(135), Tag(62), Tag(188),
Tag(190), Tag(189), Tag(191), Tag(631), Tag(632), Tag(633), Tag(634), Tag(60),
Tag(336), Tag(625), Tag(64), Tag(40), Tag(193), Tag(192), Tag(642), Tag(643),
Tag(15), Tag(368),
],
&[Instrument::known_tags(), InstrmtLegGrp::known_tags()],
);
&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))
}
pub fn instrument(&self) -> Instrument<'a> {
Instrument(self.0, Self::known_tags().get())
}
#[doc(alias = "NoLegs")]
pub fn legs(&self) -> Result<Instances<'a, InstrmtLegGrp<'a>>, InvalidValue> {
self.0.get_group(&InstrmtLegGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
}
#[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 = "MidPx")]
pub fn mid_px(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(631))
}
#[doc(alias = "BidYield")]
pub fn bid_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(632))
}
#[doc(alias = "MidYield")]
pub fn mid_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(633))
}
#[doc(alias = "OfferYield")]
pub fn offer_yield(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(634))
}
#[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 = "TradingSessionSubID")]
pub fn trading_session_sub_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(625))
}
#[doc(alias = "SettlDate")]
pub fn settl_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 = "SettlDate2")]
pub fn settl_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 = "BidForwardPoints2")]
pub fn bid_forward_points2(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(642))
}
#[doc(alias = "OfferForwardPoints2")]
pub fn offer_forward_points2(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(643))
}
#[doc(alias = "Currency")]
pub fn currency(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(15))
}
#[doc(alias = "QuoteEntryRejectReason")]
pub fn quote_entry_reject_reason(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(368))
}
}
impl std::fmt::Debug for QuotEntryAckGrp<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "QuotEntryAckGrp({})", self.0)
}
}