forked from quickfixgo/quickfix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QuoteRequest.generated.go
249 lines (209 loc) · 6.39 KB
/
QuoteRequest.generated.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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
package quoterequest
import (
"github.com/shopspring/decimal"
"github.com/Boklazhenko/quickfix"
"github.com/Boklazhenko/quickfix/gen/enum"
"github.com/Boklazhenko/quickfix/gen/field"
"github.com/Boklazhenko/quickfix/gen/fix40"
"github.com/Boklazhenko/quickfix/gen/tag"
)
// QuoteRequest is the fix40 QuoteRequest type, MsgType = R.
type QuoteRequest struct {
fix40.Header
*quickfix.Body
fix40.Trailer
Message *quickfix.Message
}
// FromMessage creates a QuoteRequest from a quickfix.Message instance.
func FromMessage(m *quickfix.Message) QuoteRequest {
return QuoteRequest{
Header: fix40.Header{&m.Header},
Body: &m.Body,
Trailer: fix40.Trailer{&m.Trailer},
Message: m,
}
}
// ToMessage returns a quickfix.Message instance.
func (m QuoteRequest) ToMessage() *quickfix.Message {
return m.Message
}
// New returns a QuoteRequest initialized with the required fields for QuoteRequest.
func New(quotereqid field.QuoteReqIDField, symbol field.SymbolField) (m QuoteRequest) {
m.Message = quickfix.NewMessage()
m.Header = fix40.NewHeader(&m.Message.Header)
m.Body = &m.Message.Body
m.Trailer.Trailer = &m.Message.Trailer
m.Header.Set(field.NewMsgType("R"))
m.Set(quotereqid)
m.Set(symbol)
return
}
// A RouteOut is the callback type that should be implemented for routing Message.
type RouteOut func(msg QuoteRequest, 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 {
return router(FromMessage(msg), sessionID)
}
return "FIX.4.0", "R", r
}
// SetIDSource sets IDSource, Tag 22.
func (m QuoteRequest) SetIDSource(v enum.IDSource) {
m.Set(field.NewIDSource(v))
}
// SetOrderQty sets OrderQty, Tag 38.
func (m QuoteRequest) SetOrderQty(value decimal.Decimal, scale int32) {
m.Set(field.NewOrderQty(value, scale))
}
// SetSecurityID sets SecurityID, Tag 48.
func (m QuoteRequest) SetSecurityID(v string) {
m.Set(field.NewSecurityID(v))
}
// SetSide sets Side, Tag 54.
func (m QuoteRequest) SetSide(v enum.Side) {
m.Set(field.NewSide(v))
}
// SetSymbol sets Symbol, Tag 55.
func (m QuoteRequest) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
// SetSymbolSfx sets SymbolSfx, Tag 65.
func (m QuoteRequest) SetSymbolSfx(v enum.SymbolSfx) {
m.Set(field.NewSymbolSfx(v))
}
// SetIssuer sets Issuer, Tag 106.
func (m QuoteRequest) SetIssuer(v string) {
m.Set(field.NewIssuer(v))
}
// SetSecurityDesc sets SecurityDesc, Tag 107.
func (m QuoteRequest) SetSecurityDesc(v string) {
m.Set(field.NewSecurityDesc(v))
}
// SetQuoteReqID sets QuoteReqID, Tag 131.
func (m QuoteRequest) SetQuoteReqID(v string) {
m.Set(field.NewQuoteReqID(v))
}
// SetPrevClosePx sets PrevClosePx, Tag 140.
func (m QuoteRequest) SetPrevClosePx(value decimal.Decimal, scale int32) {
m.Set(field.NewPrevClosePx(value, scale))
}
// GetIDSource gets IDSource, Tag 22.
func (m QuoteRequest) GetIDSource() (v enum.IDSource, err quickfix.MessageRejectError) {
var f field.IDSourceField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
// GetOrderQty gets OrderQty, Tag 38.
func (m QuoteRequest) GetOrderQty() (v decimal.Decimal, err quickfix.MessageRejectError) {
var f field.OrderQtyField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
// GetSecurityID gets SecurityID, Tag 48.
func (m QuoteRequest) GetSecurityID() (v string, err quickfix.MessageRejectError) {
var f field.SecurityIDField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
// GetSide gets Side, Tag 54.
func (m QuoteRequest) GetSide() (v enum.Side, err quickfix.MessageRejectError) {
var f field.SideField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
// GetSymbol gets Symbol, Tag 55.
func (m QuoteRequest) GetSymbol() (v string, err quickfix.MessageRejectError) {
var f field.SymbolField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
// GetSymbolSfx gets SymbolSfx, Tag 65.
func (m QuoteRequest) GetSymbolSfx() (v enum.SymbolSfx, err quickfix.MessageRejectError) {
var f field.SymbolSfxField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
// GetIssuer gets Issuer, Tag 106.
func (m QuoteRequest) GetIssuer() (v string, err quickfix.MessageRejectError) {
var f field.IssuerField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
// GetSecurityDesc gets SecurityDesc, Tag 107.
func (m QuoteRequest) GetSecurityDesc() (v string, err quickfix.MessageRejectError) {
var f field.SecurityDescField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
// GetQuoteReqID gets QuoteReqID, Tag 131.
func (m QuoteRequest) GetQuoteReqID() (v string, err quickfix.MessageRejectError) {
var f field.QuoteReqIDField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
// GetPrevClosePx gets PrevClosePx, Tag 140.
func (m QuoteRequest) GetPrevClosePx() (v decimal.Decimal, err quickfix.MessageRejectError) {
var f field.PrevClosePxField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
// HasIDSource returns true if IDSource is present, Tag 22.
func (m QuoteRequest) HasIDSource() bool {
return m.Has(tag.IDSource)
}
// HasOrderQty returns true if OrderQty is present, Tag 38.
func (m QuoteRequest) HasOrderQty() bool {
return m.Has(tag.OrderQty)
}
// HasSecurityID returns true if SecurityID is present, Tag 48.
func (m QuoteRequest) HasSecurityID() bool {
return m.Has(tag.SecurityID)
}
// HasSide returns true if Side is present, Tag 54.
func (m QuoteRequest) HasSide() bool {
return m.Has(tag.Side)
}
// HasSymbol returns true if Symbol is present, Tag 55.
func (m QuoteRequest) HasSymbol() bool {
return m.Has(tag.Symbol)
}
// HasSymbolSfx returns true if SymbolSfx is present, Tag 65.
func (m QuoteRequest) HasSymbolSfx() bool {
return m.Has(tag.SymbolSfx)
}
// HasIssuer returns true if Issuer is present, Tag 106.
func (m QuoteRequest) HasIssuer() bool {
return m.Has(tag.Issuer)
}
// HasSecurityDesc returns true if SecurityDesc is present, Tag 107.
func (m QuoteRequest) HasSecurityDesc() bool {
return m.Has(tag.SecurityDesc)
}
// HasQuoteReqID returns true if QuoteReqID is present, Tag 131.
func (m QuoteRequest) HasQuoteReqID() bool {
return m.Has(tag.QuoteReqID)
}
// HasPrevClosePx returns true if PrevClosePx is present, Tag 140.
func (m QuoteRequest) HasPrevClosePx() bool {
return m.Has(tag.PrevClosePx)
}