UNPKG

finerio-pfm-unnax

Version:

This SDK lets you connect to [Finerio PFM API Unnax](http://ec2-3-16-174-50.us-east-2.compute.amazonaws.com:8082/swagger-ui/index.html#/) in an easier way.

27 lines (26 loc) 842 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const models_1 = require("../models"); class FinancialEntitites { constructor(fcSdk) { this.fcSdk = fcSdk; this.path = "/financialEntities"; } processResponse(response) { return new models_1.FinancialEntity(response); } processListResponse(response) { if (!response.data) { return []; } return response.data.map((financialEntity) => new models_1.FinancialEntity(financialEntity)); } get(id) { return this.fcSdk.doGet(`${this.path}/${id}`, this.processResponse); } list(cursor) { const uri = `${this.path}${cursor ? "?cursor=" + cursor : ""}`; return this.fcSdk.doGet(uri, this.processListResponse); } } exports.default = FinancialEntitites;