forked from quickfixgo/quickfix
/
NewOrderList.go
106 lines (99 loc) · 4.94 KB
/
NewOrderList.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
//Package neworderlist msg type = E.
package neworderlist
import (
"github.com/quickfixgo/quickfix"
"github.com/quickfixgo/quickfix/enum"
"github.com/quickfixgo/quickfix/fix50/listordgrp"
"github.com/quickfixgo/quickfix/fix50/rootparties"
"github.com/quickfixgo/quickfix/fixt11"
)
//Message is a NewOrderList FIX Message
type Message struct {
FIXMsgType string `fix:"E"`
fixt11.Header
//ListID is a required field for NewOrderList.
ListID string `fix:"66"`
//BidID is a non-required field for NewOrderList.
BidID *string `fix:"390"`
//ClientBidID is a non-required field for NewOrderList.
ClientBidID *string `fix:"391"`
//ProgRptReqs is a non-required field for NewOrderList.
ProgRptReqs *int `fix:"414"`
//BidType is a required field for NewOrderList.
BidType int `fix:"394"`
//ProgPeriodInterval is a non-required field for NewOrderList.
ProgPeriodInterval *int `fix:"415"`
//CancellationRights is a non-required field for NewOrderList.
CancellationRights *string `fix:"480"`
//MoneyLaunderingStatus is a non-required field for NewOrderList.
MoneyLaunderingStatus *string `fix:"481"`
//RegistID is a non-required field for NewOrderList.
RegistID *string `fix:"513"`
//ListExecInstType is a non-required field for NewOrderList.
ListExecInstType *string `fix:"433"`
//ListExecInst is a non-required field for NewOrderList.
ListExecInst *string `fix:"69"`
//EncodedListExecInstLen is a non-required field for NewOrderList.
EncodedListExecInstLen *int `fix:"352"`
//EncodedListExecInst is a non-required field for NewOrderList.
EncodedListExecInst *string `fix:"353"`
//AllowableOneSidednessPct is a non-required field for NewOrderList.
AllowableOneSidednessPct *float64 `fix:"765"`
//AllowableOneSidednessValue is a non-required field for NewOrderList.
AllowableOneSidednessValue *float64 `fix:"766"`
//AllowableOneSidednessCurr is a non-required field for NewOrderList.
AllowableOneSidednessCurr *string `fix:"767"`
//TotNoOrders is a required field for NewOrderList.
TotNoOrders int `fix:"68"`
//LastFragment is a non-required field for NewOrderList.
LastFragment *bool `fix:"893"`
//ListOrdGrp is a required component for NewOrderList.
listordgrp.ListOrdGrp
//RootParties is a non-required component for NewOrderList.
RootParties *rootparties.RootParties
fixt11.Trailer
}
//Marshal converts Message to a quickfix.Message instance
func (m Message) Marshal() quickfix.Message { return quickfix.Marshal(m) }
//New returns an initialized NewOrderList instance
func New(listid string, bidtype int, totnoorders int, listordgrp listordgrp.ListOrdGrp) *Message {
var m Message
m.SetListID(listid)
m.SetBidType(bidtype)
m.SetTotNoOrders(totnoorders)
m.SetListOrdGrp(listordgrp)
return &m
}
func (m *Message) SetListID(v string) { m.ListID = v }
func (m *Message) SetBidID(v string) { m.BidID = &v }
func (m *Message) SetClientBidID(v string) { m.ClientBidID = &v }
func (m *Message) SetProgRptReqs(v int) { m.ProgRptReqs = &v }
func (m *Message) SetBidType(v int) { m.BidType = v }
func (m *Message) SetProgPeriodInterval(v int) { m.ProgPeriodInterval = &v }
func (m *Message) SetCancellationRights(v string) { m.CancellationRights = &v }
func (m *Message) SetMoneyLaunderingStatus(v string) { m.MoneyLaunderingStatus = &v }
func (m *Message) SetRegistID(v string) { m.RegistID = &v }
func (m *Message) SetListExecInstType(v string) { m.ListExecInstType = &v }
func (m *Message) SetListExecInst(v string) { m.ListExecInst = &v }
func (m *Message) SetEncodedListExecInstLen(v int) { m.EncodedListExecInstLen = &v }
func (m *Message) SetEncodedListExecInst(v string) { m.EncodedListExecInst = &v }
func (m *Message) SetAllowableOneSidednessPct(v float64) { m.AllowableOneSidednessPct = &v }
func (m *Message) SetAllowableOneSidednessValue(v float64) { m.AllowableOneSidednessValue = &v }
func (m *Message) SetAllowableOneSidednessCurr(v string) { m.AllowableOneSidednessCurr = &v }
func (m *Message) SetTotNoOrders(v int) { m.TotNoOrders = v }
func (m *Message) SetLastFragment(v bool) { m.LastFragment = &v }
func (m *Message) SetListOrdGrp(v listordgrp.ListOrdGrp) { m.ListOrdGrp = v }
func (m *Message) SetRootParties(v rootparties.RootParties) { m.RootParties = &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.BeginStringFIX50, "E", r
}