/* tslint:disable */ /* eslint-disable */ /** * Credify API doc version 1 * API documentations version 1. * * 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 { DecryptionRequest } from '../model'; // @ts-ignore import { DecryptionResponse } from '../model'; // @ts-ignore import { GetKeyResponse } from '../model'; /** * IdPassBackendApi - axios parameter creator * @export */ export const IdPassBackendApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This decrypts provided information with the latest private key. * @summary Decrypt info * @param {DecryptionRequest} decryptionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ decryptInfo: async (decryptionRequest: DecryptionRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'decryptionRequest' is not null or undefined assertParamExists('decryptInfo', 'decryptionRequest', decryptionRequest) const localVarPath = `/v1/decrypt`; // 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 bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = decryptionRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This retrieves the latest public key for encryption. This key pair rotates if it gets a request and the key is generated more than 1 hour ago. * @summary Get public key for encryption * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPublicKeyForEncryption: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/key`; // 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: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearerAuth required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * IdPassBackendApi - functional programming interface * @export */ export const IdPassBackendApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = IdPassBackendApiAxiosParamCreator(configuration) return { /** * This decrypts provided information with the latest private key. * @summary Decrypt info * @param {DecryptionRequest} decryptionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async decryptInfo(decryptionRequest: DecryptionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.decryptInfo(decryptionRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This retrieves the latest public key for encryption. This key pair rotates if it gets a request and the key is generated more than 1 hour ago. * @summary Get public key for encryption * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPublicKeyForEncryption(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPublicKeyForEncryption(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * IdPassBackendApi - factory interface * @export */ export const IdPassBackendApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = IdPassBackendApiFp(configuration) return { /** * This decrypts provided information with the latest private key. * @summary Decrypt info * @param {DecryptionRequest} decryptionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ decryptInfo(decryptionRequest: DecryptionRequest, options?: any): AxiosPromise { return localVarFp.decryptInfo(decryptionRequest, options).then((request) => request(axios, basePath)); }, /** * This retrieves the latest public key for encryption. This key pair rotates if it gets a request and the key is generated more than 1 hour ago. * @summary Get public key for encryption * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPublicKeyForEncryption(options?: any): AxiosPromise { return localVarFp.getPublicKeyForEncryption(options).then((request) => request(axios, basePath)); }, }; }; /** * IdPassBackendApi - interface * @export * @interface IdPassBackendApi */ export interface IdPassBackendApiInterface { /** * This decrypts provided information with the latest private key. * @summary Decrypt info * @param {DecryptionRequest} decryptionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof IdPassBackendApiInterface */ decryptInfo(decryptionRequest: DecryptionRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This retrieves the latest public key for encryption. This key pair rotates if it gets a request and the key is generated more than 1 hour ago. * @summary Get public key for encryption * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof IdPassBackendApiInterface */ getPublicKeyForEncryption(options?: AxiosRequestConfig): AxiosPromise; } /** * IdPassBackendApi - object-oriented interface * @export * @class IdPassBackendApi * @extends {BaseAPI} */ export class IdPassBackendApi extends BaseAPI implements IdPassBackendApiInterface { /** * This decrypts provided information with the latest private key. * @summary Decrypt info * @param {DecryptionRequest} decryptionRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof IdPassBackendApi */ public decryptInfo(decryptionRequest: DecryptionRequest, options?: AxiosRequestConfig) { return IdPassBackendApiFp(this.configuration).decryptInfo(decryptionRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This retrieves the latest public key for encryption. This key pair rotates if it gets a request and the key is generated more than 1 hour ago. * @summary Get public key for encryption * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof IdPassBackendApi */ public getPublicKeyForEncryption(options?: AxiosRequestConfig) { return IdPassBackendApiFp(this.configuration).getPublicKeyForEncryption(options).then((request) => request(this.axios, this.basePath)); } }