Interface TasksApi

All Superinterfaces:
Api.Create<Task>, Api.Delete<Task>, Api.Get<Task>, Api.Simple<Task>
All Known Implementing Classes:
TasksApiImpl

public interface TasksApi extends Api.Simple<Task>
See Also:
  • Method Details

    • list

      List<Task> list(TaskFilter filter)
      Parameters:
      filter - filtering options
      Returns:
      a list of all Tasks in the account, sorted by creation date, newest first.
    • list

      Pagination<Task> list(TaskFilter filter, int page, int perPage)
      Parameters:
      filter - filtering options
      page - the page number
      perPage - how many results to return for one page. Max 100
      Returns:
      a list of all Tasks in the account, sorted by creation date, newest first.
    • get

      Task get(Reference<Task> taskReference)
      Return an existing Task.
      Specified by:
      get in interface Api.Get<Task>
      Parameters:
      taskReference - a reference to an existing Task
      Returns:
      the full Task object
    • create

      Task create(Task creationInfo)
      Create a new Task. Example:
       Task task = harvest.tasks().create(ImmutableTask.builder()
               .name("task name")
               .build());
       
      Specified by:
      create in interface Api.Create<Task>
      Parameters:
      creationInfo - creation information
      Returns:
      the created Task
    • update

      Task update(Reference<Task> taskReference, TaskUpdateInfo toChange)
      Updates the specific task by setting the values of the parameters passed. Any parameters not provided will be left unchanged
      Parameters:
      taskReference - An existing Task to be updated
      toChange - the changes to be performed
      Returns:
      the updated Task
    • delete

      void delete(Reference<Task> taskReference)
      Delete an existing Task. Only possible if no time entries are associated with it
      Specified by:
      delete in interface Api.Delete<Task>
      Parameters:
      taskReference - a reference to the Task to be deleted