UNPKG

@airwallex/node-sdk

Version:

Airwallex Node.js SDK

118 lines 5.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReconciliationApi = void 0; const apiClient_1 = require("../../client/apiClient"); const dataParser_1 = require("../../utils/dataParser"); const pagedQueryResultDtoOfTCBalanceDto_1 = require("../../model/pagedQueryResultDtoOfTCBalanceDto"); const pagedQueryResultDtoOfTCTransactionDto_1 = require("../../model/pagedQueryResultDtoOfTCTransactionDto"); class ReconciliationApi { async queryBalancesByReq(requests, { not_found_as_error }, options = {}) { const localVarPath = '/api/v1/tc/balances/requests'; const { headers, timeout, responseType } = options; let localVarHeaderParams = Object.assign({}, headers ? headers : {}); if (requests === null || requests === undefined) { throw new Error('Required parameter requests was null or undefined when calling queryBalancesByReq.'); } let queryParams = {}; if (not_found_as_error !== undefined) { queryParams['not_found_as_error'] = not_found_as_error; } const data = await apiClient_1.apiClient.post(localVarPath, { headers: localVarHeaderParams, params: queryParams, timeout, responseType, }, requests); const typeName = pagedQueryResultDtoOfTCBalanceDto_1.PagedQueryResultDtoOfTCBalanceDto.discriminator; return (0, dataParser_1.parseDataToType)(data, typeName); } async queryBalances({ client_request_id, currency, from_posted_at, page_num, page_size, to_posted_at, type }, options = {}) { const localVarPath = '/api/v1/tc/balances'; const { headers, timeout, responseType } = options; let localVarHeaderParams = Object.assign({}, headers ? headers : {}); let queryParams = {}; if (client_request_id !== undefined) { queryParams['client_request_id'] = client_request_id; } if (currency !== undefined) { queryParams['currency'] = currency; } if (from_posted_at !== undefined) { queryParams['from_posted_at'] = from_posted_at; } if (page_num !== undefined) { queryParams['page_num'] = page_num; } if (page_size !== undefined) { queryParams['page_size'] = page_size; } if (to_posted_at !== undefined) { queryParams['to_posted_at'] = to_posted_at; } if (type !== undefined) { queryParams['type'] = type; } const data = await apiClient_1.apiClient.get(localVarPath, { headers: localVarHeaderParams, params: queryParams, timeout, responseType, }); const typeName = pagedQueryResultDtoOfTCBalanceDto_1.PagedQueryResultDtoOfTCBalanceDto.discriminator; return (0, dataParser_1.parseDataToType)(data, typeName); } async queryTransactionsByReq(requests, { not_found_as_error }, options = {}) { const localVarPath = '/api/v1/tc/transactions/requests'; const { headers, timeout, responseType } = options; let localVarHeaderParams = Object.assign({}, headers ? headers : {}); if (requests === null || requests === undefined) { throw new Error('Required parameter requests was null or undefined when calling queryTransactionsByReq.'); } let queryParams = {}; if (not_found_as_error !== undefined) { queryParams['not_found_as_error'] = not_found_as_error; } const data = await apiClient_1.apiClient.post(localVarPath, { headers: localVarHeaderParams, params: queryParams, timeout, responseType, }, requests); const typeName = pagedQueryResultDtoOfTCTransactionDto_1.PagedQueryResultDtoOfTCTransactionDto.discriminator; return (0, dataParser_1.parseDataToType)(data, typeName); } async queryTransactions({ client_request_id, from_created_at, page_num, page_size, to_created_at, type }, options = {}) { const localVarPath = '/api/v1/tc/transactions'; const { headers, timeout, responseType } = options; let localVarHeaderParams = Object.assign({}, headers ? headers : {}); let queryParams = {}; if (client_request_id !== undefined) { queryParams['client_request_id'] = client_request_id; } if (from_created_at !== undefined) { queryParams['from_created_at'] = from_created_at; } if (page_num !== undefined) { queryParams['page_num'] = page_num; } if (page_size !== undefined) { queryParams['page_size'] = page_size; } if (to_created_at !== undefined) { queryParams['to_created_at'] = to_created_at; } if (type !== undefined) { queryParams['type'] = type; } const data = await apiClient_1.apiClient.get(localVarPath, { headers: localVarHeaderParams, params: queryParams, timeout, responseType, }); const typeName = pagedQueryResultDtoOfTCTransactionDto_1.PagedQueryResultDtoOfTCTransactionDto.discriminator; return (0, dataParser_1.parseDataToType)(data, typeName); } } exports.ReconciliationApi = ReconciliationApi; //# sourceMappingURL=reconciliationApi.js.map