UNPKG

@forestvpn/forestvpn_api

Version:

A package to interact api.forestvpn.com (manage vpn profiles, check usage statistics, manage locations, ...)

131 lines (123 loc) 5.14 kB
/* tslint:disable */ /* eslint-disable */ /** * ForestVPN API * ForestVPN - Fast, secure, and modern VPN. It offers Distributed Computing, Crypto Mining, P2P, Ad Blocking, TOR over VPN, 30+ locations, and a free version with unlimited data. * * OpenAPI spec version: 2.0 * Contact: support@forestvpn.com * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { ICOLanding } from '../models'; /** * IcoApi - axios parameter creator * @export */ export const IcoApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary Initial Coin Offering. Landing page * @param {*} [options] Override http request option. * @throws {RequiredError} */ iCOLanding: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/ico/landing/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required if (configuration && configuration.accessToken) { const accessToken = typeof configuration.accessToken === 'function' ? await configuration.accessToken() : await configuration.accessToken; localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; } const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * IcoApi - functional programming interface * @export */ export const IcoApiFp = function(configuration?: Configuration) { return { /** * * @summary Initial Coin Offering. Landing page * @param {*} [options] Override http request option. * @throws {RequiredError} */ async iCOLanding(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ICOLanding>>> { const localVarAxiosArgs = await IcoApiAxiosParamCreator(configuration).iCOLanding(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * IcoApi - factory interface * @export */ export const IcoApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @summary Initial Coin Offering. Landing page * @param {*} [options] Override http request option. * @throws {RequiredError} */ async iCOLanding(options?: AxiosRequestConfig): Promise<AxiosResponse<ICOLanding>> { return IcoApiFp(configuration).iCOLanding(options).then((request) => request(axios, basePath)); }, }; }; /** * IcoApi - object-oriented interface * @export * @class IcoApi * @extends {BaseAPI} */ export class IcoApi extends BaseAPI { /** * * @summary Initial Coin Offering. Landing page * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof IcoApi */ public async iCOLanding(options?: AxiosRequestConfig) : Promise<AxiosResponse<ICOLanding>> { return IcoApiFp(this.configuration).iCOLanding(options).then((request) => request(this.axios, this.basePath)); } }