UNPKG

sportradar-api-client

Version:

Node and NestJS wrappers for Sportradar feeds

952 lines 50.1 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultSportradarMlbApiService = void 0; const common_1 = require("@nestjs/common"); const axios_1 = require("@nestjs/axios"); const configuration_1 = require("../configuration"); let DefaultSportradarMlbApiService = class DefaultSportradarMlbApiService { constructor(httpClient, configuration) { this.httpClient = httpClient; this.basePath = 'https://api.sportradar.com/mlb/production/v7'; this.defaultHeaders = {}; this.configuration = new configuration_1.Configuration(); this.configuration = configuration || this.configuration; this.basePath = (configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || this.basePath; } canConsumeForm(consumes) { const form = 'multipart/form-data'; return consumes.includes(form); } dailyBoxscore(locale, year, month, day, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling dailyBoxscore.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling dailyBoxscore.'); } if (month === null || month === undefined) { throw new Error('Required parameter month was null or undefined when calling dailyBoxscore.'); } if (day === null || day === undefined) { throw new Error('Required parameter day was null or undefined when calling dailyBoxscore.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling dailyBoxscore.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/games/${encodeURIComponent(String(year))}/${encodeURIComponent(String(month))}/${encodeURIComponent(String(day))}/boxscore.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } dailyChangeLog(locale, year, month, day, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling dailyChangeLog.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling dailyChangeLog.'); } if (month === null || month === undefined) { throw new Error('Required parameter month was null or undefined when calling dailyChangeLog.'); } if (day === null || day === undefined) { throw new Error('Required parameter day was null or undefined when calling dailyChangeLog.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling dailyChangeLog.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/league/${encodeURIComponent(String(year))}/${encodeURIComponent(String(month))}/${encodeURIComponent(String(day))}/changes.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } dailySchedule(locale, year, month, day, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling dailySchedule.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling dailySchedule.'); } if (month === null || month === undefined) { throw new Error('Required parameter month was null or undefined when calling dailySchedule.'); } if (day === null || day === undefined) { throw new Error('Required parameter day was null or undefined when calling dailySchedule.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling dailySchedule.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/games/${encodeURIComponent(String(year))}/${encodeURIComponent(String(month))}/${encodeURIComponent(String(day))}/schedule.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } dailySummary(locale, year, month, day, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling dailySummary.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling dailySummary.'); } if (month === null || month === undefined) { throw new Error('Required parameter month was null or undefined when calling dailySummary.'); } if (day === null || day === undefined) { throw new Error('Required parameter day was null or undefined when calling dailySummary.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling dailySummary.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/games/${encodeURIComponent(String(year))}/${encodeURIComponent(String(month))}/${encodeURIComponent(String(day))}/summary.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } dailyTransactions(locale, year, month, day, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling dailyTransactions.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling dailyTransactions.'); } if (month === null || month === undefined) { throw new Error('Required parameter month was null or undefined when calling dailyTransactions.'); } if (day === null || day === undefined) { throw new Error('Required parameter day was null or undefined when calling dailyTransactions.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling dailyTransactions.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/league/${encodeURIComponent(String(year))}/${encodeURIComponent(String(month))}/${encodeURIComponent(String(day))}/transactions.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } gameBoxscore(locale, game_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling gameBoxscore.'); } if (game_id === null || game_id === undefined) { throw new Error('Required parameter game_id was null or undefined when calling gameBoxscore.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling gameBoxscore.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/games/${encodeURIComponent(String(game_id))}/boxscore.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } gameExtendedSummary(locale, game_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling gameExtendedSummary.'); } if (game_id === null || game_id === undefined) { throw new Error('Required parameter game_id was null or undefined when calling gameExtendedSummary.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling gameExtendedSummary.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/games/${encodeURIComponent(String(game_id))}/extended_summary.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } gameSummary(locale, game_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling gameSummary.'); } if (game_id === null || game_id === undefined) { throw new Error('Required parameter game_id was null or undefined when calling gameSummary.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling gameSummary.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/games/${encodeURIComponent(String(game_id))}/summary.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } glossary(locale, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling glossary.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling glossary.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/league/glossary.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } injuries(locale, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling injuries.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling injuries.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/league/injuries.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } leagueDepthChart(locale, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling leagueDepthChart.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling leagueDepthChart.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/league/depth_charts.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } leagueHierarchy(locale, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling leagueHierarchy.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling leagueHierarchy.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/league/hierarchy.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } leagueLeaders(locale, year, season_type, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling leagueLeaders.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling leagueLeaders.'); } if (season_type === null || season_type === undefined) { throw new Error('Required parameter season_type was null or undefined when calling leagueLeaders.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling leagueLeaders.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/seasons/${encodeURIComponent(String(year))}/${encodeURIComponent(String(season_type))}/leaders/statistics.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } leagueSchedule(locale, year, season_type, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling leagueSchedule.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling leagueSchedule.'); } if (season_type === null || season_type === undefined) { throw new Error('Required parameter season_type was null or undefined when calling leagueSchedule.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling leagueSchedule.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/games/${encodeURIComponent(String(year))}/${encodeURIComponent(String(season_type))}/schedule.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } playByPlay(locale, game_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling playByPlay.'); } if (game_id === null || game_id === undefined) { throw new Error('Required parameter game_id was null or undefined when calling playByPlay.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling playByPlay.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/games/${encodeURIComponent(String(game_id))}/pbp.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } playerProfile(locale, player_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling playerProfile.'); } if (player_id === null || player_id === undefined) { throw new Error('Required parameter player_id was null or undefined when calling playerProfile.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling playerProfile.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/players/${encodeURIComponent(String(player_id))}/profile.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } rankings(locale, year, season_type, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling rankings.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling rankings.'); } if (season_type === null || season_type === undefined) { throw new Error('Required parameter season_type was null or undefined when calling rankings.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling rankings.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/seasons/${encodeURIComponent(String(year))}/${encodeURIComponent(String(season_type))}/rankings.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } seasonalPitchMetrics(locale, player_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling seasonalPitchMetrics.'); } if (player_id === null || player_id === undefined) { throw new Error('Required parameter player_id was null or undefined when calling seasonalPitchMetrics.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling seasonalPitchMetrics.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/players/${encodeURIComponent(String(player_id))}/pitch_metrics.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } seasonalSplits(locale, year, season_type, team_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling seasonalSplits.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling seasonalSplits.'); } if (season_type === null || season_type === undefined) { throw new Error('Required parameter season_type was null or undefined when calling seasonalSplits.'); } if (team_id === null || team_id === undefined) { throw new Error('Required parameter team_id was null or undefined when calling seasonalSplits.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling seasonalSplits.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/seasons/${encodeURIComponent(String(year))}/${encodeURIComponent(String(season_type))}/teams/${encodeURIComponent(String(team_id))}/splits.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } seasonalStatistics(locale, year, season_type, team_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling seasonalStatistics.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling seasonalStatistics.'); } if (season_type === null || season_type === undefined) { throw new Error('Required parameter season_type was null or undefined when calling seasonalStatistics.'); } if (team_id === null || team_id === undefined) { throw new Error('Required parameter team_id was null or undefined when calling seasonalStatistics.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling seasonalStatistics.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/seasons/${encodeURIComponent(String(year))}/${encodeURIComponent(String(season_type))}/teams/${encodeURIComponent(String(team_id))}/statistics.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } seasonalTransactions(locale, year, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling seasonalTransactions.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling seasonalTransactions.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling seasonalTransactions.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/league/${encodeURIComponent(String(year))}/transactions.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } seasons(locale, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling seasons.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling seasons.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/league/seasons.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } seriesSchedule(locale, year, season_type, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling seriesSchedule.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling seriesSchedule.'); } if (season_type === null || season_type === undefined) { throw new Error('Required parameter season_type was null or undefined when calling seriesSchedule.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling seriesSchedule.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/series/${encodeURIComponent(String(year))}/${encodeURIComponent(String(season_type))}/schedule.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } seriesStatistics(locale, series_id, team_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling seriesStatistics.'); } if (series_id === null || series_id === undefined) { throw new Error('Required parameter series_id was null or undefined when calling seriesStatistics.'); } if (team_id === null || team_id === undefined) { throw new Error('Required parameter team_id was null or undefined when calling seriesStatistics.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling seriesStatistics.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/series/${encodeURIComponent(String(series_id))}/teams/${encodeURIComponent(String(team_id))}/statistics.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } seriesSummary(locale, series_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling seriesSummary.'); } if (series_id === null || series_id === undefined) { throw new Error('Required parameter series_id was null or undefined when calling seriesSummary.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling seriesSummary.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/series/${encodeURIComponent(String(series_id))}/summary.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } standings(locale, year, season_type, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling standings.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling standings.'); } if (season_type === null || season_type === undefined) { throw new Error('Required parameter season_type was null or undefined when calling standings.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling standings.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/seasons/${encodeURIComponent(String(year))}/${encodeURIComponent(String(season_type))}/standings.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } statcastLeaders(locale, year, season_type, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling statcastLeaders.'); } if (year === null || year === undefined) { throw new Error('Required parameter year was null or undefined when calling statcastLeaders.'); } if (season_type === null || season_type === undefined) { throw new Error('Required parameter season_type was null or undefined when calling statcastLeaders.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling statcastLeaders.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/seasons/${encodeURIComponent(String(year))}/${encodeURIComponent(String(season_type))}/leaders/statcast.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } teamDepthCharts(locale, team_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling teamDepthCharts.'); } if (team_id === null || team_id === undefined) { throw new Error('Required parameter team_id was null or undefined when calling teamDepthCharts.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling teamDepthCharts.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/teams/${encodeURIComponent(String(team_id))}/depth_chart.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } teamProfile(locale, team_id, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling teamProfile.'); } if (team_id === null || team_id === undefined) { throw new Error('Required parameter team_id was null or undefined when calling teamProfile.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling teamProfile.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/teams/${encodeURIComponent(String(team_id))}/profile.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } venues(locale, format) { if (locale === null || locale === undefined) { throw new Error('Required parameter locale was null or undefined when calling venues.'); } if (format === null || format === undefined) { throw new Error('Required parameter format was null or undefined when calling venues.'); } const headers = { ...this.defaultHeaders }; const queryParameters = new URLSearchParams(); if (this.configuration.apiKeys["api_key"]) { queryParameters.append('api_key', this.configuration.apiKeys["api_key"]); } const httpHeaderAccepts = [ 'application/json' ]; const httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers['Accept'] = httpHeaderAcceptSelected; } const consumes = []; return this.httpClient.get(`${this.basePath}/${encodeURIComponent(String(locale))}/league/venues.${encodeURIComponent(String(format))}`, { withCredentials: this.configuration.withCredentials, params: queryParameters, headers: headers }); } }; exports.DefaultSportradarMlbApiService = DefaultSportradarMlbApiService; exports.DefaultSportradarMlbApiService = DefaultSportradarMlbApiService = __decorate([ (0, common_1.Injectable)(), __param(1, (0, common_1.Optional)()), __metadata("design:paramty