projectmanager-sdk
Version:
Software development kit for the ProjectManager.com API. for TypeScript
76 lines • 3.27 kB
JavaScript
/**
* 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 TaskStatusClient {
client;
/**
* Internal constructor for this client library
*/
constructor(client) {
this.client = client;
}
/**
* Retrieves the list of TaskStatus levels for a specific Project within your Workspace.
*
* A TaskStatus is a named status level used by your business to determine how to measure the
* progress of Tasks. You can define your own named status levels that are appropriate for
* your business and determine which status levels are considered done.
*
* @param projectId The unique identifier of the Project to retrieve TaskStatuses
*/
retrieveTaskStatuses(projectId) {
const url = `/api/data/projects/${projectId}/tasks/statuses`;
return this.client.request("get", url, null, null);
}
/**
* Creates a new TaskStatus level for a specific Project within your Workspace.
*
* A TaskStatus is a named status level used by your business to determine how to measure the
* progress of Tasks. You can define your own named status levels that are appropriate for
* your business.
*
* @param projectId The unique identifier of the Project for the new TaskStatus
* @param body Information about the new TaskStatus level to create within this Project
*/
createTaskStatus(projectId, body) {
const url = `/api/data/projects/${projectId}/tasks/statuses`;
return this.client.request("post", url, null, body);
}
/**
* Updates an existing TaskStatus level for a specific Project within your Workspace.
*
* A TaskStatus is a named status level used by your business to determine how to measure the
* progress of Tasks. You can define your own named status levels that are appropriate for
* your business.
*
* @param projectId The unique identifier of the Project for the new TaskStatus
* @param body Information about the existing TaskStatus level to update within this Project
*/
updateTaskStatus(projectId, body) {
const url = `/api/data/projects/${projectId}/tasks/statuses`;
return this.client.request("put", url, null, body);
}
/**
* The endpoint is used to delete a TaskStatus.
*
* You will not be able to delete a TaskStatus if there are tasks that have been assigned to this status level
* or if the TaskStatus is the default status level.
*
* @param projectId The unique identifier of the Project for the TaskStatus level to delete
* @param taskStatusId The Id of the TaskStatus level to be removed.
*/
deleteTaskStatus(projectId, taskStatusId) {
const url = `/api/data/projects/${projectId}/tasks/statuses/${taskStatusId}`;
return this.client.request("delete", url, null, null);
}
}
//# sourceMappingURL=TaskStatusClient.js.map