/* tslint:disable */ /* eslint-disable */ /** * gljournalentries * 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 { ErrorResponse } from '../models'; // @ts-ignore import type { GLJournalEntry } from '../models'; // @ts-ignore import type { GLJournalEntrySearchCriteria } from '../models'; // @ts-ignore import type { PostGLJournalEntriesDTO } from '../models'; /** * JournalEntriesApi - axios parameter creator */ export const JournalEntriesApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Create general ledger journal entries. * @param {PostGLJournalEntriesDTO} postGLJournalEntriesDTO Represents the information to create general ledger journal entries. * @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 ( postGLJournalEntriesDTO: PostGLJournalEntriesDTO, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'postGLJournalEntriesDTO' is not null or undefined assertParamExists( 'create', 'postGLJournalEntriesDTO', postGLJournalEntriesDTO, ); const localVarPath = `/gljournalentries`; // 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( postGLJournalEntriesDTO, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get general ledger journal entries * @param {string} from The booking date to search from for general ledger journal entries. * @param {string} to The booking date to search to for general ledger journal entries. * @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 {string} [branchId] The branch ID to filter general ledger journal entries by. * @param {string} [glAccountId] The general ledger account ID to filter general ledger journal entries by. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll: async ( from: string, to: string, offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, branchId?: string, glAccountId?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'from' is not null or undefined assertParamExists('getAll', 'from', from); // verify required parameter 'to' is not null or undefined assertParamExists('getAll', 'to', to); const localVarPath = `/gljournalentries`; // 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; } if (from !== undefined) { localVarQueryParameter['from'] = (from as any) instanceof Date ? (from as any).toISOString().substring(0, 10) : from; } if (to !== undefined) { localVarQueryParameter['to'] = (to as any) instanceof Date ? (to as any).toISOString().substring(0, 10) : to; } if (branchId !== undefined) { localVarQueryParameter['branchId'] = branchId; } if (glAccountId !== undefined) { localVarQueryParameter['glAccountId'] = glAccountId; } 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 Search for general ledger journal entries * @param {GLJournalEntrySearchCriteria} gLJournalEntrySearchCriteria Represents the filtering criteria and sorting criterion to search for general ledger journal entries. * @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 {SearchPaginationDetailsEnum} [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 {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {*} [options] Override http request option. * @throws {RequiredError} */ search: async ( gLJournalEntrySearchCriteria: GLJournalEntrySearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'gLJournalEntrySearchCriteria' is not null or undefined assertParamExists( 'search', 'gLJournalEntrySearchCriteria', gLJournalEntrySearchCriteria, ); const localVarPath = `/gljournalentries:search`; // 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); if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (paginationDetails !== undefined) { localVarQueryParameter['paginationDetails'] = paginationDetails; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } 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( gLJournalEntrySearchCriteria, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * JournalEntriesApi - functional programming interface */ export const JournalEntriesApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = JournalEntriesApiAxiosParamCreator(configuration); return { /** * * @summary Create general ledger journal entries. * @param {PostGLJournalEntriesDTO} postGLJournalEntriesDTO Represents the information to create general ledger journal entries. * @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( postGLJournalEntriesDTO: PostGLJournalEntriesDTO, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.create( postGLJournalEntriesDTO, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['JournalEntriesApi.create']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get general ledger journal entries * @param {string} from The booking date to search from for general ledger journal entries. * @param {string} to The booking date to search to for general ledger journal entries. * @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 {string} [branchId] The branch ID to filter general ledger journal entries by. * @param {string} [glAccountId] The general ledger account ID to filter general ledger journal entries by. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAll( from: string, to: string, offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, branchId?: string, glAccountId?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAll( from, to, offset, limit, paginationDetails, branchId, glAccountId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['JournalEntriesApi.getAll']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Search for general ledger journal entries * @param {GLJournalEntrySearchCriteria} gLJournalEntrySearchCriteria Represents the filtering criteria and sorting criterion to search for general ledger journal entries. * @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 {SearchPaginationDetailsEnum} [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 {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {*} [options] Override http request option. * @throws {RequiredError} */ async search( gLJournalEntrySearchCriteria: GLJournalEntrySearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.search( gLJournalEntrySearchCriteria, offset, limit, paginationDetails, cursor, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['JournalEntriesApi.search']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * JournalEntriesApi - factory interface */ export const JournalEntriesApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = JournalEntriesApiFp(configuration); return { /** * * @summary Create general ledger journal entries. * @param {PostGLJournalEntriesDTO} postGLJournalEntriesDTO Represents the information to create general ledger journal entries. * @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( postGLJournalEntriesDTO: PostGLJournalEntriesDTO, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .create(postGLJournalEntriesDTO, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get general ledger journal entries * @param {string} from The booking date to search from for general ledger journal entries. * @param {string} to The booking date to search to for general ledger journal entries. * @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 {string} [branchId] The branch ID to filter general ledger journal entries by. * @param {string} [glAccountId] The general ledger account ID to filter general ledger journal entries by. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll( from: string, to: string, offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, branchId?: string, glAccountId?: string, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getAll( from, to, offset, limit, paginationDetails, branchId, glAccountId, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Search for general ledger journal entries * @param {GLJournalEntrySearchCriteria} gLJournalEntrySearchCriteria Represents the filtering criteria and sorting criterion to search for general ledger journal entries. * @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 {SearchPaginationDetailsEnum} [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 {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {*} [options] Override http request option. * @throws {RequiredError} */ search( gLJournalEntrySearchCriteria: GLJournalEntrySearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .search( gLJournalEntrySearchCriteria, offset, limit, paginationDetails, cursor, options, ) .then((request) => request(axios, basePath)); }, }; }; /** * JournalEntriesApi - object-oriented interface */ export class JournalEntriesApi extends BaseAPI { /** * * @summary Create general ledger journal entries. * @param {PostGLJournalEntriesDTO} postGLJournalEntriesDTO Represents the information to create general ledger journal entries. * @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( postGLJournalEntriesDTO: PostGLJournalEntriesDTO, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return JournalEntriesApiFp(this.configuration) .create(postGLJournalEntriesDTO, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get general ledger journal entries * @param {string} from The booking date to search from for general ledger journal entries. * @param {string} to The booking date to search to for general ledger journal entries. * @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 {string} [branchId] The branch ID to filter general ledger journal entries by. * @param {string} [glAccountId] The general ledger account ID to filter general ledger journal entries by. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAll( from: string, to: string, offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, branchId?: string, glAccountId?: string, options?: RawAxiosRequestConfig, ) { return JournalEntriesApiFp(this.configuration) .getAll( from, to, offset, limit, paginationDetails, branchId, glAccountId, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Search for general ledger journal entries * @param {GLJournalEntrySearchCriteria} gLJournalEntrySearchCriteria Represents the filtering criteria and sorting criterion to search for general ledger journal entries. * @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 {SearchPaginationDetailsEnum} [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 {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {*} [options] Override http request option. * @throws {RequiredError} */ public search( gLJournalEntrySearchCriteria: GLJournalEntrySearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, options?: RawAxiosRequestConfig, ) { return JournalEntriesApiFp(this.configuration) .search( gLJournalEntrySearchCriteria, offset, limit, paginationDetails, cursor, 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]; export const SearchPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type SearchPaginationDetailsEnum = (typeof SearchPaginationDetailsEnum)[keyof typeof SearchPaginationDetailsEnum];