/* 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 { CommonResponse } from '../model'; // @ts-ignore import { EntityRequest } from '../model'; // @ts-ignore import { EntityResponse } from '../model'; // @ts-ignore import { Phone } from '../model'; /** * IdPassProviderApi - axios parameter creator * @export */ export const IdPassProviderApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This creates a new individual entity with a phone verification code. This requires a hashed password (sha256 - base64 URL encoded string), encrypted private keys of both signing and encryption, public keys of both signing and encryption. This response will be a Credify ID for this API calling organization. This Credify ID will be different for each organization. * @summary Creates Individual Entity * @param {EntityRequest} entityRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createIndividualEntityWithIdpass: async (entityRequest: EntityRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'entityRequest' is not null or undefined assertParamExists('createIndividualEntityWithIdpass', 'entityRequest', entityRequest) const localVarPath = `/v1/idpass/users`; // 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 = entityRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This sends a 6-digit code for phone number verification * @summary Send SMS with verification code * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ sendOtpSmsWithIdpass: async (phone: Phone, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'phone' is not null or undefined assertParamExists('sendOtpSmsWithIdpass', 'phone', phone) const localVarPath = `/v1/idpass/users/phone`; // 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 = phone return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * IdPassProviderApi - functional programming interface * @export */ export const IdPassProviderApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = IdPassProviderApiAxiosParamCreator(configuration) return { /** * This creates a new individual entity with a phone verification code. This requires a hashed password (sha256 - base64 URL encoded string), encrypted private keys of both signing and encryption, public keys of both signing and encryption. This response will be a Credify ID for this API calling organization. This Credify ID will be different for each organization. * @summary Creates Individual Entity * @param {EntityRequest} entityRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createIndividualEntityWithIdpass(entityRequest: EntityRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createIndividualEntityWithIdpass(entityRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This sends a 6-digit code for phone number verification * @summary Send SMS with verification code * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ async sendOtpSmsWithIdpass(phone: Phone, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.sendOtpSmsWithIdpass(phone, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * IdPassProviderApi - factory interface * @export */ export const IdPassProviderApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = IdPassProviderApiFp(configuration) return { /** * This creates a new individual entity with a phone verification code. This requires a hashed password (sha256 - base64 URL encoded string), encrypted private keys of both signing and encryption, public keys of both signing and encryption. This response will be a Credify ID for this API calling organization. This Credify ID will be different for each organization. * @summary Creates Individual Entity * @param {EntityRequest} entityRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createIndividualEntityWithIdpass(entityRequest: EntityRequest, options?: any): AxiosPromise { return localVarFp.createIndividualEntityWithIdpass(entityRequest, options).then((request) => request(axios, basePath)); }, /** * This sends a 6-digit code for phone number verification * @summary Send SMS with verification code * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ sendOtpSmsWithIdpass(phone: Phone, options?: any): AxiosPromise { return localVarFp.sendOtpSmsWithIdpass(phone, options).then((request) => request(axios, basePath)); }, }; }; /** * IdPassProviderApi - interface * @export * @interface IdPassProviderApi */ export interface IdPassProviderApiInterface { /** * This creates a new individual entity with a phone verification code. This requires a hashed password (sha256 - base64 URL encoded string), encrypted private keys of both signing and encryption, public keys of both signing and encryption. This response will be a Credify ID for this API calling organization. This Credify ID will be different for each organization. * @summary Creates Individual Entity * @param {EntityRequest} entityRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof IdPassProviderApiInterface */ createIndividualEntityWithIdpass(entityRequest: EntityRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This sends a 6-digit code for phone number verification * @summary Send SMS with verification code * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof IdPassProviderApiInterface */ sendOtpSmsWithIdpass(phone: Phone, options?: AxiosRequestConfig): AxiosPromise; } /** * IdPassProviderApi - object-oriented interface * @export * @class IdPassProviderApi * @extends {BaseAPI} */ export class IdPassProviderApi extends BaseAPI implements IdPassProviderApiInterface { /** * This creates a new individual entity with a phone verification code. This requires a hashed password (sha256 - base64 URL encoded string), encrypted private keys of both signing and encryption, public keys of both signing and encryption. This response will be a Credify ID for this API calling organization. This Credify ID will be different for each organization. * @summary Creates Individual Entity * @param {EntityRequest} entityRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof IdPassProviderApi */ public createIndividualEntityWithIdpass(entityRequest: EntityRequest, options?: AxiosRequestConfig) { return IdPassProviderApiFp(this.configuration).createIndividualEntityWithIdpass(entityRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This sends a 6-digit code for phone number verification * @summary Send SMS with verification code * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof IdPassProviderApi */ public sendOtpSmsWithIdpass(phone: Phone, options?: AxiosRequestConfig) { return IdPassProviderApiFp(this.configuration).sendOtpSmsWithIdpass(phone, options).then((request) => request(this.axios, this.basePath)); } }