/* 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 { CommonResponse } from '../model'; // @ts-ignore import { IdentityResponse } from '../model'; // @ts-ignore import { Phone } from '../model'; // @ts-ignore import { PhoneVerification } from '../model'; /** * PhoneNumberApi - axios parameter creator * @export */ export const PhoneNumberApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This resend a SMS with phone number verification code to a specified phone number. * @summary Organization - Phone number resend * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ resendOrganizationOtpSms: async (phone: Phone, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'phone' is not null or undefined assertParamExists('resendOrganizationOtpSms', 'phone', phone) const localVarPath = `/v1/entity/organization/phone-number/resend`; // 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, }; }, /** * This resend a SMS with phone number verification code to a specified phone number. * @summary Individual - Phone number resend * @param {Phone} phone * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ resendOtpSms: async (phone: Phone, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'phone' is not null or undefined assertParamExists('resendOtpSms', 'phone', phone) const localVarPath = `/v1/entity/individual/phone-number/resend`; // 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, }; }, /** * This resend an SMS with phone number verification code (OTP) to a specified phone number. This API generates an OTP per call. The the same end-user calls this API several times, a new OTP will be generated every call. Only the latest OTP will be valid. This can be called - When an individual entity tries to register or recovery an account - When a logged in individual entity tries to update their phone number * @summary Individual - Send SMS * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ sendOtpSms: async (phone: Phone, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'phone' is not null or undefined assertParamExists('sendOtpSms', 'phone', phone) const localVarPath = `/v1/entity/individual/phone-number`; // 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, }; }, /** * This updates an existing phone number. * @summary Organization - Phone number update * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrganizationPhoneNumber: async (phone: Phone, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'phone' is not null or undefined assertParamExists('updateOrganizationPhoneNumber', 'phone', phone) const localVarPath = `/v1/entity/organization/phone-number`; // 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: 'PUT', ...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, }; }, /** * This verifies a new phone number with a confirmation code sent on SMS. * @summary Organization - Phone number verification * @param {PhoneVerification} phoneVerification * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyOrganizationPhoneNumber: async (phoneVerification: PhoneVerification, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'phoneVerification' is not null or undefined assertParamExists('verifyOrganizationPhoneNumber', 'phoneVerification', phoneVerification) const localVarPath = `/v1/entity/organization/phone-number/verify`; // 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 = phoneVerification return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This verifies a new phone number with a confirmation code sent on SMS. * @summary Individual - Phone number verification * @param {PhoneVerification} phoneVerification * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyPhoneNumber: async (phoneVerification: PhoneVerification, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'phoneVerification' is not null or undefined assertParamExists('verifyPhoneNumber', 'phoneVerification', phoneVerification) const localVarPath = `/v1/entity/individual/phone-number/verify`; // 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 = phoneVerification return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * PhoneNumberApi - functional programming interface * @export */ export const PhoneNumberApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = PhoneNumberApiAxiosParamCreator(configuration) return { /** * This resend a SMS with phone number verification code to a specified phone number. * @summary Organization - Phone number resend * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ async resendOrganizationOtpSms(phone: Phone, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.resendOrganizationOtpSms(phone, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This resend a SMS with phone number verification code to a specified phone number. * @summary Individual - Phone number resend * @param {Phone} phone * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ async resendOtpSms(phone: Phone, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.resendOtpSms(phone, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This resend an SMS with phone number verification code (OTP) to a specified phone number. This API generates an OTP per call. The the same end-user calls this API several times, a new OTP will be generated every call. Only the latest OTP will be valid. This can be called - When an individual entity tries to register or recovery an account - When a logged in individual entity tries to update their phone number * @summary Individual - Send SMS * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ async sendOtpSms(phone: Phone, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.sendOtpSms(phone, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This updates an existing phone number. * @summary Organization - Phone number update * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateOrganizationPhoneNumber(phone: Phone, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrganizationPhoneNumber(phone, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This verifies a new phone number with a confirmation code sent on SMS. * @summary Organization - Phone number verification * @param {PhoneVerification} phoneVerification * @param {*} [options] Override http request option. * @throws {RequiredError} */ async verifyOrganizationPhoneNumber(phoneVerification: PhoneVerification, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.verifyOrganizationPhoneNumber(phoneVerification, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This verifies a new phone number with a confirmation code sent on SMS. * @summary Individual - Phone number verification * @param {PhoneVerification} phoneVerification * @param {*} [options] Override http request option. * @throws {RequiredError} */ async verifyPhoneNumber(phoneVerification: PhoneVerification, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.verifyPhoneNumber(phoneVerification, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * PhoneNumberApi - factory interface * @export */ export const PhoneNumberApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = PhoneNumberApiFp(configuration) return { /** * This resend a SMS with phone number verification code to a specified phone number. * @summary Organization - Phone number resend * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ resendOrganizationOtpSms(phone: Phone, options?: any): AxiosPromise { return localVarFp.resendOrganizationOtpSms(phone, options).then((request) => request(axios, basePath)); }, /** * This resend a SMS with phone number verification code to a specified phone number. * @summary Individual - Phone number resend * @param {Phone} phone * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ resendOtpSms(phone: Phone, options?: any): AxiosPromise { return localVarFp.resendOtpSms(phone, options).then((request) => request(axios, basePath)); }, /** * This resend an SMS with phone number verification code (OTP) to a specified phone number. This API generates an OTP per call. The the same end-user calls this API several times, a new OTP will be generated every call. Only the latest OTP will be valid. This can be called - When an individual entity tries to register or recovery an account - When a logged in individual entity tries to update their phone number * @summary Individual - Send SMS * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ sendOtpSms(phone: Phone, options?: any): AxiosPromise { return localVarFp.sendOtpSms(phone, options).then((request) => request(axios, basePath)); }, /** * This updates an existing phone number. * @summary Organization - Phone number update * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrganizationPhoneNumber(phone: Phone, options?: any): AxiosPromise { return localVarFp.updateOrganizationPhoneNumber(phone, options).then((request) => request(axios, basePath)); }, /** * This verifies a new phone number with a confirmation code sent on SMS. * @summary Organization - Phone number verification * @param {PhoneVerification} phoneVerification * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyOrganizationPhoneNumber(phoneVerification: PhoneVerification, options?: any): AxiosPromise { return localVarFp.verifyOrganizationPhoneNumber(phoneVerification, options).then((request) => request(axios, basePath)); }, /** * This verifies a new phone number with a confirmation code sent on SMS. * @summary Individual - Phone number verification * @param {PhoneVerification} phoneVerification * @param {*} [options] Override http request option. * @throws {RequiredError} */ verifyPhoneNumber(phoneVerification: PhoneVerification, options?: any): AxiosPromise { return localVarFp.verifyPhoneNumber(phoneVerification, options).then((request) => request(axios, basePath)); }, }; }; /** * PhoneNumberApi - interface * @export * @interface PhoneNumberApi */ export interface PhoneNumberApiInterface { /** * This resend a SMS with phone number verification code to a specified phone number. * @summary Organization - Phone number resend * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PhoneNumberApiInterface */ resendOrganizationOtpSms(phone: Phone, options?: AxiosRequestConfig): AxiosPromise; /** * This resend a SMS with phone number verification code to a specified phone number. * @summary Individual - Phone number resend * @param {Phone} phone * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof PhoneNumberApiInterface */ resendOtpSms(phone: Phone, options?: AxiosRequestConfig): AxiosPromise; /** * This resend an SMS with phone number verification code (OTP) to a specified phone number. This API generates an OTP per call. The the same end-user calls this API several times, a new OTP will be generated every call. Only the latest OTP will be valid. This can be called - When an individual entity tries to register or recovery an account - When a logged in individual entity tries to update their phone number * @summary Individual - Send SMS * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PhoneNumberApiInterface */ sendOtpSms(phone: Phone, options?: AxiosRequestConfig): AxiosPromise; /** * This updates an existing phone number. * @summary Organization - Phone number update * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PhoneNumberApiInterface */ updateOrganizationPhoneNumber(phone: Phone, options?: AxiosRequestConfig): AxiosPromise; /** * This verifies a new phone number with a confirmation code sent on SMS. * @summary Organization - Phone number verification * @param {PhoneVerification} phoneVerification * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PhoneNumberApiInterface */ verifyOrganizationPhoneNumber(phoneVerification: PhoneVerification, options?: AxiosRequestConfig): AxiosPromise; /** * This verifies a new phone number with a confirmation code sent on SMS. * @summary Individual - Phone number verification * @param {PhoneVerification} phoneVerification * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PhoneNumberApiInterface */ verifyPhoneNumber(phoneVerification: PhoneVerification, options?: AxiosRequestConfig): AxiosPromise; } /** * PhoneNumberApi - object-oriented interface * @export * @class PhoneNumberApi * @extends {BaseAPI} */ export class PhoneNumberApi extends BaseAPI implements PhoneNumberApiInterface { /** * This resend a SMS with phone number verification code to a specified phone number. * @summary Organization - Phone number resend * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PhoneNumberApi */ public resendOrganizationOtpSms(phone: Phone, options?: AxiosRequestConfig) { return PhoneNumberApiFp(this.configuration).resendOrganizationOtpSms(phone, options).then((request) => request(this.axios, this.basePath)); } /** * This resend a SMS with phone number verification code to a specified phone number. * @summary Individual - Phone number resend * @param {Phone} phone * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} * @memberof PhoneNumberApi */ public resendOtpSms(phone: Phone, options?: AxiosRequestConfig) { return PhoneNumberApiFp(this.configuration).resendOtpSms(phone, options).then((request) => request(this.axios, this.basePath)); } /** * This resend an SMS with phone number verification code (OTP) to a specified phone number. This API generates an OTP per call. The the same end-user calls this API several times, a new OTP will be generated every call. Only the latest OTP will be valid. This can be called - When an individual entity tries to register or recovery an account - When a logged in individual entity tries to update their phone number * @summary Individual - Send SMS * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PhoneNumberApi */ public sendOtpSms(phone: Phone, options?: AxiosRequestConfig) { return PhoneNumberApiFp(this.configuration).sendOtpSms(phone, options).then((request) => request(this.axios, this.basePath)); } /** * This updates an existing phone number. * @summary Organization - Phone number update * @param {Phone} phone * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PhoneNumberApi */ public updateOrganizationPhoneNumber(phone: Phone, options?: AxiosRequestConfig) { return PhoneNumberApiFp(this.configuration).updateOrganizationPhoneNumber(phone, options).then((request) => request(this.axios, this.basePath)); } /** * This verifies a new phone number with a confirmation code sent on SMS. * @summary Organization - Phone number verification * @param {PhoneVerification} phoneVerification * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PhoneNumberApi */ public verifyOrganizationPhoneNumber(phoneVerification: PhoneVerification, options?: AxiosRequestConfig) { return PhoneNumberApiFp(this.configuration).verifyOrganizationPhoneNumber(phoneVerification, options).then((request) => request(this.axios, this.basePath)); } /** * This verifies a new phone number with a confirmation code sent on SMS. * @summary Individual - Phone number verification * @param {PhoneVerification} phoneVerification * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PhoneNumberApi */ public verifyPhoneNumber(phoneVerification: PhoneVerification, options?: AxiosRequestConfig) { return PhoneNumberApiFp(this.configuration).verifyPhoneNumber(phoneVerification, options).then((request) => request(this.axios, this.basePath)); } }