@bp1222/stats-api 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +26 -0
- package/openapitools.json +14 -0
- package/package.json +20 -0
- package/spec/components/parameters/parameters.yaml +21 -0
- package/spec/components/parameters/query/date.yaml +5 -0
- package/spec/components/parameters/query/endDate.yaml +5 -0
- package/spec/components/parameters/query/eventTypes.yaml +5 -0
- package/spec/components/parameters/query/fields.yaml +10 -0
- package/spec/components/parameters/query/gamePks.yaml +5 -0
- package/spec/components/parameters/query/gameTypes.yaml +5 -0
- package/spec/components/parameters/query/hydrate.yaml +5 -0
- package/spec/components/parameters/query/leagueId.yaml +5 -0
- package/spec/components/parameters/query/leagueIds.yaml +7 -0
- package/spec/components/parameters/query/opponentId.yaml +5 -0
- package/spec/components/parameters/query/scheduleType.yaml +5 -0
- package/spec/components/parameters/query/season.yaml +5 -0
- package/spec/components/parameters/query/sportId.yaml +6 -0
- package/spec/components/parameters/query/startDate.yaml +5 -0
- package/spec/components/parameters/query/teamId.yaml +5 -0
- package/spec/components/parameters/query/venueIds.yaml +5 -0
- package/spec/components/schemas/division.yaml +32 -0
- package/spec/components/schemas/game.yaml +157 -0
- package/spec/components/schemas/gameTeam.yaml +30 -0
- package/spec/components/schemas/league.yaml +62 -0
- package/spec/components/schemas/record.yaml +110 -0
- package/spec/components/schemas/schedule.yaml +41 -0
- package/spec/components/schemas/schemas.yaml +22 -0
- package/spec/components/schemas/season.yaml +53 -0
- package/spec/components/schemas/sport.yaml +21 -0
- package/spec/components/schemas/standings.yaml +24 -0
- package/spec/components/schemas/team.yaml +50 -0
- package/spec/components/schemas/venue.yaml +18 -0
- package/spec/openapi.yaml +32 -0
- package/spec/paths/allSeasons.yaml +23 -0
- package/spec/paths/schedule.yaml +20 -0
- package/spec/paths/season.yaml +18 -0
- package/spec/paths/standings.yaml +27 -0
- package/spec/paths/teams.yaml +33 -0
- package/src/.openapi-generator/FILES +27 -0
- package/src/.openapi-generator/VERSION +1 -0
- package/src/.openapi-generator-ignore +23 -0
- package/src/apis/MlbApi.ts +328 -0
- package/src/apis/index.ts +3 -0
- package/src/index.ts +5 -0
- package/src/models/Division.ts +164 -0
- package/src/models/Game.ts +385 -0
- package/src/models/GameContent.ts +60 -0
- package/src/models/GameTeam.ts +117 -0
- package/src/models/GameTeams.ts +77 -0
- package/src/models/League.ts +190 -0
- package/src/models/MLBDivision.ts +164 -0
- package/src/models/MLBGame.ts +385 -0
- package/src/models/MLBGameContent.ts +60 -0
- package/src/models/MLBGameStatus.ts +122 -0
- package/src/models/MLBGameTeam.ts +117 -0
- package/src/models/MLBGameTeams.ts +77 -0
- package/src/models/MLBLeague.ts +190 -0
- package/src/models/MLBLeagueDates.ts +132 -0
- package/src/models/MLBRecord.ts +337 -0
- package/src/models/MLBSchedule.ts +105 -0
- package/src/models/MLBScheduleDay.ts +108 -0
- package/src/models/MLBSeason.ts +226 -0
- package/src/models/MLBSeasons.ts +67 -0
- package/src/models/MLBSport.ts +110 -0
- package/src/models/MLBStandings.ts +130 -0
- package/src/models/MLBStandingsList.ts +67 -0
- package/src/models/MLBStreak.ts +74 -0
- package/src/models/MLBTeam.ts +248 -0
- package/src/models/MLBTeamRecord.ts +76 -0
- package/src/models/MLBTeamRecord1.ts +88 -0
- package/src/models/MLBTeams.ts +67 -0
- package/src/models/MLBVenue.ts +95 -0
- package/src/models/Record.ts +337 -0
- package/src/models/Schedule.ts +105 -0
- package/src/models/Season.ts +226 -0
- package/src/models/Sport.ts +110 -0
- package/src/models/Standings.ts +130 -0
- package/src/models/Team.ts +248 -0
- package/src/models/Venue.ts +95 -0
- package/src/models/index.ts +24 -0
- package/src/runtime.ts +426 -0
- package/tsconfig.json +108 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* MLB StatAPI
|
|
5
|
+
* An spec API to consume the MLB Stat API
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.0.1
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
MLBSeasons,
|
|
19
|
+
MLBStandingsList,
|
|
20
|
+
MLBTeams,
|
|
21
|
+
Schedule,
|
|
22
|
+
Season,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
import {
|
|
25
|
+
MLBSeasonsFromJSON,
|
|
26
|
+
MLBSeasonsToJSON,
|
|
27
|
+
MLBStandingsListFromJSON,
|
|
28
|
+
MLBStandingsListToJSON,
|
|
29
|
+
MLBTeamsFromJSON,
|
|
30
|
+
MLBTeamsToJSON,
|
|
31
|
+
ScheduleFromJSON,
|
|
32
|
+
ScheduleToJSON,
|
|
33
|
+
SeasonFromJSON,
|
|
34
|
+
SeasonToJSON,
|
|
35
|
+
} from '../models/index';
|
|
36
|
+
|
|
37
|
+
export interface GetAllSeasonsRequest {
|
|
38
|
+
sportId: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface GetScheduleRequest {
|
|
42
|
+
sportId: number;
|
|
43
|
+
teamId?: number;
|
|
44
|
+
startDate?: string;
|
|
45
|
+
endDate?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface GetSeasonRequest {
|
|
49
|
+
sportId: number;
|
|
50
|
+
season: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface GetStandingsRequest {
|
|
54
|
+
leagueId: number;
|
|
55
|
+
season: string;
|
|
56
|
+
date?: string;
|
|
57
|
+
fields?: Array<string>;
|
|
58
|
+
hydrate?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface GetTeamsRequest {
|
|
62
|
+
sportId: number;
|
|
63
|
+
season: string;
|
|
64
|
+
leagueIds?: Array<number>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
export class MlbApi extends runtime.BaseAPI {
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Returns All Seasons
|
|
74
|
+
* Retrieves All Seasons over time
|
|
75
|
+
*/
|
|
76
|
+
async getAllSeasonsRaw(requestParameters: GetAllSeasonsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBSeasons>> {
|
|
77
|
+
if (requestParameters['sportId'] == null) {
|
|
78
|
+
throw new runtime.RequiredError(
|
|
79
|
+
'sportId',
|
|
80
|
+
'Required parameter "sportId" was null or undefined when calling getAllSeasons().'
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const queryParameters: any = {};
|
|
85
|
+
|
|
86
|
+
if (requestParameters['sportId'] != null) {
|
|
87
|
+
queryParameters['sportId'] = requestParameters['sportId'];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
91
|
+
|
|
92
|
+
const response = await this.request({
|
|
93
|
+
path: `/v1/seasons/all`,
|
|
94
|
+
method: 'GET',
|
|
95
|
+
headers: headerParameters,
|
|
96
|
+
query: queryParameters,
|
|
97
|
+
}, initOverrides);
|
|
98
|
+
|
|
99
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MLBSeasonsFromJSON(jsonValue));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Returns All Seasons
|
|
104
|
+
* Retrieves All Seasons over time
|
|
105
|
+
*/
|
|
106
|
+
async getAllSeasons(requestParameters: GetAllSeasonsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBSeasons> {
|
|
107
|
+
const response = await this.getAllSeasonsRaw(requestParameters, initOverrides);
|
|
108
|
+
return await response.value();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Returns Schedule
|
|
113
|
+
* Retrieves schedule
|
|
114
|
+
*/
|
|
115
|
+
async getScheduleRaw(requestParameters: GetScheduleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Schedule>> {
|
|
116
|
+
if (requestParameters['sportId'] == null) {
|
|
117
|
+
throw new runtime.RequiredError(
|
|
118
|
+
'sportId',
|
|
119
|
+
'Required parameter "sportId" was null or undefined when calling getSchedule().'
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const queryParameters: any = {};
|
|
124
|
+
|
|
125
|
+
if (requestParameters['sportId'] != null) {
|
|
126
|
+
queryParameters['sportId'] = requestParameters['sportId'];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (requestParameters['teamId'] != null) {
|
|
130
|
+
queryParameters['teamId'] = requestParameters['teamId'];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (requestParameters['startDate'] != null) {
|
|
134
|
+
queryParameters['startDate'] = requestParameters['startDate'];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (requestParameters['endDate'] != null) {
|
|
138
|
+
queryParameters['endDate'] = requestParameters['endDate'];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
142
|
+
|
|
143
|
+
const response = await this.request({
|
|
144
|
+
path: `/v1/schedule`,
|
|
145
|
+
method: 'GET',
|
|
146
|
+
headers: headerParameters,
|
|
147
|
+
query: queryParameters,
|
|
148
|
+
}, initOverrides);
|
|
149
|
+
|
|
150
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ScheduleFromJSON(jsonValue));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Returns Schedule
|
|
155
|
+
* Retrieves schedule
|
|
156
|
+
*/
|
|
157
|
+
async getSchedule(requestParameters: GetScheduleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Schedule> {
|
|
158
|
+
const response = await this.getScheduleRaw(requestParameters, initOverrides);
|
|
159
|
+
return await response.value();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Returns Season
|
|
164
|
+
* Retrieves season
|
|
165
|
+
*/
|
|
166
|
+
async getSeasonRaw(requestParameters: GetSeasonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Season>> {
|
|
167
|
+
if (requestParameters['sportId'] == null) {
|
|
168
|
+
throw new runtime.RequiredError(
|
|
169
|
+
'sportId',
|
|
170
|
+
'Required parameter "sportId" was null or undefined when calling getSeason().'
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (requestParameters['season'] == null) {
|
|
175
|
+
throw new runtime.RequiredError(
|
|
176
|
+
'season',
|
|
177
|
+
'Required parameter "season" was null or undefined when calling getSeason().'
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const queryParameters: any = {};
|
|
182
|
+
|
|
183
|
+
if (requestParameters['sportId'] != null) {
|
|
184
|
+
queryParameters['sportId'] = requestParameters['sportId'];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (requestParameters['season'] != null) {
|
|
188
|
+
queryParameters['season'] = requestParameters['season'];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
192
|
+
|
|
193
|
+
const response = await this.request({
|
|
194
|
+
path: `/v1/seasons`,
|
|
195
|
+
method: 'GET',
|
|
196
|
+
headers: headerParameters,
|
|
197
|
+
query: queryParameters,
|
|
198
|
+
}, initOverrides);
|
|
199
|
+
|
|
200
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SeasonFromJSON(jsonValue));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Returns Season
|
|
205
|
+
* Retrieves season
|
|
206
|
+
*/
|
|
207
|
+
async getSeason(requestParameters: GetSeasonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Season> {
|
|
208
|
+
const response = await this.getSeasonRaw(requestParameters, initOverrides);
|
|
209
|
+
return await response.value();
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Returns Standing
|
|
214
|
+
* Retrieves Standings
|
|
215
|
+
*/
|
|
216
|
+
async getStandingsRaw(requestParameters: GetStandingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBStandingsList>> {
|
|
217
|
+
if (requestParameters['leagueId'] == null) {
|
|
218
|
+
throw new runtime.RequiredError(
|
|
219
|
+
'leagueId',
|
|
220
|
+
'Required parameter "leagueId" was null or undefined when calling getStandings().'
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (requestParameters['season'] == null) {
|
|
225
|
+
throw new runtime.RequiredError(
|
|
226
|
+
'season',
|
|
227
|
+
'Required parameter "season" was null or undefined when calling getStandings().'
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const queryParameters: any = {};
|
|
232
|
+
|
|
233
|
+
if (requestParameters['leagueId'] != null) {
|
|
234
|
+
queryParameters['leagueId'] = requestParameters['leagueId'];
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (requestParameters['season'] != null) {
|
|
238
|
+
queryParameters['season'] = requestParameters['season'];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (requestParameters['date'] != null) {
|
|
242
|
+
queryParameters['date'] = requestParameters['date'];
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (requestParameters['fields'] != null) {
|
|
246
|
+
queryParameters['fields'] = requestParameters['fields']!.join(runtime.COLLECTION_FORMATS["csv"]);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (requestParameters['hydrate'] != null) {
|
|
250
|
+
queryParameters['hydrate'] = requestParameters['hydrate'];
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
254
|
+
|
|
255
|
+
const response = await this.request({
|
|
256
|
+
path: `/v1/standings`,
|
|
257
|
+
method: 'GET',
|
|
258
|
+
headers: headerParameters,
|
|
259
|
+
query: queryParameters,
|
|
260
|
+
}, initOverrides);
|
|
261
|
+
|
|
262
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MLBStandingsListFromJSON(jsonValue));
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Returns Standing
|
|
267
|
+
* Retrieves Standings
|
|
268
|
+
*/
|
|
269
|
+
async getStandings(requestParameters: GetStandingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBStandingsList> {
|
|
270
|
+
const response = await this.getStandingsRaw(requestParameters, initOverrides);
|
|
271
|
+
return await response.value();
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Returns Teams
|
|
276
|
+
* Retrieves Teams
|
|
277
|
+
*/
|
|
278
|
+
async getTeamsRaw(requestParameters: GetTeamsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBTeams>> {
|
|
279
|
+
if (requestParameters['sportId'] == null) {
|
|
280
|
+
throw new runtime.RequiredError(
|
|
281
|
+
'sportId',
|
|
282
|
+
'Required parameter "sportId" was null or undefined when calling getTeams().'
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (requestParameters['season'] == null) {
|
|
287
|
+
throw new runtime.RequiredError(
|
|
288
|
+
'season',
|
|
289
|
+
'Required parameter "season" was null or undefined when calling getTeams().'
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const queryParameters: any = {};
|
|
294
|
+
|
|
295
|
+
if (requestParameters['sportId'] != null) {
|
|
296
|
+
queryParameters['sportId'] = requestParameters['sportId'];
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (requestParameters['season'] != null) {
|
|
300
|
+
queryParameters['season'] = requestParameters['season'];
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (requestParameters['leagueIds'] != null) {
|
|
304
|
+
queryParameters['leagueIds'] = requestParameters['leagueIds'];
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
308
|
+
|
|
309
|
+
const response = await this.request({
|
|
310
|
+
path: `/v1/teams`,
|
|
311
|
+
method: 'GET',
|
|
312
|
+
headers: headerParameters,
|
|
313
|
+
query: queryParameters,
|
|
314
|
+
}, initOverrides);
|
|
315
|
+
|
|
316
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MLBTeamsFromJSON(jsonValue));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Returns Teams
|
|
321
|
+
* Retrieves Teams
|
|
322
|
+
*/
|
|
323
|
+
async getTeams(requestParameters: GetTeamsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBTeams> {
|
|
324
|
+
const response = await this.getTeamsRaw(requestParameters, initOverrides);
|
|
325
|
+
return await response.value();
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* MLB StatAPI
|
|
5
|
+
* An spec API to consume the MLB Stat API
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.0.1
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { League } from './League';
|
|
17
|
+
import {
|
|
18
|
+
LeagueFromJSON,
|
|
19
|
+
LeagueFromJSONTyped,
|
|
20
|
+
LeagueToJSON,
|
|
21
|
+
} from './League';
|
|
22
|
+
import type { Sport } from './Sport';
|
|
23
|
+
import {
|
|
24
|
+
SportFromJSON,
|
|
25
|
+
SportFromJSONTyped,
|
|
26
|
+
SportToJSON,
|
|
27
|
+
} from './Sport';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Division
|
|
31
|
+
*
|
|
32
|
+
* @export
|
|
33
|
+
* @interface Division
|
|
34
|
+
*/
|
|
35
|
+
export interface Division {
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof Division
|
|
40
|
+
*/
|
|
41
|
+
id: number;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof Division
|
|
46
|
+
*/
|
|
47
|
+
name: string;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof Division
|
|
52
|
+
*/
|
|
53
|
+
season?: string;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {string}
|
|
57
|
+
* @memberof Division
|
|
58
|
+
*/
|
|
59
|
+
nameShort?: string;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @memberof Division
|
|
64
|
+
*/
|
|
65
|
+
link?: string;
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @type {string}
|
|
69
|
+
* @memberof Division
|
|
70
|
+
*/
|
|
71
|
+
abbreviation?: string;
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @type {League}
|
|
75
|
+
* @memberof Division
|
|
76
|
+
*/
|
|
77
|
+
league?: League;
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @type {Sport}
|
|
81
|
+
* @memberof Division
|
|
82
|
+
*/
|
|
83
|
+
sport?: Sport;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* @type {boolean}
|
|
87
|
+
* @memberof Division
|
|
88
|
+
*/
|
|
89
|
+
hasWildcard?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
* @type {number}
|
|
93
|
+
* @memberof Division
|
|
94
|
+
*/
|
|
95
|
+
sortOrder?: number;
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
* @type {number}
|
|
99
|
+
* @memberof Division
|
|
100
|
+
*/
|
|
101
|
+
numPlayoffTeams?: number;
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* @type {boolean}
|
|
105
|
+
* @memberof Division
|
|
106
|
+
*/
|
|
107
|
+
active?: boolean;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Check if a given object implements the Division interface.
|
|
112
|
+
*/
|
|
113
|
+
export function instanceOfDivision(value: object): value is Division {
|
|
114
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
115
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function DivisionFromJSON(json: any): Division {
|
|
120
|
+
return DivisionFromJSONTyped(json, false);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function DivisionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Division {
|
|
124
|
+
if (json == null) {
|
|
125
|
+
return json;
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
|
|
129
|
+
'id': json['id'],
|
|
130
|
+
'name': json['name'],
|
|
131
|
+
'season': json['season'] == null ? undefined : json['season'],
|
|
132
|
+
'nameShort': json['nameShort'] == null ? undefined : json['nameShort'],
|
|
133
|
+
'link': json['link'] == null ? undefined : json['link'],
|
|
134
|
+
'abbreviation': json['abbreviation'] == null ? undefined : json['abbreviation'],
|
|
135
|
+
'league': json['league'] == null ? undefined : LeagueFromJSON(json['league']),
|
|
136
|
+
'sport': json['sport'] == null ? undefined : SportFromJSON(json['sport']),
|
|
137
|
+
'hasWildcard': json['hasWildcard'] == null ? undefined : json['hasWildcard'],
|
|
138
|
+
'sortOrder': json['sortOrder'] == null ? undefined : json['sortOrder'],
|
|
139
|
+
'numPlayoffTeams': json['numPlayoffTeams'] == null ? undefined : json['numPlayoffTeams'],
|
|
140
|
+
'active': json['active'] == null ? undefined : json['active'],
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function DivisionToJSON(value?: Division | null): any {
|
|
145
|
+
if (value == null) {
|
|
146
|
+
return value;
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
|
|
150
|
+
'id': value['id'],
|
|
151
|
+
'name': value['name'],
|
|
152
|
+
'season': value['season'],
|
|
153
|
+
'nameShort': value['nameShort'],
|
|
154
|
+
'link': value['link'],
|
|
155
|
+
'abbreviation': value['abbreviation'],
|
|
156
|
+
'league': LeagueToJSON(value['league']),
|
|
157
|
+
'sport': SportToJSON(value['sport']),
|
|
158
|
+
'hasWildcard': value['hasWildcard'],
|
|
159
|
+
'sortOrder': value['sortOrder'],
|
|
160
|
+
'numPlayoffTeams': value['numPlayoffTeams'],
|
|
161
|
+
'active': value['active'],
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
|