@phasesdk/api-client-for-economic
Version:
e-conomic REST API Library for Node.js is a powerful tool designed to simplify integration with the e-conomic platform for developers building Node.js applications. With this library, developers can effortlessly leverage the full functionality of the e-co
71 lines (70 loc) • 2.42 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const OpenApi_1 = __importDefault(require("../../OpenApi"));
const VERSION = "v22.0.0";
class ProjectGroups extends OpenApi_1.default {
getVersion() {
return this.version ? this.version : VERSION;
}
setVersion(version) {
this.version = version;
return this;
}
getUrlSegment() {
return "api/";
}
constructor(authToken) {
super(authToken);
this.version = "";
}
/**
* Use this endpoint to retrieve all Project Groups in bulk. Max number of items returned in a single call is 1000. Use the continuation cursor parameter to set the continuation cursor for retrieval of next set of data
*
* @see https://apis.e-conomic.com/redoc.html#tag/Project-Groups/operation/GetAllProjectGroups
*
* @param {number} cursorValue
* @returns {Promise<HttpResponse>}
*/
getAll(cursorValue = 0) {
const requestObj = {
method: "get",
url: `${this.getUrlSegment()}${this.getVersion()}/projectgroups?cursor=${cursorValue}`,
};
return this._httpRequest(requestObj);
}
/**
* This endpoint is to load a page of Project Groups.
*
* @see https://apis.e-conomic.com/redoc.html#tag/Project-Groups/operation/GetPageOfProjectGroups
*
* @param {number} offset
* @param {number} limit
* @returns {Promise<HttpResponse>}
*/
get(offset = 0, limit = 100) {
const requestObj = {
method: "get",
url: `${this.getUrlSegment()}${this.getVersion()}/projectgroups/paged?skippages=${offset}&pagesize=${limit}`,
};
return this._httpRequest(requestObj);
}
/**
* This endpoint is endpoint to load a single Project Group by id/number.
*
* @see https://apis.e-conomic.com/redoc.html#tag/Project-Groups/operation/GetProjectGroupById
*
* @param {number} id
* @returns {Promise<HttpResponse>}
*/
getFor(id) {
const requestObj = {
method: "get",
url: `${this.getUrlSegment()}${this.getVersion()}/projectgroups/${id}`,
};
return this._httpRequest(requestObj);
}
}
exports.default = ProjectGroups;