Class TasksApiImpl

Object
ch.aaap.harvestclient.impl.TasksApiImpl
All Implemented Interfaces:
Api.Create<Task>, Api.Delete<Task>, Api.Get<Task>, Api.Simple<Task>, TasksApi

public class TasksApiImpl extends Object implements TasksApi
  • Constructor Details

    • TasksApiImpl

      public TasksApiImpl(TaskService service)
  • Method Details

    • list

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

      public Pagination<Task> list(TaskFilter filter, int page, int perPage)
      Specified by:
      list in interface TasksApi
      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

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

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

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

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