-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreplaceorders.go
41 lines (34 loc) · 1.51 KB
/
replaceorders.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
package betfair
type (
ReplaceOrdersParams struct {
MarketID string `json:"marketId"`
Instructions []ReplaceInstruction `json:"instructions"`
}
ReplaceInstruction struct {
BetID string `json:"betId"`
NewPrice float64 `json:"newPrice"`
CustomerRef string `json:"customerRef,omitempty"`
MarketVersion MarketVersion `json:"marketVersion,omitempty"`
Async bool `json:"async,omitempty"`
}
ReplaceExecutionReport struct {
CustomerRef string `json:"customerRef,omitempty"`
Status ExecutionReportStatus `json:"status"`
ErrorCode ExecutionReportErrorCode `json:"errorCode,omitempty"`
MarketID string `json:"marketId,omitempty"`
InstructionReports []ReplaceInstructionReport `json:"instructionReports,omitempty"`
}
ReplaceInstructionReport struct {
Status InstructionReportStatus `json:"status"`
ErrorCode InstructionReportErrorCode `json:"errorCode,omitempty"`
CancelInstructionReport CancelInstructionReport `json:"cancelInstructionReport,omitempty"`
PlaceInstructionReport PlaceInstructionReport `json:"placeInstructionReport,omitempty"`
}
)
func (client *Client) ReplaceOrders(params ReplaceOrdersParams) (ReplaceExecutionReport, error) {
json := ReplaceExecutionReport{}
if err := client.GetSports("replaceOrders", params, &json); err != nil {
return ReplaceExecutionReport{}, err
}
return json, nil
}