/* tslint:disable */ /* eslint-disable */ /** * consumers * 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 { ApiConsumer } from '../models'; // @ts-ignore import type { ApiKey } from '../models'; // @ts-ignore import type { ApiKeyInput } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; // @ts-ignore import type { PatchOperation } from '../models'; // @ts-ignore import type { SecretKey } from '../models'; /** * APIConsumersApi - axios parameter creator */ export const APIConsumersApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Delete API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete: async ( apiConsumerId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'apiConsumerId' is not null or undefined assertParamExists('_delete', 'apiConsumerId', apiConsumerId); const localVarPath = `/consumers/{apiConsumerId}`.replace( `{${'apiConsumerId'}}`, encodeURIComponent(String(apiConsumerId)), ); // 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 basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); 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 Create API consumer * @param {ApiConsumer} apiConsumer API consumer to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ create: async ( apiConsumer: ApiConsumer, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'apiConsumer' is not null or undefined assertParamExists('create', 'apiConsumer', apiConsumer); const localVarPath = `/consumers`; // 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 basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( apiConsumer, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Create API key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {ApiKeyInput} [apiKeyInput] API key expiration time in seconds. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createApiKeyForConsumer: async ( apiConsumerId: string, idempotencyKey?: string, apiKeyInput?: ApiKeyInput, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'apiConsumerId' is not null or undefined assertParamExists( 'createApiKeyForConsumer', 'apiConsumerId', apiConsumerId, ); const localVarPath = `/consumers/{apiConsumerId}/apikeys`.replace( `{${'apiConsumerId'}}`, encodeURIComponent(String(apiConsumerId)), ); // 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 basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( apiKeyInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Create secret key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSecretKeyForConsumer: async ( apiConsumerId: string, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'apiConsumerId' is not null or undefined assertParamExists( 'createSecretKeyForConsumer', 'apiConsumerId', apiConsumerId, ); const localVarPath = `/consumers/{apiConsumerId}/secretkeys`.replace( `{${'apiConsumerId'}}`, encodeURIComponent(String(apiConsumerId)), ); // 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 basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Delete API key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} apiKeyId The ID of the API key. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteApiKeyForConsumer: async ( apiConsumerId: string, apiKeyId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'apiConsumerId' is not null or undefined assertParamExists( 'deleteApiKeyForConsumer', 'apiConsumerId', apiConsumerId, ); // verify required parameter 'apiKeyId' is not null or undefined assertParamExists('deleteApiKeyForConsumer', 'apiKeyId', apiKeyId); const localVarPath = `/consumers/{apiConsumerId}/apikeys/{apiKeyId}` .replace( `{${'apiConsumerId'}}`, encodeURIComponent(String(apiConsumerId)), ) .replace(`{${'apiKeyId'}}`, encodeURIComponent(String(apiKeyId))); // 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 basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); 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 Get all API consumers * @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 {GetAllPaginationDetailsEnum} [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} */ getAll: async ( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/consumers`; // 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, }; }, /** * * @summary Get API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getById: async ( apiConsumerId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'apiConsumerId' is not null or undefined assertParamExists('getById', 'apiConsumerId', apiConsumerId); const localVarPath = `/consumers/{apiConsumerId}`.replace( `{${'apiConsumerId'}}`, encodeURIComponent(String(apiConsumerId)), ); // 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); 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 Get API keys * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getKeysByConsumerId: async ( apiConsumerId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'apiConsumerId' is not null or undefined assertParamExists('getKeysByConsumerId', 'apiConsumerId', apiConsumerId); const localVarPath = `/consumers/{apiConsumerId}/keys`.replace( `{${'apiConsumerId'}}`, encodeURIComponent(String(apiConsumerId)), ); // 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); 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 Partially update API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ patch: async ( apiConsumerId: string, patchOperation: Array, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'apiConsumerId' is not null or undefined assertParamExists('patch', 'apiConsumerId', apiConsumerId); // verify required parameter 'patchOperation' is not null or undefined assertParamExists('patch', 'patchOperation', patchOperation); const localVarPath = `/consumers/{apiConsumerId}`.replace( `{${'apiConsumerId'}}`, encodeURIComponent(String(apiConsumerId)), ); // 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: 'PATCH', ...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'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( patchOperation, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Update API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be updated. * @param {ApiConsumer} apiConsumer API consumer to be updated. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ update: async ( apiConsumerId: string, apiConsumer: ApiConsumer, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'apiConsumerId' is not null or undefined assertParamExists('update', 'apiConsumerId', apiConsumerId); // verify required parameter 'apiConsumer' is not null or undefined assertParamExists('update', 'apiConsumer', apiConsumer); const localVarPath = `/consumers/{apiConsumerId}`.replace( `{${'apiConsumerId'}}`, encodeURIComponent(String(apiConsumerId)), ); // 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'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( apiConsumer, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * APIConsumersApi - functional programming interface */ export const APIConsumersApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = APIConsumersApiAxiosParamCreator(configuration); return { /** * * @summary Delete API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async _delete( apiConsumerId: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator._delete( apiConsumerId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['APIConsumersApi._delete']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Create API consumer * @param {ApiConsumer} apiConsumer API consumer to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async create( apiConsumer: ApiConsumer, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.create( apiConsumer, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['APIConsumersApi.create']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Create API key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {ApiKeyInput} [apiKeyInput] API key expiration time in seconds. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createApiKeyForConsumer( apiConsumerId: string, idempotencyKey?: string, apiKeyInput?: ApiKeyInput, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.createApiKeyForConsumer( apiConsumerId, idempotencyKey, apiKeyInput, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['APIConsumersApi.createApiKeyForConsumer']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Create secret key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createSecretKeyForConsumer( apiConsumerId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.createSecretKeyForConsumer( apiConsumerId, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['APIConsumersApi.createSecretKeyForConsumer']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Delete API key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} apiKeyId The ID of the API key. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteApiKeyForConsumer( apiConsumerId: string, apiKeyId: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteApiKeyForConsumer( apiConsumerId, apiKeyId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['APIConsumersApi.deleteApiKeyForConsumer']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get all API consumers * @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 {GetAllPaginationDetailsEnum} [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 getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAll( offset, limit, paginationDetails, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['APIConsumersApi.getAll']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getById( apiConsumerId: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getById( apiConsumerId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['APIConsumersApi.getById']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get API keys * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getKeysByConsumerId( apiConsumerId: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getKeysByConsumerId( apiConsumerId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['APIConsumersApi.getKeysByConsumerId']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Partially update API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async patch( apiConsumerId: string, patchOperation: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.patch( apiConsumerId, patchOperation, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['APIConsumersApi.patch']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Update API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be updated. * @param {ApiConsumer} apiConsumer API consumer to be updated. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async update( apiConsumerId: string, apiConsumer: ApiConsumer, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.update( apiConsumerId, apiConsumer, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['APIConsumersApi.update']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * APIConsumersApi - factory interface */ export const APIConsumersApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = APIConsumersApiFp(configuration); return { /** * * @summary Delete API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete( apiConsumerId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp ._delete(apiConsumerId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Create API consumer * @param {ApiConsumer} apiConsumer API consumer to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ create( apiConsumer: ApiConsumer, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .create(apiConsumer, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Create API key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {ApiKeyInput} [apiKeyInput] API key expiration time in seconds. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createApiKeyForConsumer( apiConsumerId: string, idempotencyKey?: string, apiKeyInput?: ApiKeyInput, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .createApiKeyForConsumer( apiConsumerId, idempotencyKey, apiKeyInput, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Create secret key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createSecretKeyForConsumer( apiConsumerId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .createSecretKeyForConsumer(apiConsumerId, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Delete API key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} apiKeyId The ID of the API key. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteApiKeyForConsumer( apiConsumerId: string, apiKeyId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .deleteApiKeyForConsumer(apiConsumerId, apiKeyId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get all API consumers * @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 {GetAllPaginationDetailsEnum} [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} */ getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getAll(offset, limit, paginationDetails, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getById( apiConsumerId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getById(apiConsumerId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get API keys * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getKeysByConsumerId( apiConsumerId: string, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getKeysByConsumerId(apiConsumerId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Partially update API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ patch( apiConsumerId: string, patchOperation: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .patch(apiConsumerId, patchOperation, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Update API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be updated. * @param {ApiConsumer} apiConsumer API consumer to be updated. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ update( apiConsumerId: string, apiConsumer: ApiConsumer, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .update(apiConsumerId, apiConsumer, idempotencyKey, options) .then((request) => request(axios, basePath)); }, }; }; /** * APIConsumersApi - object-oriented interface */ export class APIConsumersApi extends BaseAPI { /** * * @summary Delete API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public _delete(apiConsumerId: string, options?: RawAxiosRequestConfig) { return APIConsumersApiFp(this.configuration) ._delete(apiConsumerId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Create API consumer * @param {ApiConsumer} apiConsumer API consumer to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public create( apiConsumer: ApiConsumer, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return APIConsumersApiFp(this.configuration) .create(apiConsumer, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Create API key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {ApiKeyInput} [apiKeyInput] API key expiration time in seconds. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public createApiKeyForConsumer( apiConsumerId: string, idempotencyKey?: string, apiKeyInput?: ApiKeyInput, options?: RawAxiosRequestConfig, ) { return APIConsumersApiFp(this.configuration) .createApiKeyForConsumer( apiConsumerId, idempotencyKey, apiKeyInput, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Create secret key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public createSecretKeyForConsumer( apiConsumerId: string, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return APIConsumersApiFp(this.configuration) .createSecretKeyForConsumer(apiConsumerId, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Delete API key * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {string} apiKeyId The ID of the API key. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public deleteApiKeyForConsumer( apiConsumerId: string, apiKeyId: string, options?: RawAxiosRequestConfig, ) { return APIConsumersApiFp(this.configuration) .deleteApiKeyForConsumer(apiConsumerId, apiKeyId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get all API consumers * @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 {GetAllPaginationDetailsEnum} [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 getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, options?: RawAxiosRequestConfig, ) { return APIConsumersApiFp(this.configuration) .getAll(offset, limit, paginationDetails, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getById(apiConsumerId: string, options?: RawAxiosRequestConfig) { return APIConsumersApiFp(this.configuration) .getById(apiConsumerId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get API keys * @param {string} apiConsumerId The ID or encoded key of the API consumer. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getKeysByConsumerId( apiConsumerId: string, options?: RawAxiosRequestConfig, ) { return APIConsumersApiFp(this.configuration) .getKeysByConsumerId(apiConsumerId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Partially update API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public patch( apiConsumerId: string, patchOperation: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return APIConsumersApiFp(this.configuration) .patch(apiConsumerId, patchOperation, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Update API consumer * @param {string} apiConsumerId The ID or encoded key of the API consumer to be updated. * @param {ApiConsumer} apiConsumer API consumer to be updated. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public update( apiConsumerId: string, apiConsumer: ApiConsumer, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return APIConsumersApiFp(this.configuration) .update(apiConsumerId, apiConsumer, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } } export const GetAllPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type GetAllPaginationDetailsEnum = (typeof GetAllPaginationDetailsEnum)[keyof typeof GetAllPaginationDetailsEnum];