UNPKG

@adyen/api-library

Version:

The Adyen API Library for NodeJS enables you to work with Adyen APIs.

82 lines 4.06 kB
"use strict"; /* * 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 this class manually. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PlatformApi = void 0; const getJsonResponse_1 = __importDefault(require("../../helpers/getJsonResponse")); const service_1 = __importDefault(require("../../service")); const resource_1 = __importDefault(require("../resource")); const objectSerializer_1 = require("../../typings/balancePlatform/objectSerializer"); /** * API handler for PlatformApi */ class PlatformApi extends service_1.default { constructor(client) { super(client); this.API_BASEPATH = "https://balanceplatform-api-test.adyen.com/bcl/v2"; this.baseUrl = this.createBaseUrl(this.API_BASEPATH); } /** * @summary Get all account holders under a balance platform * @param id {@link string } The unique identifier of the balance platform. * @param requestOptions {@link IRequest.Options } * @param offset {@link number } The number of items that you want to skip. * @param limit {@link number } The number of items returned per page, maximum 100 items. By default, the response returns 10 items per page. * @return {@link PaginatedAccountHoldersResponse } */ async getAllAccountHoldersUnderBalancePlatform(id, offset, limit, requestOptions) { const endpoint = `${this.baseUrl}/balancePlatforms/{id}/accountHolders` .replace("{" + "id" + "}", encodeURIComponent(String(id))); const resource = new resource_1.default(this, endpoint); const hasDefinedQueryParams = offset !== null && offset !== void 0 ? offset : limit; if (hasDefinedQueryParams) { if (!requestOptions) requestOptions = {}; if (!requestOptions.params) requestOptions.params = {}; if (offset) requestOptions.params["offset"] = offset; if (limit) requestOptions.params["limit"] = limit; } const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" }); return objectSerializer_1.ObjectSerializer.deserialize(response, "PaginatedAccountHoldersResponse"); } /** * @summary Get all transaction rules for a balance platform * @param id {@link string } The unique identifier of the balance platform. * @param requestOptions {@link IRequest.Options } * @return {@link TransactionRulesResponse } */ async getAllTransactionRulesForBalancePlatform(id, requestOptions) { const endpoint = `${this.baseUrl}/balancePlatforms/{id}/transactionRules` .replace("{" + "id" + "}", encodeURIComponent(String(id))); const resource = new resource_1.default(this, endpoint); const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" }); return objectSerializer_1.ObjectSerializer.deserialize(response, "TransactionRulesResponse"); } /** * @summary Get a balance platform * @param id {@link string } The unique identifier of the balance platform. * @param requestOptions {@link IRequest.Options } * @return {@link BalancePlatform } */ async getBalancePlatform(id, requestOptions) { const endpoint = `${this.baseUrl}/balancePlatforms/{id}` .replace("{" + "id" + "}", encodeURIComponent(String(id))); const resource = new resource_1.default(this, endpoint); const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" }); return objectSerializer_1.ObjectSerializer.deserialize(response, "BalancePlatform"); } } exports.PlatformApi = PlatformApi; //# sourceMappingURL=platformApi.js.map