forked from quickfixgo/quickfix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MarketDataRequest.go
94 lines (87 loc) · 4.44 KB
/
MarketDataRequest.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
//Package marketdatarequest msg type = V.
package marketdatarequest
import (
"github.com/quickfixgo/quickfix"
"github.com/quickfixgo/quickfix/enum"
"github.com/quickfixgo/quickfix/fix50sp1/instrmtmdreqgrp"
"github.com/quickfixgo/quickfix/fix50sp1/mdreqgrp"
"github.com/quickfixgo/quickfix/fix50sp1/parties"
"github.com/quickfixgo/quickfix/fix50sp1/trdgsesgrp"
"github.com/quickfixgo/quickfix/fixt11"
)
//Message is a MarketDataRequest FIX Message
type Message struct {
FIXMsgType string `fix:"V"`
fixt11.Header
//MDReqID is a required field for MarketDataRequest.
MDReqID string `fix:"262"`
//SubscriptionRequestType is a required field for MarketDataRequest.
SubscriptionRequestType string `fix:"263"`
//MarketDepth is a required field for MarketDataRequest.
MarketDepth int `fix:"264"`
//MDUpdateType is a non-required field for MarketDataRequest.
MDUpdateType *int `fix:"265"`
//AggregatedBook is a non-required field for MarketDataRequest.
AggregatedBook *bool `fix:"266"`
//OpenCloseSettlFlag is a non-required field for MarketDataRequest.
OpenCloseSettlFlag *string `fix:"286"`
//Scope is a non-required field for MarketDataRequest.
Scope *string `fix:"546"`
//MDImplicitDelete is a non-required field for MarketDataRequest.
MDImplicitDelete *bool `fix:"547"`
//MDReqGrp is a required component for MarketDataRequest.
mdreqgrp.MDReqGrp
//InstrmtMDReqGrp is a required component for MarketDataRequest.
instrmtmdreqgrp.InstrmtMDReqGrp
//TrdgSesGrp is a non-required component for MarketDataRequest.
TrdgSesGrp *trdgsesgrp.TrdgSesGrp
//ApplQueueAction is a non-required field for MarketDataRequest.
ApplQueueAction *int `fix:"815"`
//ApplQueueMax is a non-required field for MarketDataRequest.
ApplQueueMax *int `fix:"812"`
//MDQuoteType is a non-required field for MarketDataRequest.
MDQuoteType *int `fix:"1070"`
//Parties is a non-required component for MarketDataRequest.
Parties *parties.Parties
fixt11.Trailer
}
//Marshal converts Message to a quickfix.Message instance
func (m Message) Marshal() quickfix.Message { return quickfix.Marshal(m) }
//New returns an initialized MarketDataRequest instance
func New(mdreqid string, subscriptionrequesttype string, marketdepth int, mdreqgrp mdreqgrp.MDReqGrp, instrmtmdreqgrp instrmtmdreqgrp.InstrmtMDReqGrp) *Message {
var m Message
m.SetMDReqID(mdreqid)
m.SetSubscriptionRequestType(subscriptionrequesttype)
m.SetMarketDepth(marketdepth)
m.SetMDReqGrp(mdreqgrp)
m.SetInstrmtMDReqGrp(instrmtmdreqgrp)
return &m
}
func (m *Message) SetMDReqID(v string) { m.MDReqID = v }
func (m *Message) SetSubscriptionRequestType(v string) { m.SubscriptionRequestType = v }
func (m *Message) SetMarketDepth(v int) { m.MarketDepth = v }
func (m *Message) SetMDUpdateType(v int) { m.MDUpdateType = &v }
func (m *Message) SetAggregatedBook(v bool) { m.AggregatedBook = &v }
func (m *Message) SetOpenCloseSettlFlag(v string) { m.OpenCloseSettlFlag = &v }
func (m *Message) SetScope(v string) { m.Scope = &v }
func (m *Message) SetMDImplicitDelete(v bool) { m.MDImplicitDelete = &v }
func (m *Message) SetMDReqGrp(v mdreqgrp.MDReqGrp) { m.MDReqGrp = v }
func (m *Message) SetInstrmtMDReqGrp(v instrmtmdreqgrp.InstrmtMDReqGrp) { m.InstrmtMDReqGrp = v }
func (m *Message) SetTrdgSesGrp(v trdgsesgrp.TrdgSesGrp) { m.TrdgSesGrp = &v }
func (m *Message) SetApplQueueAction(v int) { m.ApplQueueAction = &v }
func (m *Message) SetApplQueueMax(v int) { m.ApplQueueMax = &v }
func (m *Message) SetMDQuoteType(v int) { m.MDQuoteType = &v }
func (m *Message) SetParties(v parties.Parties) { m.Parties = &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.ApplVerID_FIX50SP1, "V", r
}