Interface OpenProjectApiClient
-
@Role public interface OpenProjectApiClientDefines the methods that a OpenProject api client should implement.- Version:
- $Id$
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default com.fasterxml.jackson.databind.JsonNodecreateWorkPackage(String url, String jsonBody)Creates a work package in OpenProject.default PaginatedResult<Project>getAvailableProjects(String url, Integer offset, Integer pageSize, String filters)Retrieves a paginated list of available projects for creating work packages based on the specified page size and filter criteria from the current OpenProject configuration.default PaginatedResult<User>getAvailableUsers(String url, Integer offset, Integer pageSize, String filters)Retrieves a list of available users for creating a work package based on the specified page size and filter criteria from the current OpenProject configuration.PaginatedResult<Priority>getPriorities()Retrieves all available priorities from the current OpenProject configuration.PaginatedResult<Project>getProjects(Integer offset, Integer pageSize, String filters)Retrieves a paginated list of available projects based on the specified page size and filter criteria from the current OpenProject configuration.PaginatedResult<WorkPackage>getProjectWorkPackages(String project, Integer offset, Integer pageSize, String filters, String sortBy)Retrieves a list of available work packages from the current OpenProject configuration and specified project.PaginatedResult<Status>getStatuses()Retrieves all available statuses from the current OpenProject configuration.PaginatedResult<Type>getTypes()Retrieves all available types from the current OpenProject configuration.UserAvatargetUserAvatar(String userId)Retrieve the user avatar.PaginatedResult<User>getUsers(Integer offset, Integer pageSize, String filters)Retrieves a list of available users based on the specified page size and filter criteria from the current OpenProject configuration.PaginatedResult<WorkPackage>getWorkPackages(Integer offset, Integer pageSize, String filters, String sortBy)Retrieves a list of available work packages from the current OpenProject configuration.default com.fasterxml.jackson.databind.JsonNodegetWorkPackagesFormResponse(String jsonBody)Retrieves work packages form response.
-
-
-
Method Detail
-
getWorkPackages
PaginatedResult<WorkPackage> getWorkPackages(Integer offset, Integer pageSize, String filters, String sortBy) throws ProjectManagementException
Retrieves a list of available work packages from the current OpenProject configuration.- Parameters:
offset- the offset index from which to start retrieving work packages.pageSize- the maximum number of work packages to return.filters- optional filters to apply (e.g. query parameters encoded as a string).sortBy- optional sorting criteria to apply (e.g. field name and sort direction).- Returns:
- a
PaginatedResultcontaining the list ofWorkPackageand pagination metadata. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the work packages.
-
getProjectWorkPackages
PaginatedResult<WorkPackage> getProjectWorkPackages(String project, Integer offset, Integer pageSize, String filters, String sortBy) throws ProjectManagementException
Retrieves a list of available work packages from the current OpenProject configuration and specified project.- Parameters:
project- the project (project name or id) from which we want to retrieve the work packagesoffset- the offset index from which to start retrieving work packages.pageSize- the maximum number of work packages to return.filters- optional filters to apply (e.g. query parameters encoded as a string).sortBy- optional sorting criteria to apply (e.g. field name and sort direction).- Returns:
- a
PaginatedResultcontaining the list ofWorkPackageand pagination metadata. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the work packages.
-
getUsers
PaginatedResult<User> getUsers(Integer offset, Integer pageSize, String filters) throws ProjectManagementException
Retrieves a list of available users based on the specified page size and filter criteria from the current OpenProject configuration.- Parameters:
offset- the offset from which to start retrieving users.pageSize- the number of users to retrieve per page.filters- a JSON-formatted string representing filter criteria to apply to the request- Returns:
- a list of
User - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the users.
-
getAvailableUsers
default PaginatedResult<User> getAvailableUsers(String url, Integer offset, Integer pageSize, String filters) throws ProjectManagementException
Retrieves a list of available users for creating a work package based on the specified page size and filter criteria from the current OpenProject configuration.- Parameters:
url- the URL of the work package for which we want to retrieve the available users.offset- the offset from which to start retrieving users.pageSize- the number of users to retrieve per page.filters- a JSON-formatted string representing filter criteria to apply to the request- Returns:
- a list of
User - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the users.- Since:
- 1.1
-
getProjects
PaginatedResult<Project> getProjects(Integer offset, Integer pageSize, String filters) throws ProjectManagementException
Retrieves a paginated list of available projects based on the specified page size and filter criteria from the current OpenProject configuration.- Parameters:
offset- the offset from which to start retrieving projects.pageSize- the number of projects to retrieve per page.filters- a JSON-formatted string representing filter criteria to apply to the request.- Returns:
- a list of
Project. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the projects.
-
getAvailableProjects
default PaginatedResult<Project> getAvailableProjects(String url, Integer offset, Integer pageSize, String filters) throws ProjectManagementException
Retrieves a paginated list of available projects for creating work packages based on the specified page size and filter criteria from the current OpenProject configuration.- Parameters:
url- the URL of the work package for which we want to retrieve the available projects.offset- the offset from which to start retrieving projects.pageSize- the number of projects to retrieve per page.filters- a JSON-formatted string representing filter criteria to apply to the request.- Returns:
- a list of
Project. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the projects.- Since:
- 1.1
-
getTypes
PaginatedResult<Type> getTypes() throws ProjectManagementException
Retrieves all available types from the current OpenProject configuration.- Returns:
- a List of
Type. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the types.
-
getStatuses
PaginatedResult<Status> getStatuses() throws ProjectManagementException
Retrieves all available statuses from the current OpenProject configuration.- Returns:
- a List of
Status. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the statuses.
-
getPriorities
PaginatedResult<Priority> getPriorities() throws ProjectManagementException
Retrieves all available priorities from the current OpenProject configuration.- Returns:
- a List of
Priority. - Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the priorities.
-
getUserAvatar
UserAvatar getUserAvatar(String userId) throws ProjectManagementException
Retrieve the user avatar.- Parameters:
userId- the id of the user for which we want to retrieve the avatar.- Returns:
- the model containing the image stream and its content type.
- Throws:
ProjectManagementException- Since:
- 1.0-rc-5
-
getWorkPackagesFormResponse
default com.fasterxml.jackson.databind.JsonNode getWorkPackagesFormResponse(String jsonBody) throws ProjectManagementException
Retrieves work packages form response.- Parameters:
jsonBody- the json body.- Returns:
- the json node.
- Throws:
ProjectManagementException- if some error was encountered while trying to retrieve the work packages form- Since:
- 1.1
-
createWorkPackage
default com.fasterxml.jackson.databind.JsonNode createWorkPackage(String url, String jsonBody) throws ProjectManagementException
Creates a work package in OpenProject.- Parameters:
url- the URL to create the work package.jsonBody- the JSON body representing the work package to be created.- Returns:
- the created work package.
- Throws:
ProjectManagementException- if there was an issue during the creation process.- Since:
- 1.1
-
-