/* 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 { WebhookListResponse } from '../model'; // @ts-ignore import { WebhookRequest } from '../model'; // @ts-ignore import { WebhookResponse } from '../model'; /** * WebhookApi - axios parameter creator * @export */ export const WebhookApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * This retrieves webhook list. * @summary Webhook list * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookList: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/v1/webhook`; // 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, }; }, /** * This register a new webhook url. * @summary update a Webhook url * @param {string} id Webhook id * @param {WebhookRequest} webhookRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ registerWebhook: async (id: string, webhookRequest: WebhookRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('registerWebhook', 'id', id) // verify required parameter 'webhookRequest' is not null or undefined assertParamExists('registerWebhook', 'webhookRequest', webhookRequest) const localVarPath = `/v1/webhook/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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 = webhookRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * This operation deletes a specified webhook. * @summary Removes a specified webhook * @param {string} id Webhook id * @param {*} [options] Override http request option. * @throws {RequiredError} */ removeWebhook: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('removeWebhook', 'id', id) const localVarPath = `/v1/webhook/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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: 'DELETE', ...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, }; }, /** * This register a new webhook url. * @summary Webhook creation * @param {WebhookRequest} webhookRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1WebhookPost: async (webhookRequest: WebhookRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'webhookRequest' is not null or undefined assertParamExists('v1WebhookPost', 'webhookRequest', webhookRequest) const localVarPath = `/v1/webhook`; // 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 = webhookRequest return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * WebhookApi - functional programming interface * @export */ export const WebhookApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = WebhookApiAxiosParamCreator(configuration) return { /** * This retrieves webhook list. * @summary Webhook list * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getWebhookList(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getWebhookList(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This register a new webhook url. * @summary update a Webhook url * @param {string} id Webhook id * @param {WebhookRequest} webhookRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async registerWebhook(id: string, webhookRequest: WebhookRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.registerWebhook(id, webhookRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This operation deletes a specified webhook. * @summary Removes a specified webhook * @param {string} id Webhook id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async removeWebhook(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.removeWebhook(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This register a new webhook url. * @summary Webhook creation * @param {WebhookRequest} webhookRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async v1WebhookPost(webhookRequest: WebhookRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.v1WebhookPost(webhookRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * WebhookApi - factory interface * @export */ export const WebhookApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = WebhookApiFp(configuration) return { /** * This retrieves webhook list. * @summary Webhook list * @param {*} [options] Override http request option. * @throws {RequiredError} */ getWebhookList(options?: any): AxiosPromise { return localVarFp.getWebhookList(options).then((request) => request(axios, basePath)); }, /** * This register a new webhook url. * @summary update a Webhook url * @param {string} id Webhook id * @param {WebhookRequest} webhookRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ registerWebhook(id: string, webhookRequest: WebhookRequest, options?: any): AxiosPromise { return localVarFp.registerWebhook(id, webhookRequest, options).then((request) => request(axios, basePath)); }, /** * This operation deletes a specified webhook. * @summary Removes a specified webhook * @param {string} id Webhook id * @param {*} [options] Override http request option. * @throws {RequiredError} */ removeWebhook(id: string, options?: any): AxiosPromise { return localVarFp.removeWebhook(id, options).then((request) => request(axios, basePath)); }, /** * This register a new webhook url. * @summary Webhook creation * @param {WebhookRequest} webhookRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ v1WebhookPost(webhookRequest: WebhookRequest, options?: any): AxiosPromise { return localVarFp.v1WebhookPost(webhookRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * WebhookApi - interface * @export * @interface WebhookApi */ export interface WebhookApiInterface { /** * This retrieves webhook list. * @summary Webhook list * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApiInterface */ getWebhookList(options?: AxiosRequestConfig): AxiosPromise; /** * This register a new webhook url. * @summary update a Webhook url * @param {string} id Webhook id * @param {WebhookRequest} webhookRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApiInterface */ registerWebhook(id: string, webhookRequest: WebhookRequest, options?: AxiosRequestConfig): AxiosPromise; /** * This operation deletes a specified webhook. * @summary Removes a specified webhook * @param {string} id Webhook id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApiInterface */ removeWebhook(id: string, options?: AxiosRequestConfig): AxiosPromise; /** * This register a new webhook url. * @summary Webhook creation * @param {WebhookRequest} webhookRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApiInterface */ v1WebhookPost(webhookRequest: WebhookRequest, options?: AxiosRequestConfig): AxiosPromise; } /** * WebhookApi - object-oriented interface * @export * @class WebhookApi * @extends {BaseAPI} */ export class WebhookApi extends BaseAPI implements WebhookApiInterface { /** * This retrieves webhook list. * @summary Webhook list * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApi */ public getWebhookList(options?: AxiosRequestConfig) { return WebhookApiFp(this.configuration).getWebhookList(options).then((request) => request(this.axios, this.basePath)); } /** * This register a new webhook url. * @summary update a Webhook url * @param {string} id Webhook id * @param {WebhookRequest} webhookRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApi */ public registerWebhook(id: string, webhookRequest: WebhookRequest, options?: AxiosRequestConfig) { return WebhookApiFp(this.configuration).registerWebhook(id, webhookRequest, options).then((request) => request(this.axios, this.basePath)); } /** * This operation deletes a specified webhook. * @summary Removes a specified webhook * @param {string} id Webhook id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApi */ public removeWebhook(id: string, options?: AxiosRequestConfig) { return WebhookApiFp(this.configuration).removeWebhook(id, options).then((request) => request(this.axios, this.basePath)); } /** * This register a new webhook url. * @summary Webhook creation * @param {WebhookRequest} webhookRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof WebhookApi */ public v1WebhookPost(webhookRequest: WebhookRequest, options?: AxiosRequestConfig) { return WebhookApiFp(this.configuration).v1WebhookPost(webhookRequest, options).then((request) => request(this.axios, this.basePath)); } }