-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistmarketcatalogue.go
105 lines (90 loc) · 4.16 KB
/
listmarketcatalogue.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
package betfair
import (
"time"
)
type PriceLadderType string
const (
PLT_CLASSIC PriceLadderType = "CLASSIC"
PLT_FINEST PriceLadderType = "FINEST"
PLT_LINE_RANGE PriceLadderType = "LINE_RANGE"
)
type MarketSort string
const (
MS_MINIMUM_TRADED MarketSort = "MINIMUM_TRADED"
MS_MAXIMUM_TRADED MarketSort = "MAXIMUM_TRADED"
MS_MINIMUM_AVAILABLE MarketSort = "MINIMUM_AVAILABLE"
MS_MAXIMUM_AVAILABLE MarketSort = "MAXIMUM_AVAILABLE"
MS_FIRST_TO_START MarketSort = "FIRST_TO_START"
MS_LAST_TO_START MarketSort = "LAST_TO_START"
)
type MarketProjection string
const (
MP_COMPETITION MarketProjection = "COMPETITION"
MP_EVENT MarketProjection = "EVENT"
MP_EVENT_TYPE MarketProjection = "EVENT_TYPE"
MP_MARKET_START_TIME MarketProjection = "MARKET_START_TIME"
MP_MARKET_DESCRIPTION MarketProjection = "MARKET_DESCRIPTION"
MP_RUNNER_DESCRIPTION MarketProjection = "RUNNER_DESCRIPTION"
MP_RUNNER_METADATA MarketProjection = "RUNNER_METADATA"
)
type (
MarketCatalogueParams struct {
Filter MarketFilter `json:"filter"`
MarketProjection MarketProjection `json:"marketProjection,omitempty"`
Sort MarketSort `json:"sort,omitempty"`
MaxResults int `json:"maxResults"`
Locale string `json:"locale,omitempty"`
}
MarketCatalogueResult struct {
MarketID string `json:"marketId"`
MarketName string `json:"marketName"`
MarketStartTime time.Time `json:"marketStartTime,omitempty"`
MarketDescription MarketDescription `json:"description,omitempty"`
TotalMatched float64 `json:"totalMatched,omitempty"`
Runners []RunnerCatalog `json:"runners,omitempty"`
EventType EventType `json:"eventType,omitempty"`
Competition Competition `json:"competition,omitempty"`
Event Event `json:"event,omitempty"`
}
MarketDescription struct {
PersistenceEnabled bool `json:"persistenceEnabled"`
BspMarket bool `json:"bspMarket"`
MarketTime time.Time `json:"marketTime"`
SuspendTime time.Time `json:"suspendTime"`
SettleTime time.Time `json:"settleTime,omitempty"`
BettingType MarketBettingType `json:"bettingType"`
TurnInPlayEnabled bool `json:"turnInPlayEnabled"`
MarketType string `json:"marketType"`
Regulator string `json:"regulator"`
MarketBaseRate float64 `json:"marketBaseRate"`
DiscountAllowed bool `json:"discountAllowed"`
Wallet string `json:"wallet,omitempty"`
Rules string `json:"rules,omitempty"`
RulesHasDate bool `json:"rulesHasDate,omitempty"`
EachWayDivisor float64 `json:"eachWayDivisor,omitempty"`
Clarifications string `json:"clarifications,omitempty"`
LineRangeInfo MarketLineRangeInfo `json:"lineRangeInfo,omitempty"`
RaceType string `json:"raceType,omitempty"`
PriceLadderDescription PriceLadderDescription `json:"priceLadderDescription,omitempty"`
}
RunnerCatalog struct {
SelectionID int64 `json:"selectionId"`
RunnerName string `json:"runnerName"`
Handicap float64 `json:"handicap"`
SortPriority int `json:"sortPriority"`
Metadata map[string]string `json:"metadata,omitempty"`
}
MarketLineRangeInfo struct {
MaxUnitValue float64 `json:"maxUnitValue"`
MinUnitValue float64 `json:"minUnitValue"`
Interval float64 `json:"interval"`
MarketUnit string `json:"marketUnit"`
}
PriceLadderDescription struct {
Type PriceLadderType `json:"priceLadderType,omitempty"`
}
)
func (client *Client) ListMarketCatalogue(params MarketCatalogueParams) ([]MarketCatalogueResult, error) {
json := []MarketCatalogueResult{}
return json, client.GetSports("listMarketCatalogue", params, &json)
}