/* tslint:disable */ /* eslint-disable */ /** * Credify external API doc v2 * API documentations for integration version 2. * * 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 { APIErrorV2 } from '../model'; // @ts-ignore import { AccessToken } from '../model'; // @ts-ignore import { ClientAuthRequest } from '../model'; /** * AuthenticationApi - axios parameter creator * @export */ export const AuthenticationApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This generates a new access token out of a provided API key with the same scopes. The main usage is for client authentication. Other public API endpoints (User authentication API, Onboarding API) requires an access token with a specified scope that is supposed to be generated with this endpoint. * @summary Client authentication * @param {ClientAuthRequest} clientAuthRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestClientAuth: async (clientAuthRequest: ClientAuthRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'clientAuthRequest' is not null or undefined assertParamExists('requestClientAuth', 'clientAuthRequest', clientAuthRequest) const localVarPath = `/v2/public/client-auth`; // 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; localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = clientAuthRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * AuthenticationApi - functional programming interface * @export */ export const AuthenticationApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = AuthenticationApiAxiosParamCreator(configuration) return { /** * This generates a new access token out of a provided API key with the same scopes. The main usage is for client authentication. Other public API endpoints (User authentication API, Onboarding API) requires an access token with a specified scope that is supposed to be generated with this endpoint. * @summary Client authentication * @param {ClientAuthRequest} clientAuthRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async requestClientAuth(clientAuthRequest: ClientAuthRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.requestClientAuth(clientAuthRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * AuthenticationApi - factory interface * @export */ export const AuthenticationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = AuthenticationApiFp(configuration) return { /** * This generates a new access token out of a provided API key with the same scopes. The main usage is for client authentication. Other public API endpoints (User authentication API, Onboarding API) requires an access token with a specified scope that is supposed to be generated with this endpoint. * @summary Client authentication * @param {ClientAuthRequest} clientAuthRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ requestClientAuth(clientAuthRequest: ClientAuthRequest, options?: any): AxiosPromise { return localVarFp.requestClientAuth(clientAuthRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * AuthenticationApi - interface * @export * @interface AuthenticationApi */ export interface AuthenticationApiInterface { /** * This generates a new access token out of a provided API key with the same scopes. The main usage is for client authentication. Other public API endpoints (User authentication API, Onboarding API) requires an access token with a specified scope that is supposed to be generated with this endpoint. * @summary Client authentication * @param {ClientAuthRequest} clientAuthRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthenticationApiInterface */ requestClientAuth(clientAuthRequest: ClientAuthRequest, options?: AxiosRequestConfig): AxiosPromise; } /** * AuthenticationApi - object-oriented interface * @export * @class AuthenticationApi * @extends {BaseAPI} */ export class AuthenticationApi extends BaseAPI implements AuthenticationApiInterface { /** * This generates a new access token out of a provided API key with the same scopes. The main usage is for client authentication. Other public API endpoints (User authentication API, Onboarding API) requires an access token with a specified scope that is supposed to be generated with this endpoint. * @summary Client authentication * @param {ClientAuthRequest} clientAuthRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthenticationApi */ public requestClientAuth(clientAuthRequest: ClientAuthRequest, options?: AxiosRequestConfig) { return AuthenticationApiFp(this.configuration).requestClientAuth(clientAuthRequest, options).then((request) => request(this.axios, this.basePath)); } }