refix_fix44/generated/components/
quot_set_grp.rs1#![cfg_attr(rustfmt, rustfmt::skip)]
3
4use refix_message::{GroupTable, Instances, InvalidValue, LazyKnownTags, Tag, UtcTimestamp};
5
6use super::{QuotEntryGrp, UndSecAltIDGrp, UnderlyingInstrument, UnderlyingStipulations};
7
8#[derive(Clone, Copy)]
10pub struct QuotSetGrp<'a>(refix_message::Scope<'a>);
11
12impl<'a> From<refix_message::Scope<'a>> for QuotSetGrp<'a> {
13 fn from(scope: refix_message::Scope<'a>) -> Self {
14 Self(scope)
15 }
16}
17
18impl<'a> QuotSetGrp<'a> {
19 pub(in super::super) const TABLE: GroupTable<'static> = GroupTable::new(
20 Tag(296),
21 Tag(302),
22 &[
23 Tag(241), Tag(242), Tag(243), Tag(244), Tag(245), Tag(246), Tag(247), Tag(256),
24 Tag(295), Tag(302), Tag(304), Tag(305), Tag(306), Tag(307), Tag(308), Tag(309),
25 Tag(310), Tag(311), Tag(312), Tag(313), Tag(315), Tag(316), Tag(317), Tag(318),
26 Tag(362), Tag(363), Tag(364), Tag(365), Tag(367), Tag(435), Tag(436), Tag(457),
27 Tag(462), Tag(463), Tag(542), Tag(592), Tag(593), Tag(594), Tag(595), Tag(763),
28 Tag(810), Tag(877), Tag(878), Tag(879), Tag(882), Tag(883), Tag(884), Tag(885),
29 Tag(886), Tag(887), Tag(893), Tag(941),
30 ],
31 &[UndSecAltIDGrp::TABLE, UnderlyingStipulations::TABLE, QuotEntryGrp::TABLE],
32 );
33
34 pub(in super::super) const fn known_tags() -> &'static LazyKnownTags {
35 static TAGS: LazyKnownTags = LazyKnownTags::new(
36 &[Tag(302), Tag(367), Tag(304), Tag(893), Tag(295)],
37 &[UnderlyingInstrument::known_tags(), QuotEntryGrp::known_tags()],
38 );
39 &TAGS
40 }
41
42 pub fn raw(&self) -> refix_message::Scope<'a> {
43 self.0
44 }
45
46 #[doc(alias = "QuoteSetID")]
48 pub fn quote_set_id(&self) -> Result<Option<&'a str>, InvalidValue> {
49 self.0.get_str(Tag(302))
50 }
51
52 pub fn underlying_instrument(&self) -> UnderlyingInstrument<'a> {
54 UnderlyingInstrument(self.0, Self::known_tags().get())
55 }
56
57 #[doc(alias = "QuoteSetValidUntilTime")]
59 pub fn quote_set_valid_until_time(&self) -> Result<Option<UtcTimestamp>, InvalidValue> {
60 self.0.get_utc_timestamp(Tag(367))
61 }
62
63 #[doc(alias = "TotNoQuoteEntries")]
65 pub fn tot_no_quote_entries(&self) -> Result<Option<i64>, InvalidValue> {
66 self.0.get_int(Tag(304))
67 }
68
69 #[doc(alias = "LastFragment")]
71 pub fn last_fragment(&self) -> Result<Option<bool>, InvalidValue> {
72 self.0.get_bool(Tag(893))
73 }
74
75 #[doc(alias = "NoQuoteEntries")]
77 pub fn quote_entries(&self) -> Result<Instances<'a, QuotEntryGrp<'a>>, InvalidValue> {
78 self.0.get_group(&QuotEntryGrp::TABLE, &Self::known_tags().get()).map(Instances::from)
79 }
80}
81
82impl std::fmt::Debug for QuotSetGrp<'_> {
83 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
84 write!(f, "QuotSetGrp({})", self.0)
85 }
86}