Interface ProjectsApi

All Superinterfaces:
Api.Create<Project>, Api.Delete<Project>, Api.Get<Project>, Api.Simple<Project>
All Known Implementing Classes:
ProjectsApiImpl

public interface ProjectsApi extends Api.Simple<Project>
See Also:
  • Method Details

    • list

      List<Project> list(ProjectFilter filter)
      Return a list of projects, sorted by creation date, newest first. Use the filter object to filter the list.
      Parameters:
      filter - filtering options
      Returns:
      a (filtered) list of Projects
    • list

      Pagination<Project> list(ProjectFilter filter, int page, int perPage)
      Return a list of projects, sorted by creation date, newest first. Use the filter object to filter the list. Page and perPage allow controlling how many results to return.
      Parameters:
      filter - filtering options
      page - the page number
      perPage - how many results to return for one page. Max 100
      Returns:
      a (filtered) list of Projects
    • get

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

      Project create(Project projectCreationInfo)
      Create a new Project according to given creation information. Example:
       Project creationInfo = ImmutableProject.builder()
               .client(clientReference)
               .name(name)
               .billable(billable)
               .billBy(billingMethod)
               .budgetBy(budgetBy)
               .build();
       project = projectsApi.create(creationInfo);
       
      Specified by:
      create in interface Api.Create<Project>
      Parameters:
      projectCreationInfo - the creation options
      Returns:
      the newly created Project
    • update

      Project update(Reference<Project> projectReference, ProjectUpdateInfo toChange)
      Updates an existing Project with the properties set in ProjectUpdateInfo
      Parameters:
      projectReference - the existing project to be updated
      toChange - the properties to be updated
      Returns:
      the updated Project
    • delete

      void delete(Reference<Project> projectReference)
      Delete an existing Project. Careful with this API! It also deletes TimeEntries, Expenses and Retainers connected to this project. This will generate an email notification from Harvest.
      Specified by:
      delete in interface Api.Delete<Project>
      Parameters:
      projectReference - a reference to an existing Project to be deleted