UNPKG

projectmanager-sdk

Version:

Software development kit for the ProjectManager.com API. for TypeScript

62 lines 2.01 kB
/** * ProjectManager API for TypeScript * * (c) ProjectManager.com, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @author ProjectManager.com <support@projectmanager.com> * @copyright ProjectManager.com, Inc. * @link https://github.com/projectmgr/projectmanager-sdk-typescript */ export class ProjectChargeCodeClient { client; /** * Internal constructor for this client library */ constructor(client) { this.client = client; } /** * Retrieve all defined ChargeCodes that can be used when creating Projects. * * A ChargeCode is a code used to identify costs within your Projects. Each ChargeCode has * a name and a unique identifier. ChargeCodes are defined per Workspace and are shared * among Projects. * */ retrieveChargeCodes() { const url = `/api/data/projects/chargecodes`; return this.client.request("get", url, null, null); } /** * Create a project charge code * * @param body The data to create the charge code */ createProjectChargeCode(body) { const url = `/api/data/projects/chargecodes`; return this.client.request("post", url, null, body); } /** * Update a project charge code * * @param chargeCodeId The id of the charge code * @param body The data to update the charge code */ updateProjectChargeCode(chargeCodeId, body) { const url = `/api/data/projects/chargecodes/${chargeCodeId}`; return this.client.request("put", url, null, body); } /** * Delete a project charge code * * @param chargeCodeId The id of the charge code */ deleteProjectChargeCode(chargeCodeId) { const url = `/api/data/projects/chargecodes/${chargeCodeId}`; return this.client.request("delete", url, null, null); } } //# sourceMappingURL=ProjectChargeCodeClient.js.map