/* tslint:disable */ /* eslint-disable */ /** * Emil PublicAPI * The Emil Public API description * * The version of the OpenAPI document: 1.0 * Contact: kontakt@emil.de * * 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 { CreateLeadAsyncResponseClass } from '../models'; // @ts-ignore import { CreateLeadRequestDto } from '../models'; // @ts-ignore import { CreateLeadResponseClass } from '../models'; // @ts-ignore import { GetLeadResponseClass } from '../models'; // @ts-ignore import { InitiateLeadResponseClass } from '../models'; // @ts-ignore import { UpdateLeadRequestDto } from '../models'; // @ts-ignore import { UpdateLeadResponseClass } from '../models'; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; const FormData = require('form-data'); /** * LeadsApi - axios parameter creator * @export */ export const LeadsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information. * @summary Create the lead * @param {CreateLeadRequestDto} createLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ createLead: async (createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'createLeadRequestDto' is not null or undefined assertParamExists('createLead', 'createLeadRequestDto', createLeadRequestDto) const localVarPath = `/publicapi/v1/leads`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createLeadRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This will send the lead to the queue for creation. Should be used when creating multiple leads at the same time - also called \'batch processing\'. * @summary Create the lead asynchronously * @param {CreateLeadRequestDto} createLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ createLeadAsync: async (createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'createLeadRequestDto' is not null or undefined assertParamExists('createLeadAsync', 'createLeadRequestDto', createLeadRequestDto) const localVarPath = `/publicapi/v1/leads-async`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createLeadRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This endpoint initiates the creation of a lead, which is the initial step in a comprehensive workflow responsible for the creation of an account, policy, and banking information. Unlike the standard lead creation endpoint, this variant ensures that the process waits until the entire workflow is successfully completed before providing a response. * @summary Create the lead synchronously * @param {CreateLeadRequestDto} createLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ createLeadSync: async (createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'createLeadRequestDto' is not null or undefined assertParamExists('createLeadSync', 'createLeadRequestDto', createLeadRequestDto) const localVarPath = `/publicapi/v1/leads-sync`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(createLeadRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information. * @summary Retrieve the lead * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLead: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'code' is not null or undefined assertParamExists('getLead', 'code', code) const localVarPath = `/publicapi/v1/leads/{code}` .replace(`{${"code"}}`, encodeURIComponent(String(code))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This will initiate a lead code. * @summary Initiate a lead code * @param {string} productSlug * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ initiateLead: async (productSlug: string, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'productSlug' is not null or undefined assertParamExists('initiateLead', 'productSlug', productSlug) const localVarPath = `/publicapi/v1/leads/initiate/{productSlug}` .replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @summary Update the lead * @param {string} code Unique identifier for the object. * @param {UpdateLeadRequestDto} updateLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateLead: async (code: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'code' is not null or undefined assertParamExists('updateLead', 'code', code) // verify required parameter 'updateLeadRequestDto' is not null or undefined assertParamExists('updateLead', 'updateLeadRequestDto', updateLeadRequestDto) const localVarPath = `/publicapi/v1/leads/{code}` .replace(`{${"code"}}`, encodeURIComponent(String(code))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateLeadRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @summary Update the lead * @param {string} code Unique identifier for the object. * @param {UpdateLeadRequestDto} updateLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateLeadSync: async (code: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'code' is not null or undefined assertParamExists('updateLeadSync', 'code', code) // verify required parameter 'updateLeadRequestDto' is not null or undefined assertParamExists('updateLeadSync', 'updateLeadRequestDto', updateLeadRequestDto) const localVarPath = `/publicapi/v1/leads-sync/{code}` .replace(`{${"code"}}`, encodeURIComponent(String(code))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; let baseAccessToken; if (configuration) { baseOptions = configuration.baseOptions; baseAccessToken = configuration.accessToken; } const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication bearer required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) { localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken); } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(updateLeadRequestDto, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * LeadsApi - functional programming interface * @export */ export const LeadsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = LeadsApiAxiosParamCreator(configuration) return { /** * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information. * @summary Create the lead * @param {CreateLeadRequestDto} createLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createLead(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createLead(createLeadRequestDto, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This will send the lead to the queue for creation. Should be used when creating multiple leads at the same time - also called \'batch processing\'. * @summary Create the lead asynchronously * @param {CreateLeadRequestDto} createLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createLeadAsync(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createLeadAsync(createLeadRequestDto, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This endpoint initiates the creation of a lead, which is the initial step in a comprehensive workflow responsible for the creation of an account, policy, and banking information. Unlike the standard lead creation endpoint, this variant ensures that the process waits until the entire workflow is successfully completed before providing a response. * @summary Create the lead synchronously * @param {CreateLeadRequestDto} createLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createLeadSync(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createLeadSync(createLeadRequestDto, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information. * @summary Retrieve the lead * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLead(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getLead(code, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This will initiate a lead code. * @summary Initiate a lead code * @param {string} productSlug * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async initiateLead(productSlug: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.initiateLead(productSlug, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @summary Update the lead * @param {string} code Unique identifier for the object. * @param {UpdateLeadRequestDto} updateLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateLead(code: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateLead(code, updateLeadRequestDto, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @summary Update the lead * @param {string} code Unique identifier for the object. * @param {UpdateLeadRequestDto} updateLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateLeadSync(code: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateLeadSync(code, updateLeadRequestDto, authorization, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * LeadsApi - factory interface * @export */ export const LeadsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = LeadsApiFp(configuration) return { /** * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information. * @summary Create the lead * @param {CreateLeadRequestDto} createLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ createLead(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: any): AxiosPromise { return localVarFp.createLead(createLeadRequestDto, authorization, options).then((request) => request(axios, basePath)); }, /** * This will send the lead to the queue for creation. Should be used when creating multiple leads at the same time - also called \'batch processing\'. * @summary Create the lead asynchronously * @param {CreateLeadRequestDto} createLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ createLeadAsync(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: any): AxiosPromise { return localVarFp.createLeadAsync(createLeadRequestDto, authorization, options).then((request) => request(axios, basePath)); }, /** * This endpoint initiates the creation of a lead, which is the initial step in a comprehensive workflow responsible for the creation of an account, policy, and banking information. Unlike the standard lead creation endpoint, this variant ensures that the process waits until the entire workflow is successfully completed before providing a response. * @summary Create the lead synchronously * @param {CreateLeadRequestDto} createLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ createLeadSync(createLeadRequestDto: CreateLeadRequestDto, authorization?: string, options?: any): AxiosPromise { return localVarFp.createLeadSync(createLeadRequestDto, authorization, options).then((request) => request(axios, basePath)); }, /** * Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information. * @summary Retrieve the lead * @param {string} code Unique identifier for the object. * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLead(code: string, authorization?: string, options?: any): AxiosPromise { return localVarFp.getLead(code, authorization, options).then((request) => request(axios, basePath)); }, /** * This will initiate a lead code. * @summary Initiate a lead code * @param {string} productSlug * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ initiateLead(productSlug: string, authorization?: string, options?: any): AxiosPromise { return localVarFp.initiateLead(productSlug, authorization, options).then((request) => request(axios, basePath)); }, /** * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @summary Update the lead * @param {string} code Unique identifier for the object. * @param {UpdateLeadRequestDto} updateLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateLead(code: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options?: any): AxiosPromise { return localVarFp.updateLead(code, updateLeadRequestDto, authorization, options).then((request) => request(axios, basePath)); }, /** * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @summary Update the lead * @param {string} code Unique identifier for the object. * @param {UpdateLeadRequestDto} updateLeadRequestDto * @param {string} [authorization] Bearer Token * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateLeadSync(code: string, updateLeadRequestDto: UpdateLeadRequestDto, authorization?: string, options?: any): AxiosPromise { return localVarFp.updateLeadSync(code, updateLeadRequestDto, authorization, options).then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for createLead operation in LeadsApi. * @export * @interface LeadsApiCreateLeadRequest */ export interface LeadsApiCreateLeadRequest { /** * * @type {CreateLeadRequestDto} * @memberof LeadsApiCreateLead */ readonly createLeadRequestDto: CreateLeadRequestDto /** * Bearer Token * @type {string} * @memberof LeadsApiCreateLead */ readonly authorization?: string } /** * Request parameters for createLeadAsync operation in LeadsApi. * @export * @interface LeadsApiCreateLeadAsyncRequest */ export interface LeadsApiCreateLeadAsyncRequest { /** * * @type {CreateLeadRequestDto} * @memberof LeadsApiCreateLeadAsync */ readonly createLeadRequestDto: CreateLeadRequestDto /** * Bearer Token * @type {string} * @memberof LeadsApiCreateLeadAsync */ readonly authorization?: string } /** * Request parameters for createLeadSync operation in LeadsApi. * @export * @interface LeadsApiCreateLeadSyncRequest */ export interface LeadsApiCreateLeadSyncRequest { /** * * @type {CreateLeadRequestDto} * @memberof LeadsApiCreateLeadSync */ readonly createLeadRequestDto: CreateLeadRequestDto /** * Bearer Token * @type {string} * @memberof LeadsApiCreateLeadSync */ readonly authorization?: string } /** * Request parameters for getLead operation in LeadsApi. * @export * @interface LeadsApiGetLeadRequest */ export interface LeadsApiGetLeadRequest { /** * Unique identifier for the object. * @type {string} * @memberof LeadsApiGetLead */ readonly code: string /** * Bearer Token * @type {string} * @memberof LeadsApiGetLead */ readonly authorization?: string } /** * Request parameters for initiateLead operation in LeadsApi. * @export * @interface LeadsApiInitiateLeadRequest */ export interface LeadsApiInitiateLeadRequest { /** * * @type {string} * @memberof LeadsApiInitiateLead */ readonly productSlug: string /** * Bearer Token * @type {string} * @memberof LeadsApiInitiateLead */ readonly authorization?: string } /** * Request parameters for updateLead operation in LeadsApi. * @export * @interface LeadsApiUpdateLeadRequest */ export interface LeadsApiUpdateLeadRequest { /** * Unique identifier for the object. * @type {string} * @memberof LeadsApiUpdateLead */ readonly code: string /** * * @type {UpdateLeadRequestDto} * @memberof LeadsApiUpdateLead */ readonly updateLeadRequestDto: UpdateLeadRequestDto /** * Bearer Token * @type {string} * @memberof LeadsApiUpdateLead */ readonly authorization?: string } /** * Request parameters for updateLeadSync operation in LeadsApi. * @export * @interface LeadsApiUpdateLeadSyncRequest */ export interface LeadsApiUpdateLeadSyncRequest { /** * Unique identifier for the object. * @type {string} * @memberof LeadsApiUpdateLeadSync */ readonly code: string /** * * @type {UpdateLeadRequestDto} * @memberof LeadsApiUpdateLeadSync */ readonly updateLeadRequestDto: UpdateLeadRequestDto /** * Bearer Token * @type {string} * @memberof LeadsApiUpdateLeadSync */ readonly authorization?: string } /** * LeadsApi - object-oriented interface * @export * @class LeadsApi * @extends {BaseAPI} */ export class LeadsApi extends BaseAPI { /** * This will create a lead. Lead creation is the first step of a workflow responsible for the creation of an account, policy, banking information. * @summary Create the lead * @param {LeadsApiCreateLeadRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LeadsApi */ public createLead(requestParameters: LeadsApiCreateLeadRequest, options?: AxiosRequestConfig) { return LeadsApiFp(this.configuration).createLead(requestParameters.createLeadRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } /** * This will send the lead to the queue for creation. Should be used when creating multiple leads at the same time - also called \'batch processing\'. * @summary Create the lead asynchronously * @param {LeadsApiCreateLeadAsyncRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LeadsApi */ public createLeadAsync(requestParameters: LeadsApiCreateLeadAsyncRequest, options?: AxiosRequestConfig) { return LeadsApiFp(this.configuration).createLeadAsync(requestParameters.createLeadRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } /** * This endpoint initiates the creation of a lead, which is the initial step in a comprehensive workflow responsible for the creation of an account, policy, and banking information. Unlike the standard lead creation endpoint, this variant ensures that the process waits until the entire workflow is successfully completed before providing a response. * @summary Create the lead synchronously * @param {LeadsApiCreateLeadSyncRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LeadsApi */ public createLeadSync(requestParameters: LeadsApiCreateLeadSyncRequest, options?: AxiosRequestConfig) { return LeadsApiFp(this.configuration).createLeadSync(requestParameters.createLeadRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } /** * Retrieves the details of the lead that was previously created. Supply the unique lead code that was returned when you created it and Emil Api will return the corresponding lead information. * @summary Retrieve the lead * @param {LeadsApiGetLeadRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LeadsApi */ public getLead(requestParameters: LeadsApiGetLeadRequest, options?: AxiosRequestConfig) { return LeadsApiFp(this.configuration).getLead(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } /** * This will initiate a lead code. * @summary Initiate a lead code * @param {LeadsApiInitiateLeadRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LeadsApi */ public initiateLead(requestParameters: LeadsApiInitiateLeadRequest, options?: AxiosRequestConfig) { return LeadsApiFp(this.configuration).initiateLead(requestParameters.productSlug, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } /** * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @summary Update the lead * @param {LeadsApiUpdateLeadRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LeadsApi */ public updateLead(requestParameters: LeadsApiUpdateLeadRequest, options?: AxiosRequestConfig) { return LeadsApiFp(this.configuration).updateLead(requestParameters.code, requestParameters.updateLeadRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } /** * Updates the specified lead by setting the values of the parameters passed. Any parameters not provided will be left unchanged. * @summary Update the lead * @param {LeadsApiUpdateLeadSyncRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LeadsApi */ public updateLeadSync(requestParameters: LeadsApiUpdateLeadSyncRequest, options?: AxiosRequestConfig) { return LeadsApiFp(this.configuration).updateLeadSync(requestParameters.code, requestParameters.updateLeadRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath)); } }