forked from quickfixgo/quickfix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AssignmentReport.go
173 lines (160 loc) · 7.77 KB
/
AssignmentReport.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
//Package assignmentreport msg type = AW.
package assignmentreport
import (
"github.com/quickfixgo/quickfix"
"github.com/quickfixgo/quickfix/enum"
"github.com/quickfixgo/quickfix/fix44"
"github.com/quickfixgo/quickfix/fix44/instrument"
"github.com/quickfixgo/quickfix/fix44/instrumentleg"
"github.com/quickfixgo/quickfix/fix44/parties"
"github.com/quickfixgo/quickfix/fix44/positionamountdata"
"github.com/quickfixgo/quickfix/fix44/positionqty"
"github.com/quickfixgo/quickfix/fix44/underlyinginstrument"
)
//NoLegs is a repeating group in AssignmentReport
type NoLegs struct {
//InstrumentLeg is a non-required component for NoLegs.
InstrumentLeg *instrumentleg.InstrumentLeg
}
//NewNoLegs returns an initialized NoLegs instance
func NewNoLegs() *NoLegs {
var m NoLegs
return &m
}
func (m *NoLegs) SetInstrumentLeg(v instrumentleg.InstrumentLeg) { m.InstrumentLeg = &v }
//NoUnderlyings is a repeating group in AssignmentReport
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
}
//Message is a AssignmentReport FIX Message
type Message struct {
FIXMsgType string `fix:"AW"`
fix44.Header
//AsgnRptID is a required field for AssignmentReport.
AsgnRptID string `fix:"833"`
//TotNumAssignmentReports is a non-required field for AssignmentReport.
TotNumAssignmentReports *int `fix:"832"`
//LastRptRequested is a non-required field for AssignmentReport.
LastRptRequested *bool `fix:"912"`
//Parties is a required component for AssignmentReport.
parties.Parties
//Account is a non-required field for AssignmentReport.
Account *string `fix:"1"`
//AccountType is a required field for AssignmentReport.
AccountType int `fix:"581"`
//Instrument is a non-required component for AssignmentReport.
Instrument *instrument.Instrument
//Currency is a non-required field for AssignmentReport.
Currency *string `fix:"15"`
//NoLegs is a non-required field for AssignmentReport.
NoLegs []NoLegs `fix:"555,omitempty"`
//NoUnderlyings is a non-required field for AssignmentReport.
NoUnderlyings []NoUnderlyings `fix:"711,omitempty"`
//PositionQty is a required component for AssignmentReport.
positionqty.PositionQty
//PositionAmountData is a required component for AssignmentReport.
positionamountdata.PositionAmountData
//ThresholdAmount is a non-required field for AssignmentReport.
ThresholdAmount *float64 `fix:"834"`
//SettlPrice is a required field for AssignmentReport.
SettlPrice float64 `fix:"730"`
//SettlPriceType is a required field for AssignmentReport.
SettlPriceType int `fix:"731"`
//UnderlyingSettlPrice is a required field for AssignmentReport.
UnderlyingSettlPrice float64 `fix:"732"`
//ExpireDate is a non-required field for AssignmentReport.
ExpireDate *string `fix:"432"`
//AssignmentMethod is a required field for AssignmentReport.
AssignmentMethod string `fix:"744"`
//AssignmentUnit is a non-required field for AssignmentReport.
AssignmentUnit *float64 `fix:"745"`
//OpenInterest is a required field for AssignmentReport.
OpenInterest float64 `fix:"746"`
//ExerciseMethod is a required field for AssignmentReport.
ExerciseMethod string `fix:"747"`
//SettlSessID is a required field for AssignmentReport.
SettlSessID string `fix:"716"`
//SettlSessSubID is a required field for AssignmentReport.
SettlSessSubID string `fix:"717"`
//ClearingBusinessDate is a required field for AssignmentReport.
ClearingBusinessDate string `fix:"715"`
//Text is a non-required field for AssignmentReport.
Text *string `fix:"58"`
//EncodedTextLen is a non-required field for AssignmentReport.
EncodedTextLen *int `fix:"354"`
//EncodedText is a non-required field for AssignmentReport.
EncodedText *string `fix:"355"`
fix44.Trailer
}
//Marshal converts Message to a quickfix.Message instance
func (m Message) Marshal() quickfix.Message { return quickfix.Marshal(m) }
//New returns an initialized AssignmentReport instance
func New(asgnrptid string, parties parties.Parties, accounttype int, positionqty positionqty.PositionQty, positionamountdata positionamountdata.PositionAmountData, settlprice float64, settlpricetype int, underlyingsettlprice float64, assignmentmethod string, openinterest float64, exercisemethod string, settlsessid string, settlsesssubid string, clearingbusinessdate string) *Message {
var m Message
m.SetAsgnRptID(asgnrptid)
m.SetParties(parties)
m.SetAccountType(accounttype)
m.SetPositionQty(positionqty)
m.SetPositionAmountData(positionamountdata)
m.SetSettlPrice(settlprice)
m.SetSettlPriceType(settlpricetype)
m.SetUnderlyingSettlPrice(underlyingsettlprice)
m.SetAssignmentMethod(assignmentmethod)
m.SetOpenInterest(openinterest)
m.SetExerciseMethod(exercisemethod)
m.SetSettlSessID(settlsessid)
m.SetSettlSessSubID(settlsesssubid)
m.SetClearingBusinessDate(clearingbusinessdate)
return &m
}
func (m *Message) SetAsgnRptID(v string) { m.AsgnRptID = v }
func (m *Message) SetTotNumAssignmentReports(v int) { m.TotNumAssignmentReports = &v }
func (m *Message) SetLastRptRequested(v bool) { m.LastRptRequested = &v }
func (m *Message) SetParties(v parties.Parties) { m.Parties = v }
func (m *Message) SetAccount(v string) { m.Account = &v }
func (m *Message) SetAccountType(v int) { m.AccountType = v }
func (m *Message) SetInstrument(v instrument.Instrument) { m.Instrument = &v }
func (m *Message) SetCurrency(v string) { m.Currency = &v }
func (m *Message) SetNoLegs(v []NoLegs) { m.NoLegs = v }
func (m *Message) SetNoUnderlyings(v []NoUnderlyings) { m.NoUnderlyings = v }
func (m *Message) SetPositionQty(v positionqty.PositionQty) { m.PositionQty = v }
func (m *Message) SetPositionAmountData(v positionamountdata.PositionAmountData) {
m.PositionAmountData = v
}
func (m *Message) SetThresholdAmount(v float64) { m.ThresholdAmount = &v }
func (m *Message) SetSettlPrice(v float64) { m.SettlPrice = v }
func (m *Message) SetSettlPriceType(v int) { m.SettlPriceType = v }
func (m *Message) SetUnderlyingSettlPrice(v float64) { m.UnderlyingSettlPrice = v }
func (m *Message) SetExpireDate(v string) { m.ExpireDate = &v }
func (m *Message) SetAssignmentMethod(v string) { m.AssignmentMethod = v }
func (m *Message) SetAssignmentUnit(v float64) { m.AssignmentUnit = &v }
func (m *Message) SetOpenInterest(v float64) { m.OpenInterest = v }
func (m *Message) SetExerciseMethod(v string) { m.ExerciseMethod = v }
func (m *Message) SetSettlSessID(v string) { m.SettlSessID = v }
func (m *Message) SetSettlSessSubID(v string) { m.SettlSessSubID = v }
func (m *Message) SetClearingBusinessDate(v string) { m.ClearingBusinessDate = 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 }
//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, "AW", r
}