Skip to content

Latest commit

 

History

History
95 lines (85 loc) · 3.18 KB

File metadata and controls

95 lines (85 loc) · 3.18 KB

Instantiate the required library class

$http = new \Romby\Box\Http\Adapters\GuzzleHttpAdapter(new \GuzzleHttp\Client())
$tasks = new \Romby\Box\Services\Tasks($http);
/* @param string      $token   the OAuth token.
 * @param int         $fileId  the file this task is for.
 * @param string|null $message an optional message to include with the task.
 * @param string|null $dueAt   the day at which this task is due.
 * @return array the new task.
 */
$tasks->create($token, $fileId, $message = null, $dueAt = null);
/* @param string $token the OAuth token.
 * @param int    $id    the ID of the task.
 * @return array the task.
 */
$tasks->get($token, $id);
/* @param string      $token   the OAuth token.
 * @param int         $id      the id of the task.
 * @param string|null $message an optional message to include with the task.
 * @param string|null $dueAt   the day at which this task is due.
 * @return array the updated task.
 */
$tasks->update($token, $id, $message = null, $dueAt = null);
/* @param string $token the OAuth token.
 * @param int    $id    the id of the task.
 * @return void
 */
$tasks->delete($token, $id);
/* @param string $token the OAuth token.
 * @param int    $id    the id of the task assignment.
 * @return array the task assignment.
 */
$tasks->getTaskAssignments($token, $id);
/* @param string $token    the OAuth token.
 * @param int    $taskId   the id of the task.
 * @param array  $assignTo the user to assign the task to.
 * @return array the new task assignment.
 */
$tasks->createTaskAssignment($token, $taskId, array $assignTo);
/* @param string $token the OAuth token.
 * @param int    $id    the id of the task assignment.
 * @return array the task assignment.
 */
$tasks->getTaskAssignment($token, $id);
/* @param string $token the OAuth token.
 * @param int    $id    the id of the task assignment.
 * @return void
 */
$tasks->deleteTaskAssignment($token, $id);
/* @param string $token           the OAuth token.
 * @param int    $id              the id of the task assignment.
 * @param string $message         a message from the assignee about this task
 * @param string $resolutionState can be completed, incomplete, approved, or rejected.
 * @return array the updated task assignment.
 */
$tasks->updateTaskAssignment($token, $id, $message, $resolutionState);