forked from quickfixgo/quickfix
/
OrderStatusRequest.go
69 lines (62 loc) · 2.64 KB
/
OrderStatusRequest.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
//Package orderstatusrequest msg type = H.
package orderstatusrequest
import (
"github.com/quickfixgo/quickfix"
"github.com/quickfixgo/quickfix/enum"
"github.com/quickfixgo/quickfix/fix43"
"github.com/quickfixgo/quickfix/fix43/instrument"
"github.com/quickfixgo/quickfix/fix43/parties"
)
//Message is a OrderStatusRequest FIX Message
type Message struct {
FIXMsgType string `fix:"H"`
fix43.Header
//OrderID is a non-required field for OrderStatusRequest.
OrderID *string `fix:"37"`
//ClOrdID is a required field for OrderStatusRequest.
ClOrdID string `fix:"11"`
//SecondaryClOrdID is a non-required field for OrderStatusRequest.
SecondaryClOrdID *string `fix:"526"`
//ClOrdLinkID is a non-required field for OrderStatusRequest.
ClOrdLinkID *string `fix:"583"`
//Parties is a non-required component for OrderStatusRequest.
Parties *parties.Parties
//Account is a non-required field for OrderStatusRequest.
Account *string `fix:"1"`
//Instrument is a required component for OrderStatusRequest.
instrument.Instrument
//Side is a required field for OrderStatusRequest.
Side string `fix:"54"`
fix43.Trailer
}
//Marshal converts Message to a quickfix.Message instance
func (m Message) Marshal() quickfix.Message { return quickfix.Marshal(m) }
//New returns an initialized OrderStatusRequest instance
func New(clordid string, instrument instrument.Instrument, side string) *Message {
var m Message
m.SetClOrdID(clordid)
m.SetInstrument(instrument)
m.SetSide(side)
return &m
}
func (m *Message) SetOrderID(v string) { m.OrderID = &v }
func (m *Message) SetClOrdID(v string) { m.ClOrdID = v }
func (m *Message) SetSecondaryClOrdID(v string) { m.SecondaryClOrdID = &v }
func (m *Message) SetClOrdLinkID(v string) { m.ClOrdLinkID = &v }
func (m *Message) SetParties(v parties.Parties) { m.Parties = &v }
func (m *Message) SetAccount(v string) { m.Account = &v }
func (m *Message) SetInstrument(v instrument.Instrument) { m.Instrument = v }
func (m *Message) SetSide(v string) { m.Side = 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.BeginStringFIX43, "H", r
}