#![cfg_attr(rustfmt, rustfmt::skip)]
use refix_message::{Decimal, GroupTable, InvalidValue, LazyKnownTags, Tag};
#[derive(Clone, Copy)]
pub struct AllocAckGrp<'a>(refix_message::Scope<'a>);
impl<'a> From<refix_message::Scope<'a>> for AllocAckGrp<'a> {
fn from(scope: refix_message::Scope<'a>) -> Self {
Self(scope)
}
}
impl<'a> AllocAckGrp<'a> {
pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
Tag(78),
Tag(79),
&[Tag(79), Tag(161), Tag(360), Tag(361), Tag(366), Tag(467), Tag(661), Tag(776)],
&[],
);
pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
static TAGS: LazyKnownTags = LazyKnownTags::new(
&[Tag(79), Tag(661), Tag(366), Tag(467), Tag(776), Tag(161), Tag(360), Tag(361)],
&[],
);
&TAGS
}
pub fn raw(&self) -> refix_message::Scope<'a> {
self.0
}
#[doc(alias = "AllocAccount")]
pub fn alloc_account(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(79))
}
#[doc(alias = "AllocAcctIDSource")]
pub fn alloc_acct_id_source(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(661))
}
#[doc(alias = "AllocPrice")]
pub fn alloc_price(&self) -> Result<Option<Decimal>, InvalidValue> {
self.0.get_decimal(Tag(366))
}
#[doc(alias = "IndividualAllocID")]
pub fn individual_alloc_id(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(467))
}
#[doc(alias = "IndividualAllocRejCode")]
pub fn individual_alloc_rej_code(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(776))
}
#[doc(alias = "AllocText")]
pub fn alloc_text(&self) -> Result<Option<&'a str>, InvalidValue> {
self.0.get_str(Tag(161))
}
#[doc(alias = "EncodedAllocTextLen")]
pub fn encoded_alloc_text_len(&self) -> Result<Option<i64>, InvalidValue> {
self.0.get_int(Tag(360))
}
#[doc(alias = "EncodedAllocText")]
pub fn encoded_alloc_text(&self) -> Option<&'a [u8]> {
self.0.get(Tag(361))
}
}
impl std::fmt::Debug for AllocAckGrp<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "AllocAckGrp({})", self.0)
}
}