forked from minus5/go-uof-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
enums.go
162 lines (137 loc) · 4.56 KB
/
enums.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
package uof
// The default value is active if status is not present.
type MarketStatus int8
// Reference: https://docs.betradar.com/display/BD/UOF+-+Market+status
const (
// Active/suspended/inactive could be sent in odds change message:
// Odds are provided and you can accept bets on the market.
MarketStatusActive MarketStatus = 1
// Odds continue to be provided but you should not accept bets on the market
// for a short time (e.g. from right before a goal and until the goal has been
// observed/confirmed).
MarketStatusSuspended MarketStatus = -1
// Odds are no longer provided for this market. A market can go back to Active
// again i.e.: A total 3.5 market is deactivated since 0.5, 1.5 or 2.5 is the
// most balanced market. However, if a goal is scored, then the 3.5 market
// becomes the most balanced again, changing status to active. There are
// numerous other reasons for this change as well, and it happens on a regular
// basis.
MarketStatusInactive MarketStatus = 0
// During recovery the following additional status may also be sent:
// Not a real market status. This status is normally seen under recovery, and
// is a signal that the producer that sends this message is no longer sending
// odds for this market. Odds will come from another producer going forward
// (and might already have started coming from the new producer). Handed over
// is also sent by the prematch producer when the Live Odds producer takes
// over a market. If you have not received the live odds change yet, the
// market should be suspended, otherwise the message can be ignored. If the
// live odds change does not eventually appear, the market should likely be
// deactivated.
MarketStatusHandedOver MarketStatus = -2
// Bet Settlement messages have been sent for this market, no further odds
// will be provided. However, it should be noted that in rare cases (error
// conditions), a settled market may be moved to cancelled by a bet_cancel
// message.
MarketStatusSettled MarketStatus = -3
// This market has been cancelled. No further odds will be provided for this
// market. This state is only seen during recovery for matches where the
// system has sent out a cancellation message for that particular market.
MarketStatusCancelled MarketStatus = -4
)
func (m MarketStatus) Val() int8 {
return int8(m)
}
func (m *MarketStatus) PtrVal() *int8 {
if m == nil {
return nil
}
v := int8(*m)
return &v
}
type CashoutStatus int8
const (
// available for cashout
CashoutStatusAvailable CashoutStatus = 1
// temporarily unavailable for cashout
CashoutStatusUnavailable CashoutStatus = -1
// permanently unavailable for cashout
CashoutStatusClosed CashoutStatus = -2
)
func (s *CashoutStatus) PtrVal() *int8 {
if s == nil {
return nil
}
v := int8(*s)
return &v
}
type Team int8
const (
TeamHome Team = 1
TeamAway Team = 2
)
func (t *Team) PtrVal() *int8 {
if t == nil {
return nil
}
v := int8(*t)
return &v
}
type EventStatus int8
const (
EventStatusNotStarted EventStatus = 0
EventStatusLive EventStatus = 1
EventStatusSuspended EventStatus = 2 // Used by the Premium Cricket odds producer
EventStatusEnded EventStatus = 3
EventStatusClosed EventStatus = 4
// Only one of the above statuses are possible in the odds_change message in
// the feed. However please note that other states are available in the API,
// but will not appear in the odds_change message. These are as following:
EventStatusCancelled EventStatus = 5
EventStatusDelayed EventStatus = 6
EventStatusInterrupted EventStatus = 7
EventStatusPostponed EventStatus = 8
EventStatusAbandoned EventStatus = 9
)
func (s EventStatus) Val() int8 {
return int8(s)
}
func (s *EventStatus) PtrVal() *int8 {
if s == nil {
return nil
}
v := int8(*s)
return &v
}
type OutcomeResult int8
const (
OutcomeResultUnknown OutcomeResult = 0
OutcomeResultLose OutcomeResult = 1
OutcomeResultWin OutcomeResult = 2
OutcomeResultVoid OutcomeResult = 3
OutcomeResultHalfLose OutcomeResult = 4
OutcomeResultHalfWin OutcomeResult = 5
OutcomeResultWinWithDeadHead OutcomeResult = 6
)
type OutcomeType int8
const (
OutcomeTypeDefault OutcomeType = iota
OutcomeTypePlayer
OutcomeTypeCompetitor
OutcomeTypeCompetitors
OutcomeTypeFreeText
OutcomeTypeUnknown OutcomeType = -1
)
type SpecifierType int8
const (
SpecifierTypeString SpecifierType = iota
SpecifierTypeInteger
SpecifierTypeDecimal
SpecifierTypeVariableText
SpecifierTypeUnknown SpecifierType = -1
)
type Gender int8
const (
GenderUnknown Gender = iota
Male
Female
)