/
gen_boxscore_misc.go
352 lines (328 loc) · 13.3 KB
/
gen_boxscore_misc.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
package baller
import (
"net/url"
)
type BoxscoreMiscOptions struct {
GameID string
StartPeriod int
EndPeriod int
StartRange int
EndRange int
RangeType int
}
type BoxscoreMiscResponse struct {
SqlPlayersMisc []BoxscoreMiscSqlPlayersMisc
SqlTeamsMisc []BoxscoreMiscSqlTeamsMisc
Table2 []BoxscoreMiscTable2
Table3 []BoxscoreMiscTable3
Table4 []BoxscoreMiscTable4
Table5 []BoxscoreMiscTable5
Table6 []BoxscoreMiscTable6
Table7 []BoxscoreMiscTable7
Table8 []BoxscoreMiscTable8
Table9 []BoxscoreMiscTable9
Table10 []BoxscoreMiscTable10
Table11 []BoxscoreMiscTable11
Table12 []BoxscoreMiscTable12
Table13 []BoxscoreMiscTable13
Table14 []BoxscoreMiscTable14
}
func (c *Client) BoxscoreMisc(options *BoxscoreMiscOptions) (*BoxscoreMiscResponse, error) {
var (
q = url.Values{}
url = baseURL + "boxscoremisc?"
dest BoxscoreMiscResponse
res result
)
q.Set("GameID", encodeString(options.GameID))
q.Set("StartPeriod", encodeInt(options.StartPeriod))
q.Set("EndPeriod", encodeInt(options.EndPeriod))
q.Set("StartRange", encodeInt(options.StartRange))
q.Set("EndRange", encodeInt(options.EndRange))
q.Set("RangeType", encodeInt(options.RangeType))
if err := c.do(url+q.Encode(), &res); err != nil {
return nil, err
}
err := res.unmarshalResultSets(map[string]interface{}{
"sqlPlayersMisc": &dest.SqlPlayersMisc,
"sqlTeamsMisc": &dest.SqlTeamsMisc,
"Table2": &dest.Table2,
"Table3": &dest.Table3,
"Table4": &dest.Table4,
"Table5": &dest.Table5,
"Table6": &dest.Table6,
"Table7": &dest.Table7,
"Table8": &dest.Table8,
"Table9": &dest.Table9,
"Table10": &dest.Table10,
"Table11": &dest.Table11,
"Table12": &dest.Table12,
"Table13": &dest.Table13,
"Table14": &dest.Table14,
})
if err != nil {
return nil, err
}
return &dest, nil
}
type BoxscoreMiscSqlPlayersMisc struct {
GameDateEst string `header:"GAME_DATE_EST"`
GameSequence int `header:"GAME_SEQUENCE"`
GameID string `header:"GAME_ID"`
GameStatusID int `header:"GAME_STATUS_ID"`
GameStatusText string `header:"GAME_STATUS_TEXT"`
Gamecode string `header:"GAMECODE"`
HomeTeamID int `header:"HOME_TEAM_ID"`
VisitorTeamID int `header:"VISITOR_TEAM_ID"`
Season string `header:"SEASON"`
LivePeriod int `header:"LIVE_PERIOD"`
LivePcTime string `header:"LIVE_PC_TIME"`
NatlTvBroadcasterAbbreviation string `header:"NATL_TV_BROADCASTER_ABBREVIATION"`
LivePeriodTimeBcast string `header:"LIVE_PERIOD_TIME_BCAST"`
WhStatus int `header:"WH_STATUS"`
}
type BoxscoreMiscSqlTeamsMisc struct {
GameDateEst string `header:"GAME_DATE_EST"`
GameSequence int `header:"GAME_SEQUENCE"`
GameID string `header:"GAME_ID"`
TeamID int `header:"TEAM_ID"`
TeamAbbreviation string `header:"TEAM_ABBREVIATION"`
TeamCityName string `header:"TEAM_CITY_NAME"`
TeamWinsLosses string `header:"TEAM_WINS_LOSSES"`
PtsQtr1 int `header:"PTS_QTR1"`
PtsQtr2 int `header:"PTS_QTR2"`
PtsQtr3 int `header:"PTS_QTR3"`
PtsQtr4 int `header:"PTS_QTR4"`
PtsOt1 int `header:"PTS_OT1"`
PtsOt2 int `header:"PTS_OT2"`
PtsOt3 int `header:"PTS_OT3"`
PtsOt4 int `header:"PTS_OT4"`
PtsOt5 int `header:"PTS_OT5"`
PtsOt6 int `header:"PTS_OT6"`
PtsOt7 int `header:"PTS_OT7"`
PtsOt8 int `header:"PTS_OT8"`
PtsOt9 int `header:"PTS_OT9"`
PtsOt10 int `header:"PTS_OT10"`
Pts int `header:"PTS"`
}
type BoxscoreMiscTable2 struct {
GameID string `header:"GAME_ID"`
HomeTeamID int `header:"HOME_TEAM_ID"`
VisitorTeamID int `header:"VISITOR_TEAM_ID"`
GameDateEst string `header:"GAME_DATE_EST"`
HomeTeamWins int `header:"HOME_TEAM_WINS"`
HomeTeamLosses int `header:"HOME_TEAM_LOSSES"`
SeriesLeader string `header:"SERIES_LEADER"`
}
type BoxscoreMiscTable3 struct {
GameID string `header:"GAME_ID"`
LastGameID string `header:"LAST_GAME_ID"`
LastGameDateEst string `header:"LAST_GAME_DATE_EST"`
LastGameHomeTeamID int `header:"LAST_GAME_HOME_TEAM_ID"`
LastGameHomeTeamCity string `header:"LAST_GAME_HOME_TEAM_CITY"`
LastGameHomeTeamName string `header:"LAST_GAME_HOME_TEAM_NAME"`
LastGameHomeTeamAbbreviation string `header:"LAST_GAME_HOME_TEAM_ABBREVIATION"`
LastGameHomeTeamPoints int `header:"LAST_GAME_HOME_TEAM_POINTS"`
LastGameVisitorTeamID int `header:"LAST_GAME_VISITOR_TEAM_ID"`
LastGameVisitorTeamCity string `header:"LAST_GAME_VISITOR_TEAM_CITY"`
LastGameVisitorTeamName string `header:"LAST_GAME_VISITOR_TEAM_NAME"`
LastGameVisitorTeamCity1 string `header:"LAST_GAME_VISITOR_TEAM_CITY1"`
LastGameVisitorTeamPoints int `header:"LAST_GAME_VISITOR_TEAM_POINTS"`
}
type BoxscoreMiscTable4 struct {
GameID string `header:"GAME_ID"`
TeamID int `header:"TEAM_ID"`
TeamAbbreviation string `header:"TEAM_ABBREVIATION"`
TeamCity string `header:"TEAM_CITY"`
PlayerID int `header:"PLAYER_ID"`
PlayerName string `header:"PLAYER_NAME"`
StartPosition string `header:"START_POSITION"`
Comment string `header:"COMMENT"`
Min string `header:"MIN"`
Fgm int `header:"FGM"`
Fga int `header:"FGA"`
FgPct float32 `header:"FG_PCT"`
Fg3m int `header:"FG3M"`
Fg3a int `header:"FG3A"`
Fg3Pct float32 `header:"FG3_PCT"`
Ftm int `header:"FTM"`
Fta int `header:"FTA"`
FtPct float32 `header:"FT_PCT"`
Oreb int `header:"OREB"`
Dreb int `header:"DREB"`
Reb int `header:"REB"`
Ast int `header:"AST"`
Stl int `header:"STL"`
Blk int `header:"BLK"`
To int `header:"TO"`
Pf int `header:"PF"`
Pts int `header:"PTS"`
PlusMinus float32 `header:"PLUS_MINUS"`
}
type BoxscoreMiscTable5 struct {
GameID string `header:"GAME_ID"`
TeamID int `header:"TEAM_ID"`
TeamName string `header:"TEAM_NAME"`
TeamAbbreviation string `header:"TEAM_ABBREVIATION"`
TeamCity string `header:"TEAM_CITY"`
Min string `header:"MIN"`
Fgm int `header:"FGM"`
Fga int `header:"FGA"`
FgPct float32 `header:"FG_PCT"`
Fg3m int `header:"FG3M"`
Fg3a int `header:"FG3A"`
Fg3Pct float32 `header:"FG3_PCT"`
Ftm int `header:"FTM"`
Fta int `header:"FTA"`
FtPct float32 `header:"FT_PCT"`
Oreb int `header:"OREB"`
Dreb int `header:"DREB"`
Reb int `header:"REB"`
Ast int `header:"AST"`
Stl int `header:"STL"`
Blk int `header:"BLK"`
To int `header:"TO"`
Pf int `header:"PF"`
Pts int `header:"PTS"`
PlusMinus float32 `header:"PLUS_MINUS"`
}
type BoxscoreMiscTable6 struct {
LeagueID string `header:"LEAGUE_ID"`
SeasonID string `header:"SEASON_ID"`
TeamID int `header:"TEAM_ID"`
TeamAbbreviation string `header:"TEAM_ABBREVIATION"`
TeamCity string `header:"TEAM_CITY"`
PtsPaint int `header:"PTS_PAINT"`
Pts2ndChance int `header:"PTS_2ND_CHANCE"`
PtsFb int `header:"PTS_FB"`
LargestLead int `header:"LARGEST_LEAD"`
LeadChanges int `header:"LEAD_CHANGES"`
TimesTied int `header:"TIMES_TIED"`
}
type BoxscoreMiscTable7 struct {
OfficialID int `header:"OFFICIAL_ID"`
FirstName string `header:"FIRST_NAME"`
LastName string `header:"LAST_NAME"`
JerseyNum string `header:"JERSEY_NUM"`
}
type BoxscoreMiscTable8 struct {
GameDate string `header:"GAME_DATE"`
Attendance int `header:"ATTENDANCE"`
GameTime string `header:"GAME_TIME"`
}
type BoxscoreMiscTable9 struct {
PlayerID int `header:"PLAYER_ID"`
FirstName string `header:"FIRST_NAME"`
LastName string `header:"LAST_NAME"`
JerseyNum string `header:"JERSEY_NUM"`
TeamID int `header:"TEAM_ID"`
TeamCity string `header:"TEAM_CITY"`
TeamName string `header:"TEAM_NAME"`
TeamAbbreviation string `header:"TEAM_ABBREVIATION"`
}
type BoxscoreMiscTable10 struct {
GameID string `header:"GAME_ID"`
VideoAvailableFlag int `header:"VIDEO_AVAILABLE_FLAG"`
PtAvailable int `header:"PT_AVAILABLE"`
}
type BoxscoreMiscTable11 struct {
GameID string `header:"GAME_ID"`
TeamID int `header:"TEAM_ID"`
TeamAbbreviation string `header:"TEAM_ABBREVIATION"`
TeamCity string `header:"TEAM_CITY"`
PlayerID int `header:"PLAYER_ID"`
PlayerName string `header:"PLAYER_NAME"`
StartPosition string `header:"START_POSITION"`
Comment string `header:"COMMENT"`
Min string `header:"MIN"`
Spd float32 `header:"SPD"`
Dist float32 `header:"DIST"`
Orbc int `header:"ORBC"`
Drbc int `header:"DRBC"`
Rbc int `header:"RBC"`
Tchs int `header:"TCHS"`
Sast int `header:"SAST"`
Ftast int `header:"FTAST"`
Pass int `header:"PASS"`
Ast int `header:"AST"`
Cfgm int `header:"CFGM"`
Cfga int `header:"CFGA"`
CfgPct float32 `header:"CFG_PCT"`
Ufgm int `header:"UFGM"`
Ufga int `header:"UFGA"`
UfgPct float32 `header:"UFG_PCT"`
FgPct float32 `header:"FG_PCT"`
Dfgm int `header:"DFGM"`
Dfga int `header:"DFGA"`
DfgPct float32 `header:"DFG_PCT"`
}
type BoxscoreMiscTable12 struct {
GameID string `header:"GAME_ID"`
TeamID int `header:"TEAM_ID"`
TeamNickname string `header:"TEAM_NICKNAME"`
TeamAbbreviation string `header:"TEAM_ABBREVIATION"`
TeamCity string `header:"TEAM_CITY"`
Min string `header:"MIN"`
Dist float32 `header:"DIST"`
Orbc int `header:"ORBC"`
Drbc int `header:"DRBC"`
Rbc int `header:"RBC"`
Tchs int `header:"TCHS"`
Sast int `header:"SAST"`
Ftast int `header:"FTAST"`
Pass int `header:"PASS"`
Ast int `header:"AST"`
Cfgm int `header:"CFGM"`
Cfga int `header:"CFGA"`
CfgPct float32 `header:"CFG_PCT"`
Ufgm int `header:"UFGM"`
Ufga int `header:"UFGA"`
UfgPct float32 `header:"UFG_PCT"`
FgPct float32 `header:"FG_PCT"`
Dfgm int `header:"DFGM"`
Dfga int `header:"DFGA"`
DfgPct float32 `header:"DFG_PCT"`
}
type BoxscoreMiscTable13 struct {
GameID string `header:"GAME_ID"`
TeamID int `header:"TEAM_ID"`
TeamAbbreviation string `header:"TEAM_ABBREVIATION"`
TeamCity string `header:"TEAM_CITY"`
PlayerID int `header:"PLAYER_ID"`
PlayerName string `header:"PLAYER_NAME"`
StartPosition string `header:"START_POSITION"`
Comment string `header:"COMMENT"`
Min string `header:"MIN"`
PtsOffTov int `header:"PTS_OFF_TOV"`
Pts2ndChance int `header:"PTS_2ND_CHANCE"`
PtsFb int `header:"PTS_FB"`
PtsPaint int `header:"PTS_PAINT"`
OppPtsOffTov int `header:"OPP_PTS_OFF_TOV"`
OppPts2ndChance int `header:"OPP_PTS_2ND_CHANCE"`
OppPtsFb int `header:"OPP_PTS_FB"`
OppPtsPaint int `header:"OPP_PTS_PAINT"`
Blk int `header:"BLK"`
Blka int `header:"BLKA"`
Pf int `header:"PF"`
Pfd int `header:"PFD"`
}
type BoxscoreMiscTable14 struct {
GameID string `header:"GAME_ID"`
TeamID int `header:"TEAM_ID"`
TeamName string `header:"TEAM_NAME"`
TeamAbbreviation string `header:"TEAM_ABBREVIATION"`
TeamCity string `header:"TEAM_CITY"`
Min string `header:"MIN"`
PtsOffTov float32 `header:"PTS_OFF_TOV"`
Pts2ndChance float32 `header:"PTS_2ND_CHANCE"`
PtsFb float32 `header:"PTS_FB"`
PtsPaint float32 `header:"PTS_PAINT"`
OppPtsOffTov float32 `header:"OPP_PTS_OFF_TOV"`
OppPts2ndChance float32 `header:"OPP_PTS_2ND_CHANCE"`
OppPtsFb float32 `header:"OPP_PTS_FB"`
OppPtsPaint float32 `header:"OPP_PTS_PAINT"`
Blk int `header:"BLK"`
Blka int `header:"BLKA"`
Pf int `header:"PF"`
Pfd int `header:"PFD"`
}