/* tslint:disable */ /* eslint-disable */ /** * deposits * 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'; /** * DepositAccountDocumentsApi - axios parameter creator */ export const DepositAccountDocumentsApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Get deposit account document * @param {string} depositAccountId The ID or encoded key of the deposit account. * @param {string} templateId The ID of the deposit product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDepositAccountDocument: async ( depositAccountId: string, templateId: string, startDate?: string, endDate?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'depositAccountId' is not null or undefined assertParamExists( 'getDepositAccountDocument', 'depositAccountId', depositAccountId, ); // verify required parameter 'templateId' is not null or undefined assertParamExists('getDepositAccountDocument', 'templateId', templateId); const localVarPath = `/deposits/{depositAccountId}/templates/{templateId}` .replace( `{${'depositAccountId'}}`, encodeURIComponent(String(depositAccountId)), ) .replace(`{${'templateId'}}`, encodeURIComponent(String(templateId))); // 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 (startDate !== undefined) { localVarQueryParameter['startDate'] = (startDate as any) instanceof Date ? (startDate as any).toISOString().substring(0, 10) : startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = (endDate as any) instanceof Date ? (endDate as any).toISOString().substring(0, 10) : endDate; } 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 Download deposit account document PDF * @param {string} depositAccountId The ID or encoded key of the deposit account. * @param {string} templateId The ID of the deposit product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPdfDocument: async ( depositAccountId: string, templateId: string, startDate?: string, endDate?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'depositAccountId' is not null or undefined assertParamExists('getPdfDocument', 'depositAccountId', depositAccountId); // verify required parameter 'templateId' is not null or undefined assertParamExists('getPdfDocument', 'templateId', templateId); const localVarPath = `/deposits/{depositAccountId}/templates/{templateId}/pdf` .replace( `{${'depositAccountId'}}`, encodeURIComponent(String(depositAccountId)), ) .replace(`{${'templateId'}}`, encodeURIComponent(String(templateId))); // 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 (startDate !== undefined) { localVarQueryParameter['startDate'] = (startDate as any) instanceof Date ? (startDate as any).toISOString().substring(0, 10) : startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = (endDate as any) instanceof Date ? (endDate as any).toISOString().substring(0, 10) : endDate; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+file'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * DepositAccountDocumentsApi - functional programming interface */ export const DepositAccountDocumentsApiFp = function ( configuration?: Configuration, ) { const localVarAxiosParamCreator = DepositAccountDocumentsApiAxiosParamCreator(configuration); return { /** * * @summary Get deposit account document * @param {string} depositAccountId The ID or encoded key of the deposit account. * @param {string} templateId The ID of the deposit product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getDepositAccountDocument( depositAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getDepositAccountDocument( depositAccountId, templateId, startDate, endDate, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap[ 'DepositAccountDocumentsApi.getDepositAccountDocument' ]?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Download deposit account document PDF * @param {string} depositAccountId The ID or encoded key of the deposit account. * @param {string} templateId The ID of the deposit product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPdfDocument( depositAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getPdfDocument( depositAccountId, templateId, startDate, endDate, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['DepositAccountDocumentsApi.getPdfDocument']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * DepositAccountDocumentsApi - factory interface */ export const DepositAccountDocumentsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = DepositAccountDocumentsApiFp(configuration); return { /** * * @summary Get deposit account document * @param {string} depositAccountId The ID or encoded key of the deposit account. * @param {string} templateId The ID of the deposit product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDepositAccountDocument( depositAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getDepositAccountDocument( depositAccountId, templateId, startDate, endDate, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Download deposit account document PDF * @param {string} depositAccountId The ID or encoded key of the deposit account. * @param {string} templateId The ID of the deposit product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPdfDocument( depositAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getPdfDocument( depositAccountId, templateId, startDate, endDate, options, ) .then((request) => request(axios, basePath)); }, }; }; /** * DepositAccountDocumentsApi - object-oriented interface */ export class DepositAccountDocumentsApi extends BaseAPI { /** * * @summary Get deposit account document * @param {string} depositAccountId The ID or encoded key of the deposit account. * @param {string} templateId The ID of the deposit product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getDepositAccountDocument( depositAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ) { return DepositAccountDocumentsApiFp(this.configuration) .getDepositAccountDocument( depositAccountId, templateId, startDate, endDate, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Download deposit account document PDF * @param {string} depositAccountId The ID or encoded key of the deposit account. * @param {string} templateId The ID of the deposit product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getPdfDocument( depositAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ) { return DepositAccountDocumentsApiFp(this.configuration) .getPdfDocument(depositAccountId, templateId, startDate, endDate, options) .then((request) => request(this.axios, this.basePath)); } }