@bp1222/stats-api 0.1.5 → 0.1.7
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/dist/index.d.mts +554 -0
- package/dist/index.d.ts +554 -0
- package/dist/index.js +3 -0
- package/dist/index.mjs +1577 -0
- package/package.json +2 -2
- package/src/.openapi-generator/FILES +0 -26
- package/src/.openapi-generator/VERSION +0 -1
- package/src/.openapi-generator-ignore +0 -23
- package/src/apis/MlbApi.ts +0 -325
- package/src/apis/index.ts +0 -3
- package/src/index.ts +0 -5
- package/src/models/MLBDivision.ts +0 -164
- package/src/models/MLBGame.ts +0 -371
- package/src/models/MLBGameStatus.ts +0 -122
- package/src/models/MLBGameTeam.ts +0 -117
- package/src/models/MLBGameTeams.ts +0 -77
- package/src/models/MLBLeague.ts +0 -190
- package/src/models/MLBLeagueDates.ts +0 -132
- package/src/models/MLBLeagueRecord.ts +0 -87
- package/src/models/MLBRecord.ts +0 -337
- package/src/models/MLBSchedule.ts +0 -105
- package/src/models/MLBScheduleDay.ts +0 -108
- package/src/models/MLBSeason.ts +0 -226
- package/src/models/MLBSeasons.ts +0 -67
- package/src/models/MLBSport.ts +0 -110
- package/src/models/MLBStandings.ts +0 -130
- package/src/models/MLBStandingsList.ts +0 -67
- package/src/models/MLBStreak.ts +0 -74
- package/src/models/MLBTeam.ts +0 -248
- package/src/models/MLBTeams.ts +0 -67
- package/src/models/MLBVenue.ts +0 -95
- package/src/models/index.ts +0 -22
- package/src/runtime.ts +0 -426
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bp1222/stats-api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"build": "tsup src/index.ts --format cjs,esm --dts"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"
|
|
15
|
+
"dist/**"
|
|
16
16
|
],
|
|
17
17
|
"keywords": ["mlb", "stats-api"],
|
|
18
18
|
"author": "Dave Walker",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.openapi-generator-ignore
|
|
2
|
-
apis/MlbApi.ts
|
|
3
|
-
apis/index.ts
|
|
4
|
-
index.ts
|
|
5
|
-
models/MLBDivision.ts
|
|
6
|
-
models/MLBGame.ts
|
|
7
|
-
models/MLBGameStatus.ts
|
|
8
|
-
models/MLBGameTeam.ts
|
|
9
|
-
models/MLBGameTeams.ts
|
|
10
|
-
models/MLBLeague.ts
|
|
11
|
-
models/MLBLeagueDates.ts
|
|
12
|
-
models/MLBLeagueRecord.ts
|
|
13
|
-
models/MLBRecord.ts
|
|
14
|
-
models/MLBSchedule.ts
|
|
15
|
-
models/MLBScheduleDay.ts
|
|
16
|
-
models/MLBSeason.ts
|
|
17
|
-
models/MLBSeasons.ts
|
|
18
|
-
models/MLBSport.ts
|
|
19
|
-
models/MLBStandings.ts
|
|
20
|
-
models/MLBStandingsList.ts
|
|
21
|
-
models/MLBStreak.ts
|
|
22
|
-
models/MLBTeam.ts
|
|
23
|
-
models/MLBTeams.ts
|
|
24
|
-
models/MLBVenue.ts
|
|
25
|
-
models/index.ts
|
|
26
|
-
runtime.ts
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7.8.0
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# OpenAPI Generator Ignore
|
|
2
|
-
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
-
|
|
4
|
-
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
-
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
-
|
|
7
|
-
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
-
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
-
#ApiClient.cs
|
|
10
|
-
|
|
11
|
-
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
-
#foo/*/qux
|
|
13
|
-
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
-
|
|
15
|
-
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
-
#foo/**/qux
|
|
17
|
-
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
-
|
|
19
|
-
# You can also negate patterns with an exclamation (!).
|
|
20
|
-
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
-
#docs/*.md
|
|
22
|
-
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
-
#!docs/README.md
|
package/src/apis/MlbApi.ts
DELETED
|
@@ -1,325 +0,0 @@
|
|
|
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.1.5
|
|
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
|
-
MLBSchedule,
|
|
19
|
-
MLBSeasons,
|
|
20
|
-
MLBStandingsList,
|
|
21
|
-
MLBTeams,
|
|
22
|
-
} from '../models/index';
|
|
23
|
-
import {
|
|
24
|
-
MLBScheduleFromJSON,
|
|
25
|
-
MLBScheduleToJSON,
|
|
26
|
-
MLBSeasonsFromJSON,
|
|
27
|
-
MLBSeasonsToJSON,
|
|
28
|
-
MLBStandingsListFromJSON,
|
|
29
|
-
MLBStandingsListToJSON,
|
|
30
|
-
MLBTeamsFromJSON,
|
|
31
|
-
MLBTeamsToJSON,
|
|
32
|
-
} from '../models/index';
|
|
33
|
-
|
|
34
|
-
export interface GetAllSeasonsRequest {
|
|
35
|
-
sportId: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface GetScheduleRequest {
|
|
39
|
-
sportId: number;
|
|
40
|
-
teamId?: number;
|
|
41
|
-
startDate?: string;
|
|
42
|
-
endDate?: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface GetSeasonRequest {
|
|
46
|
-
sportId: number;
|
|
47
|
-
season: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface GetStandingsRequest {
|
|
51
|
-
leagueId: number;
|
|
52
|
-
season: string;
|
|
53
|
-
date?: string;
|
|
54
|
-
fields?: Array<string>;
|
|
55
|
-
hydrate?: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface GetTeamsRequest {
|
|
59
|
-
sportId: number;
|
|
60
|
-
season: string;
|
|
61
|
-
leagueIds?: Array<number>;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
*
|
|
66
|
-
*/
|
|
67
|
-
export class MlbApi extends runtime.BaseAPI {
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Returns All Seasons
|
|
71
|
-
* Retrieves All Seasons over time
|
|
72
|
-
*/
|
|
73
|
-
async getAllSeasonsRaw(requestParameters: GetAllSeasonsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBSeasons>> {
|
|
74
|
-
if (requestParameters['sportId'] == null) {
|
|
75
|
-
throw new runtime.RequiredError(
|
|
76
|
-
'sportId',
|
|
77
|
-
'Required parameter "sportId" was null or undefined when calling getAllSeasons().'
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const queryParameters: any = {};
|
|
82
|
-
|
|
83
|
-
if (requestParameters['sportId'] != null) {
|
|
84
|
-
queryParameters['sportId'] = requestParameters['sportId'];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
88
|
-
|
|
89
|
-
const response = await this.request({
|
|
90
|
-
path: `/v1/seasons/all`,
|
|
91
|
-
method: 'GET',
|
|
92
|
-
headers: headerParameters,
|
|
93
|
-
query: queryParameters,
|
|
94
|
-
}, initOverrides);
|
|
95
|
-
|
|
96
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => MLBSeasonsFromJSON(jsonValue));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Returns All Seasons
|
|
101
|
-
* Retrieves All Seasons over time
|
|
102
|
-
*/
|
|
103
|
-
async getAllSeasons(requestParameters: GetAllSeasonsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBSeasons> {
|
|
104
|
-
const response = await this.getAllSeasonsRaw(requestParameters, initOverrides);
|
|
105
|
-
return await response.value();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Returns Schedule
|
|
110
|
-
* Retrieves schedule
|
|
111
|
-
*/
|
|
112
|
-
async getScheduleRaw(requestParameters: GetScheduleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBSchedule>> {
|
|
113
|
-
if (requestParameters['sportId'] == null) {
|
|
114
|
-
throw new runtime.RequiredError(
|
|
115
|
-
'sportId',
|
|
116
|
-
'Required parameter "sportId" was null or undefined when calling getSchedule().'
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const queryParameters: any = {};
|
|
121
|
-
|
|
122
|
-
if (requestParameters['sportId'] != null) {
|
|
123
|
-
queryParameters['sportId'] = requestParameters['sportId'];
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (requestParameters['teamId'] != null) {
|
|
127
|
-
queryParameters['teamId'] = requestParameters['teamId'];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (requestParameters['startDate'] != null) {
|
|
131
|
-
queryParameters['startDate'] = requestParameters['startDate'];
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (requestParameters['endDate'] != null) {
|
|
135
|
-
queryParameters['endDate'] = requestParameters['endDate'];
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
139
|
-
|
|
140
|
-
const response = await this.request({
|
|
141
|
-
path: `/v1/schedule`,
|
|
142
|
-
method: 'GET',
|
|
143
|
-
headers: headerParameters,
|
|
144
|
-
query: queryParameters,
|
|
145
|
-
}, initOverrides);
|
|
146
|
-
|
|
147
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => MLBScheduleFromJSON(jsonValue));
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Returns Schedule
|
|
152
|
-
* Retrieves schedule
|
|
153
|
-
*/
|
|
154
|
-
async getSchedule(requestParameters: GetScheduleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBSchedule> {
|
|
155
|
-
const response = await this.getScheduleRaw(requestParameters, initOverrides);
|
|
156
|
-
return await response.value();
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Returns Season
|
|
161
|
-
* Retrieves season
|
|
162
|
-
*/
|
|
163
|
-
async getSeasonRaw(requestParameters: GetSeasonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBSeasons>> {
|
|
164
|
-
if (requestParameters['sportId'] == null) {
|
|
165
|
-
throw new runtime.RequiredError(
|
|
166
|
-
'sportId',
|
|
167
|
-
'Required parameter "sportId" was null or undefined when calling getSeason().'
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
if (requestParameters['season'] == null) {
|
|
172
|
-
throw new runtime.RequiredError(
|
|
173
|
-
'season',
|
|
174
|
-
'Required parameter "season" was null or undefined when calling getSeason().'
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const queryParameters: any = {};
|
|
179
|
-
|
|
180
|
-
if (requestParameters['sportId'] != null) {
|
|
181
|
-
queryParameters['sportId'] = requestParameters['sportId'];
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
if (requestParameters['season'] != null) {
|
|
185
|
-
queryParameters['season'] = requestParameters['season'];
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
189
|
-
|
|
190
|
-
const response = await this.request({
|
|
191
|
-
path: `/v1/seasons`,
|
|
192
|
-
method: 'GET',
|
|
193
|
-
headers: headerParameters,
|
|
194
|
-
query: queryParameters,
|
|
195
|
-
}, initOverrides);
|
|
196
|
-
|
|
197
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => MLBSeasonsFromJSON(jsonValue));
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Returns Season
|
|
202
|
-
* Retrieves season
|
|
203
|
-
*/
|
|
204
|
-
async getSeason(requestParameters: GetSeasonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBSeasons> {
|
|
205
|
-
const response = await this.getSeasonRaw(requestParameters, initOverrides);
|
|
206
|
-
return await response.value();
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Returns Standing
|
|
211
|
-
* Retrieves Standings
|
|
212
|
-
*/
|
|
213
|
-
async getStandingsRaw(requestParameters: GetStandingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBStandingsList>> {
|
|
214
|
-
if (requestParameters['leagueId'] == null) {
|
|
215
|
-
throw new runtime.RequiredError(
|
|
216
|
-
'leagueId',
|
|
217
|
-
'Required parameter "leagueId" was null or undefined when calling getStandings().'
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
if (requestParameters['season'] == null) {
|
|
222
|
-
throw new runtime.RequiredError(
|
|
223
|
-
'season',
|
|
224
|
-
'Required parameter "season" was null or undefined when calling getStandings().'
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
const queryParameters: any = {};
|
|
229
|
-
|
|
230
|
-
if (requestParameters['leagueId'] != null) {
|
|
231
|
-
queryParameters['leagueId'] = requestParameters['leagueId'];
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
if (requestParameters['season'] != null) {
|
|
235
|
-
queryParameters['season'] = requestParameters['season'];
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
if (requestParameters['date'] != null) {
|
|
239
|
-
queryParameters['date'] = requestParameters['date'];
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
if (requestParameters['fields'] != null) {
|
|
243
|
-
queryParameters['fields'] = requestParameters['fields']!.join(runtime.COLLECTION_FORMATS["csv"]);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (requestParameters['hydrate'] != null) {
|
|
247
|
-
queryParameters['hydrate'] = requestParameters['hydrate'];
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
251
|
-
|
|
252
|
-
const response = await this.request({
|
|
253
|
-
path: `/v1/standings`,
|
|
254
|
-
method: 'GET',
|
|
255
|
-
headers: headerParameters,
|
|
256
|
-
query: queryParameters,
|
|
257
|
-
}, initOverrides);
|
|
258
|
-
|
|
259
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => MLBStandingsListFromJSON(jsonValue));
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Returns Standing
|
|
264
|
-
* Retrieves Standings
|
|
265
|
-
*/
|
|
266
|
-
async getStandings(requestParameters: GetStandingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBStandingsList> {
|
|
267
|
-
const response = await this.getStandingsRaw(requestParameters, initOverrides);
|
|
268
|
-
return await response.value();
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Returns Teams
|
|
273
|
-
* Retrieves Teams
|
|
274
|
-
*/
|
|
275
|
-
async getTeamsRaw(requestParameters: GetTeamsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBTeams>> {
|
|
276
|
-
if (requestParameters['sportId'] == null) {
|
|
277
|
-
throw new runtime.RequiredError(
|
|
278
|
-
'sportId',
|
|
279
|
-
'Required parameter "sportId" was null or undefined when calling getTeams().'
|
|
280
|
-
);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (requestParameters['season'] == null) {
|
|
284
|
-
throw new runtime.RequiredError(
|
|
285
|
-
'season',
|
|
286
|
-
'Required parameter "season" was null or undefined when calling getTeams().'
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
const queryParameters: any = {};
|
|
291
|
-
|
|
292
|
-
if (requestParameters['sportId'] != null) {
|
|
293
|
-
queryParameters['sportId'] = requestParameters['sportId'];
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
if (requestParameters['season'] != null) {
|
|
297
|
-
queryParameters['season'] = requestParameters['season'];
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
if (requestParameters['leagueIds'] != null) {
|
|
301
|
-
queryParameters['leagueIds'] = requestParameters['leagueIds'];
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
305
|
-
|
|
306
|
-
const response = await this.request({
|
|
307
|
-
path: `/v1/teams`,
|
|
308
|
-
method: 'GET',
|
|
309
|
-
headers: headerParameters,
|
|
310
|
-
query: queryParameters,
|
|
311
|
-
}, initOverrides);
|
|
312
|
-
|
|
313
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => MLBTeamsFromJSON(jsonValue));
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Returns Teams
|
|
318
|
-
* Retrieves Teams
|
|
319
|
-
*/
|
|
320
|
-
async getTeams(requestParameters: GetTeamsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBTeams> {
|
|
321
|
-
const response = await this.getTeamsRaw(requestParameters, initOverrides);
|
|
322
|
-
return await response.value();
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
}
|
package/src/apis/index.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
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.1.5
|
|
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 { MLBLeague } from './MLBLeague';
|
|
17
|
-
import {
|
|
18
|
-
MLBLeagueFromJSON,
|
|
19
|
-
MLBLeagueFromJSONTyped,
|
|
20
|
-
MLBLeagueToJSON,
|
|
21
|
-
} from './MLBLeague';
|
|
22
|
-
import type { MLBSport } from './MLBSport';
|
|
23
|
-
import {
|
|
24
|
-
MLBSportFromJSON,
|
|
25
|
-
MLBSportFromJSONTyped,
|
|
26
|
-
MLBSportToJSON,
|
|
27
|
-
} from './MLBSport';
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Division
|
|
31
|
-
*
|
|
32
|
-
* @export
|
|
33
|
-
* @interface MLBDivision
|
|
34
|
-
*/
|
|
35
|
-
export interface MLBDivision {
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @type {number}
|
|
39
|
-
* @memberof MLBDivision
|
|
40
|
-
*/
|
|
41
|
-
id: number;
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @type {string}
|
|
45
|
-
* @memberof MLBDivision
|
|
46
|
-
*/
|
|
47
|
-
name: string;
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @type {string}
|
|
51
|
-
* @memberof MLBDivision
|
|
52
|
-
*/
|
|
53
|
-
season?: string;
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @type {string}
|
|
57
|
-
* @memberof MLBDivision
|
|
58
|
-
*/
|
|
59
|
-
nameShort?: string;
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
* @type {string}
|
|
63
|
-
* @memberof MLBDivision
|
|
64
|
-
*/
|
|
65
|
-
link?: string;
|
|
66
|
-
/**
|
|
67
|
-
*
|
|
68
|
-
* @type {string}
|
|
69
|
-
* @memberof MLBDivision
|
|
70
|
-
*/
|
|
71
|
-
abbreviation?: string;
|
|
72
|
-
/**
|
|
73
|
-
*
|
|
74
|
-
* @type {MLBLeague}
|
|
75
|
-
* @memberof MLBDivision
|
|
76
|
-
*/
|
|
77
|
-
league?: MLBLeague;
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
80
|
-
* @type {MLBSport}
|
|
81
|
-
* @memberof MLBDivision
|
|
82
|
-
*/
|
|
83
|
-
sport?: MLBSport;
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
* @type {boolean}
|
|
87
|
-
* @memberof MLBDivision
|
|
88
|
-
*/
|
|
89
|
-
hasWildcard?: boolean;
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
* @type {number}
|
|
93
|
-
* @memberof MLBDivision
|
|
94
|
-
*/
|
|
95
|
-
sortOrder?: number;
|
|
96
|
-
/**
|
|
97
|
-
*
|
|
98
|
-
* @type {number}
|
|
99
|
-
* @memberof MLBDivision
|
|
100
|
-
*/
|
|
101
|
-
numPlayoffTeams?: number;
|
|
102
|
-
/**
|
|
103
|
-
*
|
|
104
|
-
* @type {boolean}
|
|
105
|
-
* @memberof MLBDivision
|
|
106
|
-
*/
|
|
107
|
-
active?: boolean;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Check if a given object implements the MLBDivision interface.
|
|
112
|
-
*/
|
|
113
|
-
export function instanceOfMLBDivision(value: object): value is MLBDivision {
|
|
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 MLBDivisionFromJSON(json: any): MLBDivision {
|
|
120
|
-
return MLBDivisionFromJSONTyped(json, false);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export function MLBDivisionFromJSONTyped(json: any, ignoreDiscriminator: boolean): MLBDivision {
|
|
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 : MLBLeagueFromJSON(json['league']),
|
|
136
|
-
'sport': json['sport'] == null ? undefined : MLBSportFromJSON(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 MLBDivisionToJSON(value?: MLBDivision | 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': MLBLeagueToJSON(value['league']),
|
|
157
|
-
'sport': MLBSportToJSON(value['sport']),
|
|
158
|
-
'hasWildcard': value['hasWildcard'],
|
|
159
|
-
'sortOrder': value['sortOrder'],
|
|
160
|
-
'numPlayoffTeams': value['numPlayoffTeams'],
|
|
161
|
-
'active': value['active'],
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
|