-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapi_models.go
128 lines (115 loc) · 4.35 KB
/
api_models.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
package mlb
type Response struct {
Copyright string `json:"copyright"`
Message string `json:"message,omitempty"`
MessageNumber int `json:"messageNumber,omitempty"`
TotalItems int `json:"totalItems,omitempty"`
TotalEvents int `json:"totalEvents,omitempty"`
TotalGames int `json:"totalGames,omitempty"`
TotalGamesInProgress int `json:"totalGamesInProgress,omitempty"`
Dates []Date `json:"dates,omitempty"`
Teams []Team `json:"teams,omitempty"`
Venues []Venue `json:"venues,omitempty"`
Divisions []Division `json:"divisions,omitempty"`
}
type Date struct {
Date string `json:"date"`
TotalItems int `json:"totalItems"`
TotalEvents int `json:"totalEvents"`
TotalGames int `json:"totalGames"`
TotalGamesInProgress int `json:"totalGamesInProgress"`
Games []Game `json:"games"`
}
type Game struct {
Id int `json:"gamePk"`
Link string `json:"link"`
Type string `json:"gameType"`
Season string `json:"season"`
Date string `json:"gameDate"`
Status GameStatus `json:"status"`
Teams map[string]GameTeam `json:"teams"`
Venue Venue `json:"venue"`
Content struct {
Link string `json:"link"`
} `json:"content"`
DoubleHeader string `json:"doubleHeader"`
GamedayType string `json:"gamedayType"`
Tiebreaker string `json:"tiebreaker"`
GameNumber int `json:"gameNumber"`
CalendarEventID string `json:"calendarEventID"`
SeasonDisplay string `json:"seasonDisplay"`
DayNight string `json:"dayNight"`
ScheduledInnings int `json:"scheduledInnings"`
GamesInSeries int `json:"gamesInSeries"`
SeriesGameNumber int `json:"seriesGameNumber"`
SeriesDescription string `json:"seriesDescription"`
RecordSource string `json:"recordSource"`
IfNecessary string `json:"ifNecessary"`
IfNecessaryDescription string `json:"ifNecessaryDescription"`
Events []Event `json:""`
}
type GameStatus struct {
AbstractGameState string `json:"abstractGameState"`
AbstractGameCode string `json:"abstractGameCode"`
CodedGameState string `json:"codedGameState"`
DetailedState string `json:"detailedState"`
StatusCode string `json:"statusCode"`
}
type Venue struct {
Id int `json:"id"`
Name string `json:"name"`
Link string `json:"link"`
}
type Event struct{}
type GameTeam struct {
LeagueRecord LeagueRecord `json:"leagueRecord"`
Team Team `json:"team"`
IsWinner bool `json:"isWinner"`
Score int `json:"score"`
SplitSquad bool `json:"splitSquad"`
SeriesNumber int `json:"seriesNumber"`
}
type Team struct {
Id int `json:"id"`
Name string `json:"name"`
Link string `json:"link"`
Venue Venue `json:"venue"`
TeamCode string `json:"teamCode"`
FileCode string `json:"fileCode"`
Abbreviation string `json:"abbreviation"`
TeamName string `json:"teamName"`
LocationName string `json:"locationName"`
FirstYearOfPlay string `json:"firstYearOfPlay"`
League League `json:"league"`
Division Division `json:"division"`
Sport Sport `json:"sport"`
ShortName string `json:"shortName"`
SpringLeague League `json:"springLeague"`
Active bool `json:"active"`
}
type LeagueRecord struct {
Wins int `json:"wins"`
Losses int `json:"losses"`
Percent string `json:"pct"`
}
type Sport struct {
Id int `json:"id"`
Name string `json:"name"`
Link string `json:"link"`
}
type League struct {
Id int `json:"id"`
Name string `json:"name"`
Link string `json:"link"`
Abbreviation string `json:"abbreviation"`
}
type Division struct {
Id int `json:"id"`
Name string `json:"name"`
NameShort string `json:"nameShort,omitempty"`
Link string `json:"link"`
Abbreviation string `json:"abbreviation,omitempty"`
League League `json:"league,omitempty"`
Sport Sport `json:"sport,omitempty"`
HasWildcard bool `json:"hasWildcard,omitempty"`
}