UNPKG

dhl-express-api-client

Version:
437 lines 33.3 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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 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.RatingApiResponseProcessor = exports.RatingApiRequestFactory = 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 RatingApiRequestFactory = (function (_super) { __extends(RatingApiRequestFactory, _super); function RatingApiRequestFactory() { return _super !== null && _super.apply(this, arguments) || this; } RatingApiRequestFactory.prototype.expApiLandedCost = function (supermodelIoLogisticsExpressLandedCostRequest, messageReference, messageReferenceDate, pluginName, pluginVersion, shippingSystemPlatformName, shippingSystemPlatformVersion, webstorePlatformName, webstorePlatformVersion, _options) { var _a, _b, _c; return __awaiter(this, void 0, void 0, function () { var _config, localVarPath, requestContext, contentType, serializedBody, authMethod, defaultAuth; return __generator(this, function (_d) { switch (_d.label) { case 0: _config = _options || this.configuration; if (supermodelIoLogisticsExpressLandedCostRequest === null || supermodelIoLogisticsExpressLandedCostRequest === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiLandedCost", "supermodelIoLogisticsExpressLandedCostRequest"); } localVarPath = '/landed-cost'; requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); requestContext.setHeaderParam("Message-Reference", ObjectSerializer_1.ObjectSerializer.serialize(messageReference, "string", "")); requestContext.setHeaderParam("Message-Reference-Date", ObjectSerializer_1.ObjectSerializer.serialize(messageReferenceDate, "string", "")); requestContext.setHeaderParam("Plugin-Name", ObjectSerializer_1.ObjectSerializer.serialize(pluginName, "string", "")); requestContext.setHeaderParam("Plugin-Version", ObjectSerializer_1.ObjectSerializer.serialize(pluginVersion, "string", "")); requestContext.setHeaderParam("Shipping-System-Platform-Name", ObjectSerializer_1.ObjectSerializer.serialize(shippingSystemPlatformName, "string", "")); requestContext.setHeaderParam("Shipping-System-Platform-Version", ObjectSerializer_1.ObjectSerializer.serialize(shippingSystemPlatformVersion, "string", "")); requestContext.setHeaderParam("Webstore-Platform-Name", ObjectSerializer_1.ObjectSerializer.serialize(webstorePlatformName, "string", "")); requestContext.setHeaderParam("Webstore-Platform-Version", ObjectSerializer_1.ObjectSerializer.serialize(webstorePlatformVersion, "string", "")); contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(supermodelIoLogisticsExpressLandedCostRequest, "SupermodelIoLogisticsExpressLandedCostRequest", ""), contentType); requestContext.setBody(serializedBody); authMethod = _config.authMethods["basicAuth"]; if (!(authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication)) return [3, 2]; return [4, (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext))]; case 1: _d.sent(); _d.label = 2; case 2: defaultAuth = ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) || ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default); if (!(defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication)) return [3, 4]; return [4, (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext))]; case 3: _d.sent(); _d.label = 4; case 4: return [2, requestContext]; } }); }); }; RatingApiRequestFactory.prototype.expApiRates = function (accountNumber, originCountryCode, originCityName, destinationCountryCode, destinationCityName, weight, length, width, height, plannedShippingDate, isCustomsDeclarable, unitOfMeasurement, originPostalCode, destinationPostalCode, nextBusinessDay, messageReference, messageReferenceDate, pluginName, pluginVersion, shippingSystemPlatformName, shippingSystemPlatformVersion, webstorePlatformName, webstorePlatformVersion, _options) { var _a, _b, _c; return __awaiter(this, void 0, void 0, function () { var _config, localVarPath, requestContext, authMethod, defaultAuth; return __generator(this, function (_d) { switch (_d.label) { case 0: _config = _options || this.configuration; if (accountNumber === null || accountNumber === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "accountNumber"); } if (originCountryCode === null || originCountryCode === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "originCountryCode"); } if (originCityName === null || originCityName === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "originCityName"); } if (destinationCountryCode === null || destinationCountryCode === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "destinationCountryCode"); } if (destinationCityName === null || destinationCityName === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "destinationCityName"); } if (weight === null || weight === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "weight"); } if (length === null || length === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "length"); } if (width === null || width === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "width"); } if (height === null || height === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "height"); } if (plannedShippingDate === null || plannedShippingDate === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "plannedShippingDate"); } if (isCustomsDeclarable === null || isCustomsDeclarable === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "isCustomsDeclarable"); } if (unitOfMeasurement === null || unitOfMeasurement === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRates", "unitOfMeasurement"); } localVarPath = '/rates'; requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); if (accountNumber !== undefined) { requestContext.setQueryParam("accountNumber", ObjectSerializer_1.ObjectSerializer.serialize(accountNumber, "string", "")); } if (originCountryCode !== undefined) { requestContext.setQueryParam("originCountryCode", ObjectSerializer_1.ObjectSerializer.serialize(originCountryCode, "string", "")); } if (originPostalCode !== undefined) { requestContext.setQueryParam("originPostalCode", ObjectSerializer_1.ObjectSerializer.serialize(originPostalCode, "string", "")); } if (originCityName !== undefined) { requestContext.setQueryParam("originCityName", ObjectSerializer_1.ObjectSerializer.serialize(originCityName, "string", "")); } if (destinationCountryCode !== undefined) { requestContext.setQueryParam("destinationCountryCode", ObjectSerializer_1.ObjectSerializer.serialize(destinationCountryCode, "string", "")); } if (destinationPostalCode !== undefined) { requestContext.setQueryParam("destinationPostalCode", ObjectSerializer_1.ObjectSerializer.serialize(destinationPostalCode, "string", "")); } if (destinationCityName !== undefined) { requestContext.setQueryParam("destinationCityName", ObjectSerializer_1.ObjectSerializer.serialize(destinationCityName, "string", "")); } if (weight !== undefined) { requestContext.setQueryParam("weight", ObjectSerializer_1.ObjectSerializer.serialize(weight, "number", "")); } if (length !== undefined) { requestContext.setQueryParam("length", ObjectSerializer_1.ObjectSerializer.serialize(length, "number", "")); } if (width !== undefined) { requestContext.setQueryParam("width", ObjectSerializer_1.ObjectSerializer.serialize(width, "number", "")); } if (height !== undefined) { requestContext.setQueryParam("height", ObjectSerializer_1.ObjectSerializer.serialize(height, "number", "")); } if (plannedShippingDate !== undefined) { requestContext.setQueryParam("plannedShippingDate", ObjectSerializer_1.ObjectSerializer.serialize(plannedShippingDate, "string", "")); } if (isCustomsDeclarable !== undefined) { requestContext.setQueryParam("isCustomsDeclarable", ObjectSerializer_1.ObjectSerializer.serialize(isCustomsDeclarable, "boolean", "")); } if (unitOfMeasurement !== undefined) { requestContext.setQueryParam("unitOfMeasurement", ObjectSerializer_1.ObjectSerializer.serialize(unitOfMeasurement, "'metric' | 'imperial'", "")); } if (nextBusinessDay !== undefined) { requestContext.setQueryParam("nextBusinessDay", ObjectSerializer_1.ObjectSerializer.serialize(nextBusinessDay, "boolean", "")); } requestContext.setHeaderParam("Message-Reference", ObjectSerializer_1.ObjectSerializer.serialize(messageReference, "string", "")); requestContext.setHeaderParam("Message-Reference-Date", ObjectSerializer_1.ObjectSerializer.serialize(messageReferenceDate, "string", "")); requestContext.setHeaderParam("Plugin-Name", ObjectSerializer_1.ObjectSerializer.serialize(pluginName, "string", "")); requestContext.setHeaderParam("Plugin-Version", ObjectSerializer_1.ObjectSerializer.serialize(pluginVersion, "string", "")); requestContext.setHeaderParam("Shipping-System-Platform-Name", ObjectSerializer_1.ObjectSerializer.serialize(shippingSystemPlatformName, "string", "")); requestContext.setHeaderParam("Shipping-System-Platform-Version", ObjectSerializer_1.ObjectSerializer.serialize(shippingSystemPlatformVersion, "string", "")); requestContext.setHeaderParam("Webstore-Platform-Name", ObjectSerializer_1.ObjectSerializer.serialize(webstorePlatformName, "string", "")); requestContext.setHeaderParam("Webstore-Platform-Version", ObjectSerializer_1.ObjectSerializer.serialize(webstorePlatformVersion, "string", "")); authMethod = _config.authMethods["basicAuth"]; if (!(authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication)) return [3, 2]; return [4, (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext))]; case 1: _d.sent(); _d.label = 2; case 2: defaultAuth = ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) || ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default); if (!(defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication)) return [3, 4]; return [4, (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext))]; case 3: _d.sent(); _d.label = 4; case 4: return [2, requestContext]; } }); }); }; RatingApiRequestFactory.prototype.expApiRatesMany = function (supermodelIoLogisticsExpressRateRequest, messageReference, messageReferenceDate, pluginName, pluginVersion, shippingSystemPlatformName, shippingSystemPlatformVersion, webstorePlatformName, webstorePlatformVersion, _options) { var _a, _b, _c; return __awaiter(this, void 0, void 0, function () { var _config, localVarPath, requestContext, contentType, serializedBody, authMethod, defaultAuth; return __generator(this, function (_d) { switch (_d.label) { case 0: _config = _options || this.configuration; if (supermodelIoLogisticsExpressRateRequest === null || supermodelIoLogisticsExpressRateRequest === undefined) { throw new baseapi_1.RequiredError("RatingApi", "expApiRatesMany", "supermodelIoLogisticsExpressRateRequest"); } localVarPath = '/rates'; requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST); requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8"); requestContext.setHeaderParam("Message-Reference", ObjectSerializer_1.ObjectSerializer.serialize(messageReference, "string", "")); requestContext.setHeaderParam("Message-Reference-Date", ObjectSerializer_1.ObjectSerializer.serialize(messageReferenceDate, "string", "")); requestContext.setHeaderParam("Plugin-Name", ObjectSerializer_1.ObjectSerializer.serialize(pluginName, "string", "")); requestContext.setHeaderParam("Plugin-Version", ObjectSerializer_1.ObjectSerializer.serialize(pluginVersion, "string", "")); requestContext.setHeaderParam("Shipping-System-Platform-Name", ObjectSerializer_1.ObjectSerializer.serialize(shippingSystemPlatformName, "string", "")); requestContext.setHeaderParam("Shipping-System-Platform-Version", ObjectSerializer_1.ObjectSerializer.serialize(shippingSystemPlatformVersion, "string", "")); requestContext.setHeaderParam("Webstore-Platform-Name", ObjectSerializer_1.ObjectSerializer.serialize(webstorePlatformName, "string", "")); requestContext.setHeaderParam("Webstore-Platform-Version", ObjectSerializer_1.ObjectSerializer.serialize(webstorePlatformVersion, "string", "")); contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([ "application/json" ]); requestContext.setHeaderParam("Content-Type", contentType); serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(supermodelIoLogisticsExpressRateRequest, "SupermodelIoLogisticsExpressRateRequest", ""), contentType); requestContext.setBody(serializedBody); authMethod = _config.authMethods["basicAuth"]; if (!(authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication)) return [3, 2]; return [4, (authMethod === null || authMethod === void 0 ? void 0 : authMethod.applySecurityAuthentication(requestContext))]; case 1: _d.sent(); _d.label = 2; case 2: defaultAuth = ((_a = _options === null || _options === void 0 ? void 0 : _options.authMethods) === null || _a === void 0 ? void 0 : _a.default) || ((_c = (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.authMethods) === null || _c === void 0 ? void 0 : _c.default); if (!(defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication)) return [3, 4]; return [4, (defaultAuth === null || defaultAuth === void 0 ? void 0 : defaultAuth.applySecurityAuthentication(requestContext))]; case 3: _d.sent(); _d.label = 4; case 4: return [2, requestContext]; } }); }); }; return RatingApiRequestFactory; }(baseapi_1.BaseAPIRequestFactory)); exports.RatingApiRequestFactory = RatingApiRequestFactory; var RatingApiResponseProcessor = (function () { function RatingApiResponseProcessor() { } RatingApiResponseProcessor.prototype.expApiLandedCost = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body, _a, _b, _c, _d, body, _e, _f, _g, _h, body, _j, _k, _l, _m, body, _o, _p, _q, _r, _s, _t; return __generator(this, function (_u) { switch (_u.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!(0, 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 = _b.apply(_a, [_d.apply(_c, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressRates", ""]); return [2, body]; case 2: if (!(0, util_1.isCodeInRange)("400", response.httpStatusCode)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body = _f.apply(_e, [_h.apply(_g, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressErrorResponse", ""]); throw new exception_1.ApiException(response.httpStatusCode, "Wrong input parameters", body, response.headers); case 4: if (!(0, util_1.isCodeInRange)("500", response.httpStatusCode)) return [3, 6]; _k = (_j = ObjectSerializer_1.ObjectSerializer).deserialize; _m = (_l = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 5: body = _k.apply(_j, [_m.apply(_l, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressErrorResponse", ""]); throw new exception_1.ApiException(response.httpStatusCode, "Process errors", body, response.headers); case 6: if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 8]; _p = (_o = ObjectSerializer_1.ObjectSerializer).deserialize; _r = (_q = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 7: body = _p.apply(_o, [_r.apply(_q, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressRates", ""]); return [2, body]; case 8: _s = exception_1.ApiException.bind; _t = [void 0, response.httpStatusCode, "Unknown API Status Code!"]; return [4, response.getBodyAsAny()]; case 9: throw new (_s.apply(exception_1.ApiException, _t.concat([_u.sent(), response.headers])))(); } }); }); }; RatingApiResponseProcessor.prototype.expApiRates = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body, _a, _b, _c, _d, body, _e, _f, _g, _h, body, _j, _k, _l, _m, body, _o, _p, _q, _r, _s, _t; return __generator(this, function (_u) { switch (_u.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!(0, 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 = _b.apply(_a, [_d.apply(_c, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressRates", ""]); return [2, body]; case 2: if (!(0, util_1.isCodeInRange)("400", response.httpStatusCode)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body = _f.apply(_e, [_h.apply(_g, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressErrorResponse", ""]); throw new exception_1.ApiException(response.httpStatusCode, "Wrong input parameters", body, response.headers); case 4: if (!(0, util_1.isCodeInRange)("500", response.httpStatusCode)) return [3, 6]; _k = (_j = ObjectSerializer_1.ObjectSerializer).deserialize; _m = (_l = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 5: body = _k.apply(_j, [_m.apply(_l, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressErrorResponse", ""]); throw new exception_1.ApiException(response.httpStatusCode, "Process errors", body, response.headers); case 6: if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 8]; _p = (_o = ObjectSerializer_1.ObjectSerializer).deserialize; _r = (_q = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 7: body = _p.apply(_o, [_r.apply(_q, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressRates", ""]); return [2, body]; case 8: _s = exception_1.ApiException.bind; _t = [void 0, response.httpStatusCode, "Unknown API Status Code!"]; return [4, response.getBodyAsAny()]; case 9: throw new (_s.apply(exception_1.ApiException, _t.concat([_u.sent(), response.headers])))(); } }); }); }; RatingApiResponseProcessor.prototype.expApiRatesMany = function (response) { return __awaiter(this, void 0, void 0, function () { var contentType, body, _a, _b, _c, _d, body, _e, _f, _g, _h, body, _j, _k, _l, _m, body, _o, _p, _q, _r, _s, _t; return __generator(this, function (_u) { switch (_u.label) { case 0: contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]); if (!(0, 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 = _b.apply(_a, [_d.apply(_c, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressRates", ""]); return [2, body]; case 2: if (!(0, util_1.isCodeInRange)("400", response.httpStatusCode)) return [3, 4]; _f = (_e = ObjectSerializer_1.ObjectSerializer).deserialize; _h = (_g = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 3: body = _f.apply(_e, [_h.apply(_g, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressErrorResponse", ""]); throw new exception_1.ApiException(response.httpStatusCode, "Wrong input parameters", body, response.headers); case 4: if (!(0, util_1.isCodeInRange)("500", response.httpStatusCode)) return [3, 6]; _k = (_j = ObjectSerializer_1.ObjectSerializer).deserialize; _m = (_l = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 5: body = _k.apply(_j, [_m.apply(_l, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressErrorResponse", ""]); throw new exception_1.ApiException(response.httpStatusCode, "Process errors", body, response.headers); case 6: if (!(response.httpStatusCode >= 200 && response.httpStatusCode <= 299)) return [3, 8]; _p = (_o = ObjectSerializer_1.ObjectSerializer).deserialize; _r = (_q = ObjectSerializer_1.ObjectSerializer).parse; return [4, response.body.text()]; case 7: body = _p.apply(_o, [_r.apply(_q, [_u.sent(), contentType]), "SupermodelIoLogisticsExpressRates", ""]); return [2, body]; case 8: _s = exception_1.ApiException.bind; _t = [void 0, response.httpStatusCode, "Unknown API Status Code!"]; return [4, response.getBodyAsAny()]; case 9: throw new (_s.apply(exception_1.ApiException, _t.concat([_u.sent(), response.headers])))(); } }); }); }; return RatingApiResponseProcessor; }()); exports.RatingApiResponseProcessor = RatingApiResponseProcessor; //# sourceMappingURL=RatingApi.js.map