forked from quickfixgo/quickfix
/
IOI.go
205 lines (186 loc) · 8.65 KB
/
IOI.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
//Package ioi msg type = 6.
package ioi
import (
"github.com/quickfixgo/quickfix"
"github.com/quickfixgo/quickfix/enum"
"github.com/quickfixgo/quickfix/fix44"
"github.com/quickfixgo/quickfix/fix44/financingdetails"
"github.com/quickfixgo/quickfix/fix44/instrument"
"github.com/quickfixgo/quickfix/fix44/instrumentleg"
"github.com/quickfixgo/quickfix/fix44/legstipulations"
"github.com/quickfixgo/quickfix/fix44/orderqtydata"
"github.com/quickfixgo/quickfix/fix44/spreadorbenchmarkcurvedata"
"github.com/quickfixgo/quickfix/fix44/stipulations"
"github.com/quickfixgo/quickfix/fix44/underlyinginstrument"
"github.com/quickfixgo/quickfix/fix44/yielddata"
"time"
)
//NoUnderlyings is a repeating group in IOI
type NoUnderlyings struct {
//UnderlyingInstrument is a non-required component for NoUnderlyings.
UnderlyingInstrument *underlyinginstrument.UnderlyingInstrument
}
//NewNoUnderlyings returns an initialized NoUnderlyings instance
func NewNoUnderlyings() *NoUnderlyings {
var m NoUnderlyings
return &m
}
func (m *NoUnderlyings) SetUnderlyingInstrument(v underlyinginstrument.UnderlyingInstrument) {
m.UnderlyingInstrument = &v
}
//NoLegs is a repeating group in IOI
type NoLegs struct {
//InstrumentLeg is a non-required component for NoLegs.
InstrumentLeg *instrumentleg.InstrumentLeg
//LegIOIQty is a non-required field for NoLegs.
LegIOIQty *string `fix:"682"`
//LegStipulations is a non-required component for NoLegs.
LegStipulations *legstipulations.LegStipulations
}
//NewNoLegs returns an initialized NoLegs instance
func NewNoLegs() *NoLegs {
var m NoLegs
return &m
}
func (m *NoLegs) SetInstrumentLeg(v instrumentleg.InstrumentLeg) { m.InstrumentLeg = &v }
func (m *NoLegs) SetLegIOIQty(v string) { m.LegIOIQty = &v }
func (m *NoLegs) SetLegStipulations(v legstipulations.LegStipulations) { m.LegStipulations = &v }
//NoIOIQualifiers is a repeating group in IOI
type NoIOIQualifiers struct {
//IOIQualifier is a non-required field for NoIOIQualifiers.
IOIQualifier *string `fix:"104"`
}
//NewNoIOIQualifiers returns an initialized NoIOIQualifiers instance
func NewNoIOIQualifiers() *NoIOIQualifiers {
var m NoIOIQualifiers
return &m
}
func (m *NoIOIQualifiers) SetIOIQualifier(v string) { m.IOIQualifier = &v }
//NoRoutingIDs is a repeating group in IOI
type NoRoutingIDs struct {
//RoutingType is a non-required field for NoRoutingIDs.
RoutingType *int `fix:"216"`
//RoutingID is a non-required field for NoRoutingIDs.
RoutingID *string `fix:"217"`
}
//NewNoRoutingIDs returns an initialized NoRoutingIDs instance
func NewNoRoutingIDs() *NoRoutingIDs {
var m NoRoutingIDs
return &m
}
func (m *NoRoutingIDs) SetRoutingType(v int) { m.RoutingType = &v }
func (m *NoRoutingIDs) SetRoutingID(v string) { m.RoutingID = &v }
//Message is a IOI FIX Message
type Message struct {
FIXMsgType string `fix:"6"`
fix44.Header
//IOIID is a required field for IOI.
IOIID string `fix:"23"`
//IOITransType is a required field for IOI.
IOITransType string `fix:"28"`
//IOIRefID is a non-required field for IOI.
IOIRefID *string `fix:"26"`
//Instrument is a required component for IOI.
instrument.Instrument
//FinancingDetails is a non-required component for IOI.
FinancingDetails *financingdetails.FinancingDetails
//NoUnderlyings is a non-required field for IOI.
NoUnderlyings []NoUnderlyings `fix:"711,omitempty"`
//Side is a required field for IOI.
Side string `fix:"54"`
//QtyType is a non-required field for IOI.
QtyType *int `fix:"854"`
//OrderQtyData is a non-required component for IOI.
OrderQtyData *orderqtydata.OrderQtyData
//IOIQty is a required field for IOI.
IOIQty string `fix:"27"`
//Currency is a non-required field for IOI.
Currency *string `fix:"15"`
//Stipulations is a non-required component for IOI.
Stipulations *stipulations.Stipulations
//NoLegs is a non-required field for IOI.
NoLegs []NoLegs `fix:"555,omitempty"`
//PriceType is a non-required field for IOI.
PriceType *int `fix:"423"`
//Price is a non-required field for IOI.
Price *float64 `fix:"44"`
//ValidUntilTime is a non-required field for IOI.
ValidUntilTime *time.Time `fix:"62"`
//IOIQltyInd is a non-required field for IOI.
IOIQltyInd *string `fix:"25"`
//IOINaturalFlag is a non-required field for IOI.
IOINaturalFlag *bool `fix:"130"`
//NoIOIQualifiers is a non-required field for IOI.
NoIOIQualifiers []NoIOIQualifiers `fix:"199,omitempty"`
//Text is a non-required field for IOI.
Text *string `fix:"58"`
//EncodedTextLen is a non-required field for IOI.
EncodedTextLen *int `fix:"354"`
//EncodedText is a non-required field for IOI.
EncodedText *string `fix:"355"`
//TransactTime is a non-required field for IOI.
TransactTime *time.Time `fix:"60"`
//URLLink is a non-required field for IOI.
URLLink *string `fix:"149"`
//NoRoutingIDs is a non-required field for IOI.
NoRoutingIDs []NoRoutingIDs `fix:"215,omitempty"`
//SpreadOrBenchmarkCurveData is a non-required component for IOI.
SpreadOrBenchmarkCurveData *spreadorbenchmarkcurvedata.SpreadOrBenchmarkCurveData
//YieldData is a non-required component for IOI.
YieldData *yielddata.YieldData
fix44.Trailer
}
//Marshal converts Message to a quickfix.Message instance
func (m Message) Marshal() quickfix.Message { return quickfix.Marshal(m) }
//New returns an initialized IOI instance
func New(ioiid string, ioitranstype string, instrument instrument.Instrument, side string, ioiqty string) *Message {
var m Message
m.SetIOIID(ioiid)
m.SetIOITransType(ioitranstype)
m.SetInstrument(instrument)
m.SetSide(side)
m.SetIOIQty(ioiqty)
return &m
}
func (m *Message) SetIOIID(v string) { m.IOIID = v }
func (m *Message) SetIOITransType(v string) { m.IOITransType = v }
func (m *Message) SetIOIRefID(v string) { m.IOIRefID = &v }
func (m *Message) SetInstrument(v instrument.Instrument) { m.Instrument = v }
func (m *Message) SetFinancingDetails(v financingdetails.FinancingDetails) { m.FinancingDetails = &v }
func (m *Message) SetNoUnderlyings(v []NoUnderlyings) { m.NoUnderlyings = v }
func (m *Message) SetSide(v string) { m.Side = v }
func (m *Message) SetQtyType(v int) { m.QtyType = &v }
func (m *Message) SetOrderQtyData(v orderqtydata.OrderQtyData) { m.OrderQtyData = &v }
func (m *Message) SetIOIQty(v string) { m.IOIQty = v }
func (m *Message) SetCurrency(v string) { m.Currency = &v }
func (m *Message) SetStipulations(v stipulations.Stipulations) { m.Stipulations = &v }
func (m *Message) SetNoLegs(v []NoLegs) { m.NoLegs = v }
func (m *Message) SetPriceType(v int) { m.PriceType = &v }
func (m *Message) SetPrice(v float64) { m.Price = &v }
func (m *Message) SetValidUntilTime(v time.Time) { m.ValidUntilTime = &v }
func (m *Message) SetIOIQltyInd(v string) { m.IOIQltyInd = &v }
func (m *Message) SetIOINaturalFlag(v bool) { m.IOINaturalFlag = &v }
func (m *Message) SetNoIOIQualifiers(v []NoIOIQualifiers) { m.NoIOIQualifiers = v }
func (m *Message) SetText(v string) { m.Text = &v }
func (m *Message) SetEncodedTextLen(v int) { m.EncodedTextLen = &v }
func (m *Message) SetEncodedText(v string) { m.EncodedText = &v }
func (m *Message) SetTransactTime(v time.Time) { m.TransactTime = &v }
func (m *Message) SetURLLink(v string) { m.URLLink = &v }
func (m *Message) SetNoRoutingIDs(v []NoRoutingIDs) { m.NoRoutingIDs = v }
func (m *Message) SetSpreadOrBenchmarkCurveData(v spreadorbenchmarkcurvedata.SpreadOrBenchmarkCurveData) {
m.SpreadOrBenchmarkCurveData = &v
}
func (m *Message) SetYieldData(v yielddata.YieldData) { m.YieldData = &v }
//A RouteOut is the callback type that should be implemented for routing Message
type RouteOut func(msg Message, sessionID quickfix.SessionID) quickfix.MessageRejectError
//Route returns the beginstring, message type, and MessageRoute for this Message type
func Route(router RouteOut) (string, string, quickfix.MessageRoute) {
r := func(msg quickfix.Message, sessionID quickfix.SessionID) quickfix.MessageRejectError {
m := new(Message)
if err := quickfix.Unmarshal(msg, m); err != nil {
return err
}
return router(*m, sessionID)
}
return enum.BeginStringFIX44, "6", r
}