/* tslint:disable */ /* eslint-disable */ /** * bulks * 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 { BulkProcessStatus } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; /** * BulksApi - axios parameter creator */ export const BulksApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Allow retrieval the status of a bulk process via key * @param {string} bulkProcessKey The identifier of the bulk process * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetBulkStatusPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBulkStatus: async ( bulkProcessKey: string, offset?: number, limit?: number, paginationDetails?: GetBulkStatusPaginationDetailsEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'bulkProcessKey' is not null or undefined assertParamExists('getBulkStatus', 'bulkProcessKey', bulkProcessKey); const localVarPath = `/bulks/{bulkProcessKey}`.replace( `{${'bulkProcessKey'}}`, encodeURIComponent(String(bulkProcessKey)), ); // 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 (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (paginationDetails !== undefined) { localVarQueryParameter['paginationDetails'] = paginationDetails; } 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, }; }, }; }; /** * BulksApi - functional programming interface */ export const BulksApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = BulksApiAxiosParamCreator(configuration); return { /** * * @summary Allow retrieval the status of a bulk process via key * @param {string} bulkProcessKey The identifier of the bulk process * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetBulkStatusPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBulkStatus( bulkProcessKey: string, offset?: number, limit?: number, paginationDetails?: GetBulkStatusPaginationDetailsEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getBulkStatus( bulkProcessKey, offset, limit, paginationDetails, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['BulksApi.getBulkStatus']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * BulksApi - factory interface */ export const BulksApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = BulksApiFp(configuration); return { /** * * @summary Allow retrieval the status of a bulk process via key * @param {string} bulkProcessKey The identifier of the bulk process * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetBulkStatusPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBulkStatus( bulkProcessKey: string, offset?: number, limit?: number, paginationDetails?: GetBulkStatusPaginationDetailsEnum, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getBulkStatus( bulkProcessKey, offset, limit, paginationDetails, options, ) .then((request) => request(axios, basePath)); }, }; }; /** * BulksApi - object-oriented interface */ export class BulksApi extends BaseAPI { /** * * @summary Allow retrieval the status of a bulk process via key * @param {string} bulkProcessKey The identifier of the bulk process * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetBulkStatusPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getBulkStatus( bulkProcessKey: string, offset?: number, limit?: number, paginationDetails?: GetBulkStatusPaginationDetailsEnum, options?: RawAxiosRequestConfig, ) { return BulksApiFp(this.configuration) .getBulkStatus(bulkProcessKey, offset, limit, paginationDetails, options) .then((request) => request(this.axios, this.basePath)); } } export const GetBulkStatusPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type GetBulkStatusPaginationDetailsEnum = (typeof GetBulkStatusPaginationDetailsEnum)[keyof typeof GetBulkStatusPaginationDetailsEnum];