Package ch.aaap.harvestclient.api
Interface ProjectsApi
- All Superinterfaces:
Api.Create<Project>
,Api.Delete<Project>
,Api.Get<Project>
,Api.Simple<Project>
- All Known Implementing Classes:
ProjectsApiImpl
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new Project according to given creation information.void
Delete an existing Project.list
(ProjectFilter filter) Return a list of projects, sorted by creation date, newest first.list
(ProjectFilter filter, int page, int perPage) Return a list of projects, sorted by creation date, newest first.update
(Reference<Project> projectReference, ProjectUpdateInfo toChange) Updates an existing Project with the properties set in ProjectUpdateInfo
-
Method Details
-
list
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
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 optionspage
- the page numberperPage
- how many results to return for one page. Max 100- Returns:
- a (filtered) list of Projects
-
get
-
create
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 interfaceApi.Create<Project>
- Parameters:
projectCreationInfo
- the creation options- Returns:
- the newly created Project
-
update
Updates an existing Project with the properties set in ProjectUpdateInfo- Parameters:
projectReference
- the existing project to be updatedtoChange
- the properties to be updated- Returns:
- the updated Project
-
delete
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 interfaceApi.Delete<Project>
- Parameters:
projectReference
- a reference to an existing Project to be deleted
-