/* tslint:disable */ /* eslint-disable */ /** * backgroundprocess * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded, } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap, } from '../base'; // @ts-ignore import type { BackgroundProcess } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; /** * BackgroundProcessApi - axios parameter creator */ export const BackgroundProcessApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Get the latest manual or automatic end of day (EOD) process by specifying the type * @param {GetLatestByTypeTypeEnum} [type] The type of background process according to which the latest process should be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLatestByType: async ( type?: GetLatestByTypeTypeEnum, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/backgroundprocess/latest`; // 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 basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (type !== undefined) { localVarQueryParameter['type'] = type; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Cancel manual or automatic end of day (EOD) processes using the encoded key * @param {string} encodedKey The encoded key of the background process which should be changed. * @param {string} body Background process state to set. * @param {*} [options] Override http request option. * @throws {RequiredError} */ update: async ( encodedKey: string, body: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'encodedKey' is not null or undefined assertParamExists('update', 'encodedKey', encodedKey); // verify required parameter 'body' is not null or undefined assertParamExists('update', 'body', body); const localVarPath = `/backgroundprocess/{encodedKey}`.replace( `{${'encodedKey'}}`, encodeURIComponent(String(encodedKey)), ); // 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 basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( body, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * BackgroundProcessApi - functional programming interface */ export const BackgroundProcessApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = BackgroundProcessApiAxiosParamCreator(configuration); return { /** * * @summary Get the latest manual or automatic end of day (EOD) process by specifying the type * @param {GetLatestByTypeTypeEnum} [type] The type of background process according to which the latest process should be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLatestByType( type?: GetLatestByTypeTypeEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getLatestByType( type, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['BackgroundProcessApi.getLatestByType']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Cancel manual or automatic end of day (EOD) processes using the encoded key * @param {string} encodedKey The encoded key of the background process which should be changed. * @param {string} body Background process state to set. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async update( encodedKey: string, body: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.update( encodedKey, body, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['BackgroundProcessApi.update']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * BackgroundProcessApi - factory interface */ export const BackgroundProcessApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = BackgroundProcessApiFp(configuration); return { /** * * @summary Get the latest manual or automatic end of day (EOD) process by specifying the type * @param {GetLatestByTypeTypeEnum} [type] The type of background process according to which the latest process should be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLatestByType( type?: GetLatestByTypeTypeEnum, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getLatestByType(type, options) .then((request) => request(axios, basePath)); }, /** * * @summary Cancel manual or automatic end of day (EOD) processes using the encoded key * @param {string} encodedKey The encoded key of the background process which should be changed. * @param {string} body Background process state to set. * @param {*} [options] Override http request option. * @throws {RequiredError} */ update( encodedKey: string, body: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .update(encodedKey, body, options) .then((request) => request(axios, basePath)); }, }; }; /** * BackgroundProcessApi - object-oriented interface */ export class BackgroundProcessApi extends BaseAPI { /** * * @summary Get the latest manual or automatic end of day (EOD) process by specifying the type * @param {GetLatestByTypeTypeEnum} [type] The type of background process according to which the latest process should be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getLatestByType( type?: GetLatestByTypeTypeEnum, options?: RawAxiosRequestConfig, ) { return BackgroundProcessApiFp(this.configuration) .getLatestByType(type, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Cancel manual or automatic end of day (EOD) processes using the encoded key * @param {string} encodedKey The encoded key of the background process which should be changed. * @param {string} body Background process state to set. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public update( encodedKey: string, body: string, options?: RawAxiosRequestConfig, ) { return BackgroundProcessApiFp(this.configuration) .update(encodedKey, body, options) .then((request) => request(this.axios, this.basePath)); } } export const GetLatestByTypeTypeEnum = { CronJobs: 'CRON_JOBS', EarlyManualCronJobsTrigger: 'EARLY_MANUAL_CRON_JOBS_TRIGGER', ManualCronJobsTrigger: 'MANUAL_CRON_JOBS_TRIGGER', } as const; export type GetLatestByTypeTypeEnum = (typeof GetLatestByTypeTypeEnum)[keyof typeof GetLatestByTypeTypeEnum];