/* tslint:disable */ /* eslint-disable */ /** * Credify external API doc * API documentations. * * The version of the OpenAPI document: 1.0.0-oas3 * Contact: dev@credify.one * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore import { AccessTokenResponse } from '../model'; /** * AuthApi - axios parameter creator * @export */ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This generates a new access token out of a provided API key with the same scopes. * @summary Generates access token * @param {string} xAPIKEY * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ generateAccessToken: async (xAPIKEY: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'xAPIKEY' is not null or undefined assertParamExists('generateAccessToken', 'xAPIKEY', xAPIKEY) const localVarPath = `/v1/token`; // 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 = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication apiKeyAuth required await setApiKeyToObject(localVarHeaderParameter, "X-API-KEY", configuration) if (xAPIKEY !== undefined && xAPIKEY !== null) { localVarHeaderParameter['X-API-KEY'] = String(xAPIKEY); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * AuthApi - functional programming interface * @export */ export const AuthApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AuthApiAxiosParamCreator(configuration) return { /** * This generates a new access token out of a provided API key with the same scopes. * @summary Generates access token * @param {string} xAPIKEY * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ async generateAccessToken(xAPIKEY: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.generateAccessToken(xAPIKEY, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * AuthApi - factory interface * @export */ export const AuthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AuthApiFp(configuration) return { /** * This generates a new access token out of a provided API key with the same scopes. * @summary Generates access token * @param {string} xAPIKEY * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ generateAccessToken(xAPIKEY: string, options?: any): AxiosPromise { return localVarFp.generateAccessToken(xAPIKEY, options).then((request) => request(axios, basePath)); }, }; }; /** * AuthApi - interface * @export * @interface AuthApi */ export interface AuthApiInterface { /** * This generates a new access token out of a provided API key with the same scopes. * @summary Generates access token * @param {string} xAPIKEY * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof AuthApiInterface */ generateAccessToken(xAPIKEY: string, options?: AxiosRequestConfig): AxiosPromise; } /** * AuthApi - object-oriented interface * @export * @class AuthApi * @extends {BaseAPI} */ export class AuthApi extends BaseAPI implements AuthApiInterface { /** * This generates a new access token out of a provided API key with the same scopes. * @summary Generates access token * @param {string} xAPIKEY * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof AuthApi */ public generateAccessToken(xAPIKEY: string, options?: AxiosRequestConfig) { return AuthApiFp(this.configuration).generateAccessToken(xAPIKEY, options).then((request) => request(this.axios, this.basePath)); } }