UNPKG

shipstation-client

Version:
192 lines (191 loc) 9.48 kB
/* tslint:disable */ /* eslint-disable */ /** * ShipStation API v2 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 2.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ 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()); }); }; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setSearchParams, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, BaseAPI, operationServerMap } from '../base'; /** * WarehousesApi - axios parameter creator * @export */ export const WarehousesApiAxiosParamCreator = function (configuration) { return { /** * Retrieve warehouse data based on the warehouse ID * @summary Get warehouse by id * @param {string} warehouseId Warehouse ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWarehouseById: (warehouseId_1, ...args_1) => __awaiter(this, [warehouseId_1, ...args_1], void 0, function* (warehouseId, options = {}) { // verify required parameter 'warehouseId' is not null or undefined assertParamExists('getWarehouseById', 'warehouseId', warehouseId); const localVarPath = `/v2/warehouses/{warehouse_id}` .replace(`{${"warehouse_id"}}`, encodeURIComponent(String(warehouseId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_keys required yield setApiKeyToObject(localVarHeaderParameter, "api-key", configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Retrieve a list of warehouses associated with this account. * @summary List warehouses * @param {*} [options] Override http request option. * @throws {RequiredError} */ listWarehouses: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { const localVarPath = `/v2/warehouses`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication api_keys required yield setApiKeyToObject(localVarHeaderParameter, "api-key", configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * WarehousesApi - functional programming interface * @export */ export const WarehousesApiFp = function (configuration) { const localVarAxiosParamCreator = WarehousesApiAxiosParamCreator(configuration); return { /** * Retrieve warehouse data based on the warehouse ID * @summary Get warehouse by id * @param {string} warehouseId Warehouse ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWarehouseById(warehouseId, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.getWarehouseById(warehouseId, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['WarehousesApi.getWarehouseById']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, /** * Retrieve a list of warehouses associated with this account. * @summary List warehouses * @param {*} [options] Override http request option. * @throws {RequiredError} */ listWarehouses(options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.listWarehouses(options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['WarehousesApi.listWarehouses']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, }; }; /** * WarehousesApi - factory interface * @export */ export const WarehousesApiFactory = function (configuration, basePath, axios) { const localVarFp = WarehousesApiFp(configuration); return { /** * Retrieve warehouse data based on the warehouse ID * @summary Get warehouse by id * @param {string} warehouseId Warehouse ID * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWarehouseById(warehouseId, options) { return localVarFp.getWarehouseById(warehouseId, options).then((request) => request(axios, basePath)); }, /** * Retrieve a list of warehouses associated with this account. * @summary List warehouses * @param {*} [options] Override http request option. * @throws {RequiredError} */ listWarehouses(options) { return localVarFp.listWarehouses(options).then((request) => request(axios, basePath)); }, }; }; /** * WarehousesApi - object-oriented interface * @export * @class WarehousesApi * @extends {BaseAPI} */ export class WarehousesApi extends BaseAPI { /** * Retrieve warehouse data based on the warehouse ID * @summary Get warehouse by id * @param {string} warehouseId Warehouse ID * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WarehousesApi */ getWarehouseById(warehouseId, options) { return WarehousesApiFp(this.configuration).getWarehouseById(warehouseId, options).then((request) => request(this.axios, this.basePath)); } /** * Retrieve a list of warehouses associated with this account. * @summary List warehouses * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WarehousesApi */ listWarehouses(options) { return WarehousesApiFp(this.configuration).listWarehouses(options).then((request) => request(this.axios, this.basePath)); } }