projectmanager-sdk
Version:
Software development kit for the ProjectManager.com API. for TypeScript
60 lines • 1.68 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 TaskTodoClient {
client;
/**
* Internal constructor for this client library
*/
constructor(client) {
this.client = client;
}
/**
* Retrieve a list of todos for a task
*
* @param taskId the id of the task
*/
getTodos(taskId) {
const url = `/api/data/tasks/${taskId}/todos`;
return this.client.request("get", url, null, null);
}
/**
* Create a todo for a task
*
* @param taskId the id of the task
* @param body the data for creating a todo
*/
createTodo(taskId, body) {
const url = `/api/data/tasks/${taskId}/todos`;
return this.client.request("post", url, null, body);
}
/**
* Update a todo for a task
*
* @param todoId the id of the todo
* @param body the data for updating a todo
*/
updateTodo(todoId, body) {
const url = `/api/data/tasks/todos/${todoId}`;
return this.client.request("put", url, null, body);
}
/**
* Remove a todo
*
* @param todoId the id of the todo
*/
deleteTodo(todoId) {
const url = `/api/data/tasks/todos/${todoId}`;
return this.client.request("delete", url, null, null);
}
}
//# sourceMappingURL=TaskTodoClient.js.map