UNPKG

sleeper-api-tsclient

Version:

Typescript client for the sleeper api

688 lines 46.6 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __generator = (this && this.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.LeaguesApiResponseProcessor = exports.LeaguesApiRequestFactory = void 0; var baseapi_1 = require("./baseapi"); var http_1 = require("../http/http"); var ObjectSerializer_1 = require("../models/ObjectSerializer"); var exception_1 = require("./exception"); var util_1 = require("../util"); var LeaguesApiRequestFactory = (function (_super) { __extends(LeaguesApiRequestFactory, _super); function LeaguesApiRequestFactory() { return _super !== null && _super.apply(this, arguments) || this; } LeaguesApiRequestFactory.prototype.leagueLeagueIdGet = function (leagueId, options) { return __awaiter(this, void 0, void 0, function () { var config, localVarPath, requestContext; return __generator(this, function (_a) { config = options || this.configuration; if (leagueId === null || leagueId === undefined) { throw new baseapi_1.RequiredError('Required parameter leagueId was null or undefined when calling leagueLeagueIdGet.'); } localVarPath = '/league/{league_id}' .replace('{' + 'league_id' + '}', encodeURIComponent(String(leagueId))); requestContext = config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); return [2, requestContext]; }); }); }; LeaguesApiRequestFactory.prototype.leagueLeagueIdLosesBracketGet = function (leagueId, options) { return __awaiter(this, void 0, void 0, function () { var config, localVarPath, requestContext; return __generator(this, function (_a) { config = options || this.configuration; if (leagueId === null || leagueId === undefined) { throw new baseapi_1.RequiredError('Required parameter leagueId was null or undefined when calling leagueLeagueIdLosesBracketGet.'); } localVarPath = '/league/{league_id}/loses_bracket' .replace('{' + 'league_id' + '}', encodeURIComponent(String(leagueId))); requestContext = config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); return [2, requestContext]; }); }); }; LeaguesApiRequestFactory.prototype.leagueLeagueIdMatchupsWeekGet = function (leagueId, week, options) { return __awaiter(this, void 0, void 0, function () { var config, localVarPath, requestContext; return __generator(this, function (_a) { config = options || this.configuration; if (leagueId === null || leagueId === undefined) { throw new baseapi_1.RequiredError('Required parameter leagueId was null or undefined when calling leagueLeagueIdMatchupsWeekGet.'); } if (week === null || week === undefined) { throw new baseapi_1.RequiredError('Required parameter week was null or undefined when calling leagueLeagueIdMatchupsWeekGet.'); } localVarPath = '/league/{league_id}/matchups/{week}' .replace('{' + 'league_id' + '}', encodeURIComponent(String(leagueId))) .replace('{' + 'week' + '}', encodeURIComponent(String(week))); requestContext = config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); return [2, requestContext]; }); }); }; LeaguesApiRequestFactory.prototype.leagueLeagueIdRostersGet = function (leagueId, options) { return __awaiter(this, void 0, void 0, function () { var config, localVarPath, requestContext; return __generator(this, function (_a) { config = options || this.configuration; if (leagueId === null || leagueId === undefined) { throw new baseapi_1.RequiredError('Required parameter leagueId was null or undefined when calling leagueLeagueIdRostersGet.'); } localVarPath = '/league/{league_id}/rosters' .replace('{' + 'league_id' + '}', encodeURIComponent(String(leagueId))); requestContext = config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); return [2, requestContext]; }); }); }; LeaguesApiRequestFactory.prototype.leagueLeagueIdTradedPicksGet = function (leagueId, options) { return __awaiter(this, void 0, void 0, function () { var config, localVarPath, requestContext; return __generator(this, function (_a) { config = options || this.configuration; if (leagueId === null || leagueId === undefined) { throw new baseapi_1.RequiredError('Required parameter leagueId was null or undefined when calling leagueLeagueIdTradedPicksGet.'); } localVarPath = '/league/{league_id}/traded_picks' .replace('{' + 'league_id' + '}', encodeURIComponent(String(leagueId))); requestContext = config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); return [2, requestContext]; }); }); }; LeaguesApiRequestFactory.prototype.leagueLeagueIdTransactionsRoundGet = function (leagueId, round, options) { return __awaiter(this, void 0, void 0, function () { var config, localVarPath, requestContext; return __generator(this, function (_a) { config = options || this.configuration; if (leagueId === null || leagueId === undefined) { throw new baseapi_1.RequiredError('Required parameter leagueId was null or undefined when calling leagueLeagueIdTransactionsRoundGet.'); } if (round === null || round === undefined) { throw new baseapi_1.RequiredError('Required parameter round was null or undefined when calling leagueLeagueIdTransactionsRoundGet.'); } localVarPath = '/league/{league_id}/transactions/{round}' .replace('{' + 'league_id' + '}', encodeURIComponent(String(leagueId))) .replace('{' + 'round' + '}', encodeURIComponent(String(round))); requestContext = config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); return [2, requestContext]; }); }); }; LeaguesApiRequestFactory.prototype.leagueLeagueIdUsersGet = function (leagueId, options) { return __awaiter(this, void 0, void 0, function () { var config, localVarPath, requestContext; return __generator(this, function (_a) { config = options || this.configuration; if (leagueId === null || leagueId === undefined) { throw new baseapi_1.RequiredError('Required parameter leagueId was null or undefined when calling leagueLeagueIdUsersGet.'); } localVarPath = '/league/{league_id}/users' .replace('{' + 'league_id' + '}', encodeURIComponent(String(leagueId))); requestContext = config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); return [2, requestContext]; }); }); }; LeaguesApiRequestFactory.prototype.leagueLeagueIdWinnersBracketGet = function (leagueId, options) { return __awaiter(this, void 0, void 0, function () { var config, localVarPath, requestContext; return __generator(this, function (_a) { config = options || this.configuration; if (leagueId === null || leagueId === undefined) { throw new baseapi_1.RequiredError('Required parameter leagueId was null or undefined when calling leagueLeagueIdWinnersBracketGet.'); } localVarPath = '/league/{league_id}/winners_bracket' .replace('{' + 'league_id' + '}', encodeURIComponent(String(leagueId))); requestContext = config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); return [2, requestContext]; }); }); }; LeaguesApiRequestFactory.prototype.stateSportGet = function (sport, options) { return __awaiter(this, void 0, void 0, function () { var config, localVarPath, requestContext; return __generator(this, function (_a) { config = options || this.configuration; if (sport === null || sport === undefined) { throw new baseapi_1.RequiredError('Required parameter sport was null or undefined when calling stateSportGet.'); } localVarPath = '/state/{sport}' .replace('{' + 'sport' + '}', encodeURIComponent(String(sport))); requestContext = config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); return [2, requestContext]; }); }); }; LeaguesApiRequestFactory.prototype.userUserIdLeaguesSportSeasonGet = function (userId, sport, season, options) { return __awaiter(this, void 0, void 0, function () { var config, localVarPath, requestContext; return __generator(this, function (_a) { config = options || this.configuration; if (userId === null || userId === undefined) { throw new baseapi_1.RequiredError('Required parameter userId was null or undefined when calling userUserIdLeaguesSportSeasonGet.'); } if (sport === null || sport === undefined) { throw new baseapi_1.RequiredError('Required parameter sport was null or undefined when calling userUserIdLeaguesSportSeasonGet.'); } if (season === null || season === undefined) { throw new baseapi_1.RequiredError('Required parameter season was null or undefined when calling userUserIdLeaguesSportSeasonGet.'); } localVarPath = '/user/{user_id}/leagues/{sport}/{season}' .replace('{' + 'user_id' + '}', encodeURIComponent(String(userId))) .replace('{' + 'sport' + '}', encodeURIComponent(String(sport))) .replace('{' + 'season' + '}', encodeURIComponent(String(season))); requestContext = config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); return [2, requestContext]; }); }); }; return LeaguesApiRequestFactory; }(baseapi_1.BaseAPIRequestFactory)); exports.LeaguesApiRequestFactory = LeaguesApiRequestFactory; var LeaguesApiResponseProcessor = (function () { function LeaguesApiResponseProcessor() { } LeaguesApiResponseProcessor.prototype.leagueLeagueIdGet = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body_1, _a, _b, _c, _d, body_2, _e, _f, _g, _h, body; return __generator(this, function (_j) { switch (_j.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!util_1.isCodeInRange("200", response.httpStatusCode)) return [3, 2]; _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize; _d = (_c = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 1: body_1 = _b.apply(_a, [_d.apply(_c, [_j.sent(), contentType]), "League", ""]); return [2, body_1]; case 2: if (util_1.isCodeInRange("400", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Bad Request -- Your request is invalid."); } if (util_1.isCodeInRange("404", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Not Found -- The specified kitten could not be found."); } if (util_1.isCodeInRange("429", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests -- You&#39;re requesting too many kittens! Slow down!"); } if (util_1.isCodeInRange("500", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error -- We had a problem with our server. Try again later."); } if (util_1.isCodeInRange("503", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later."); } if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body_2 = _f.apply(_e, [_h.apply(_g, [_j.sent(), contentType]), "League", ""]); return [2, body_2]; case 4: body = response.body || ""; throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }); }); }; LeaguesApiResponseProcessor.prototype.leagueLeagueIdLosesBracketGet = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body_3, _a, _b, _c, _d, body_4, _e, _f, _g, _h, body; return __generator(this, function (_j) { switch (_j.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!util_1.isCodeInRange("200", response.httpStatusCode)) return [3, 2]; _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize; _d = (_c = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 1: body_3 = _b.apply(_a, [_d.apply(_c, [_j.sent(), contentType]), "Array<any>", ""]); return [2, body_3]; case 2: if (util_1.isCodeInRange("400", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Bad Request -- Your request is invalid."); } if (util_1.isCodeInRange("404", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Not Found -- The specified kitten could not be found."); } if (util_1.isCodeInRange("429", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests -- You&#39;re requesting too many kittens! Slow down!"); } if (util_1.isCodeInRange("500", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error -- We had a problem with our server. Try again later."); } if (util_1.isCodeInRange("503", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later."); } if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body_4 = _f.apply(_e, [_h.apply(_g, [_j.sent(), contentType]), "Array<any>", ""]); return [2, body_4]; case 4: body = response.body || ""; throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }); }); }; LeaguesApiResponseProcessor.prototype.leagueLeagueIdMatchupsWeekGet = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body_5, _a, _b, _c, _d, body_6, _e, _f, _g, _h, body; return __generator(this, function (_j) { switch (_j.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!util_1.isCodeInRange("200", response.httpStatusCode)) return [3, 2]; _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize; _d = (_c = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 1: body_5 = _b.apply(_a, [_d.apply(_c, [_j.sent(), contentType]), "Array<Matchup>", ""]); return [2, body_5]; case 2: if (util_1.isCodeInRange("400", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Bad Request -- Your request is invalid."); } if (util_1.isCodeInRange("404", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Not Found -- The specified kitten could not be found."); } if (util_1.isCodeInRange("429", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests -- You&#39;re requesting too many kittens! Slow down!"); } if (util_1.isCodeInRange("500", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error -- We had a problem with our server. Try again later."); } if (util_1.isCodeInRange("503", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later."); } if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body_6 = _f.apply(_e, [_h.apply(_g, [_j.sent(), contentType]), "Array<Matchup>", ""]); return [2, body_6]; case 4: body = response.body || ""; throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }); }); }; LeaguesApiResponseProcessor.prototype.leagueLeagueIdRostersGet = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body_7, _a, _b, _c, _d, body_8, _e, _f, _g, _h, body; return __generator(this, function (_j) { switch (_j.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!util_1.isCodeInRange("200", response.httpStatusCode)) return [3, 2]; _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize; _d = (_c = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 1: body_7 = _b.apply(_a, [_d.apply(_c, [_j.sent(), contentType]), "Array<Roster>", ""]); return [2, body_7]; case 2: if (util_1.isCodeInRange("400", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Bad Request -- Your request is invalid."); } if (util_1.isCodeInRange("404", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Not Found -- The specified kitten could not be found."); } if (util_1.isCodeInRange("429", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests -- You&#39;re requesting too many kittens! Slow down!"); } if (util_1.isCodeInRange("500", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error -- We had a problem with our server. Try again later."); } if (util_1.isCodeInRange("503", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later."); } if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body_8 = _f.apply(_e, [_h.apply(_g, [_j.sent(), contentType]), "Array<Roster>", ""]); return [2, body_8]; case 4: body = response.body || ""; throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }); }); }; LeaguesApiResponseProcessor.prototype.leagueLeagueIdTradedPicksGet = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body_9, _a, _b, _c, _d, body_10, _e, _f, _g, _h, body; return __generator(this, function (_j) { switch (_j.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!util_1.isCodeInRange("200", response.httpStatusCode)) return [3, 2]; _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize; _d = (_c = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 1: body_9 = _b.apply(_a, [_d.apply(_c, [_j.sent(), contentType]), "Array<TradedPick>", ""]); return [2, body_9]; case 2: if (util_1.isCodeInRange("400", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Bad Request -- Your request is invalid."); } if (util_1.isCodeInRange("404", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Not Found -- The specified kitten could not be found."); } if (util_1.isCodeInRange("429", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests -- You&#39;re requesting too many kittens! Slow down!"); } if (util_1.isCodeInRange("500", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error -- We had a problem with our server. Try again later."); } if (util_1.isCodeInRange("503", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later."); } if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body_10 = _f.apply(_e, [_h.apply(_g, [_j.sent(), contentType]), "Array<TradedPick>", ""]); return [2, body_10]; case 4: body = response.body || ""; throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }); }); }; LeaguesApiResponseProcessor.prototype.leagueLeagueIdTransactionsRoundGet = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body_11, _a, _b, _c, _d, body_12, _e, _f, _g, _h, body; return __generator(this, function (_j) { switch (_j.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!util_1.isCodeInRange("200", response.httpStatusCode)) return [3, 2]; _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize; _d = (_c = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 1: body_11 = _b.apply(_a, [_d.apply(_c, [_j.sent(), contentType]), "Array<any>", ""]); return [2, body_11]; case 2: if (util_1.isCodeInRange("400", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Bad Request -- Your request is invalid."); } if (util_1.isCodeInRange("404", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Not Found -- The specified kitten could not be found."); } if (util_1.isCodeInRange("429", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests -- You&#39;re requesting too many kittens! Slow down!"); } if (util_1.isCodeInRange("500", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error -- We had a problem with our server. Try again later."); } if (util_1.isCodeInRange("503", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later."); } if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body_12 = _f.apply(_e, [_h.apply(_g, [_j.sent(), contentType]), "Array<any>", ""]); return [2, body_12]; case 4: body = response.body || ""; throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }); }); }; LeaguesApiResponseProcessor.prototype.leagueLeagueIdUsersGet = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body_13, _a, _b, _c, _d, body_14, _e, _f, _g, _h, body; return __generator(this, function (_j) { switch (_j.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!util_1.isCodeInRange("200", response.httpStatusCode)) return [3, 2]; _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize; _d = (_c = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 1: body_13 = _b.apply(_a, [_d.apply(_c, [_j.sent(), contentType]), "Array<UserInLeague>", ""]); return [2, body_13]; case 2: if (util_1.isCodeInRange("400", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Bad Request -- Your request is invalid."); } if (util_1.isCodeInRange("404", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Not Found -- The specified kitten could not be found."); } if (util_1.isCodeInRange("429", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests -- You&#39;re requesting too many kittens! Slow down!"); } if (util_1.isCodeInRange("500", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error -- We had a problem with our server. Try again later."); } if (util_1.isCodeInRange("503", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later."); } if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body_14 = _f.apply(_e, [_h.apply(_g, [_j.sent(), contentType]), "Array<UserInLeague>", ""]); return [2, body_14]; case 4: body = response.body || ""; throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }); }); }; LeaguesApiResponseProcessor.prototype.leagueLeagueIdWinnersBracketGet = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body_15, _a, _b, _c, _d, body_16, _e, _f, _g, _h, body; return __generator(this, function (_j) { switch (_j.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!util_1.isCodeInRange("200", response.httpStatusCode)) return [3, 2]; _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize; _d = (_c = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 1: body_15 = _b.apply(_a, [_d.apply(_c, [_j.sent(), contentType]), "Array<any>", ""]); return [2, body_15]; case 2: if (util_1.isCodeInRange("400", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Bad Request -- Your request is invalid."); } if (util_1.isCodeInRange("404", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Not Found -- The specified kitten could not be found."); } if (util_1.isCodeInRange("429", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests -- You&#39;re requesting too many kittens! Slow down!"); } if (util_1.isCodeInRange("500", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error -- We had a problem with our server. Try again later."); } if (util_1.isCodeInRange("503", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later."); } if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body_16 = _f.apply(_e, [_h.apply(_g, [_j.sent(), contentType]), "Array<any>", ""]); return [2, body_16]; case 4: body = response.body || ""; throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }); }); }; LeaguesApiResponseProcessor.prototype.stateSportGet = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body_17, _a, _b, _c, _d, body_18, _e, _f, _g, _h, body; return __generator(this, function (_j) { switch (_j.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!util_1.isCodeInRange("200", response.httpStatusCode)) return [3, 2]; _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize; _d = (_c = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 1: body_17 = _b.apply(_a, [_d.apply(_c, [_j.sent(), contentType]), "SportState", ""]); return [2, body_17]; case 2: if (util_1.isCodeInRange("400", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Bad Request -- Your request is invalid."); } if (util_1.isCodeInRange("404", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Not Found -- The specified kitten could not be found."); } if (util_1.isCodeInRange("429", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests -- You&#39;re requesting too many kittens! Slow down!"); } if (util_1.isCodeInRange("500", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error -- We had a problem with our server. Try again later."); } if (util_1.isCodeInRange("503", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later."); } if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body_18 = _f.apply(_e, [_h.apply(_g, [_j.sent(), contentType]), "SportState", ""]); return [2, body_18]; case 4: body = response.body || ""; throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }); }); }; LeaguesApiResponseProcessor.prototype.userUserIdLeaguesSportSeasonGet = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body_19, _a, _b, _c, _d, body_20, _e, _f, _g, _h, body; return __generator(this, function (_j) { switch (_j.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!util_1.isCodeInRange("200", response.httpStatusCode)) return [3, 2]; _b = (_a = ObjectSerializer_1.ObjectSerializer).deserialize; _d = (_c = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 1: body_19 = _b.apply(_a, [_d.apply(_c, [_j.sent(), contentType]), "Array<League>", ""]); return [2, body_19]; case 2: if (util_1.isCodeInRange("400", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Bad Request -- Your request is invalid."); } if (util_1.isCodeInRange("404", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Not Found -- The specified kitten could not be found."); } if (util_1.isCodeInRange("429", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests -- You&#39;re requesting too many kittens! Slow down!"); } if (util_1.isCodeInRange("500", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error -- We had a problem with our server. Try again later."); } if (util_1.isCodeInRange("503", response.httpStatusCode)) { throw new exception_1.ApiException(response.httpStatusCode, "Service Unavailable -- We&#39;re temporarily offline for maintenance. Please try again later."); } if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body_20 = _f.apply(_e, [_h.apply(_g, [_j.sent(), contentType]), "Array<League>", ""]); return [2, body_20]; case 4: body = response.body || ""; throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\""); } }); }); }; return LeaguesApiResponseProcessor; }()); exports.LeaguesApiResponseProcessor = LeaguesApiResponseProcessor; //# sourceMappingURL=LeaguesApi.js.map