diff --git a/README.md b/README.md index 0be12719..4a9c261f 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ To utilize GitLab4J™ API in your Java project, simply add the following de ```java dependencies { ... - implementation group: 'org.gitlab4j', name: 'gitlab4j-api', version: '6.0.0-rc.7' + implementation group: 'org.gitlab4j', name: 'gitlab4j-api', version: '6.0.0-rc.8' } ``` @@ -40,7 +40,7 @@ dependencies { org.gitlab4j gitlab4j-api - 6.0.0-rc.7 + 6.0.0-rc.8 ``` @@ -51,7 +51,7 @@ dependencies { Just add this line at the top of your script: ```java -//DEPS org.gitlab4j:gitlab4j-api:6.0.0-rc.7 +//DEPS org.gitlab4j:gitlab4j-api:6.0.0-rc.8 ``` **Ivy and SBT**
@@ -146,7 +146,7 @@ Those projects might want to use the Jackson-based model classes, and implement ```java dependencies { ... - implementation 'org.gitlab4j:gitlab4j-models:6.0.0-rc.7' + implementation 'org.gitlab4j:gitlab4j-models:6.0.0-rc.8' } ``` @@ -155,7 +155,7 @@ dependencies { org.gitlab4j gitlab4j-models - 6.0.0-rc.7 + 6.0.0-rc.8 ``` diff --git a/gitlab4j-api/src/main/java/org/gitlab4j/api/BoardsApi.java b/gitlab4j-api/src/main/java/org/gitlab4j/api/BoardsApi.java index 2cf0fe78..0390f152 100644 --- a/gitlab4j-api/src/main/java/org/gitlab4j/api/BoardsApi.java +++ b/gitlab4j-api/src/main/java/org/gitlab4j/api/BoardsApi.java @@ -32,9 +32,11 @@ public BoardsApi(GitLabApi gitLabApi) { * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance * @return a list of project's issue boards * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #getProjectIssueBoards(Object)} instead */ + @Deprecated public List getBoards(Object projectIdOrPath) throws GitLabApiException { - return (getBoards(projectIdOrPath, getDefaultPerPage()).all()); + return getProjectIssueBoards(projectIdOrPath); } /** @@ -47,73 +49,793 @@ public List getBoards(Object projectIdOrPath) throws GitLabApiException { * @param perPage the number of items per page * @return a list of project's Boards in the specified range * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #getProjectIssueBoards(Object, int, int)} instead */ + @Deprecated public List getBoards(Object projectIdOrPath, int page, int perPage) throws GitLabApiException { + return getProjectIssueBoards(projectIdOrPath); + } + + /** + * Get a Pager of all issue boards for the specified project. + * + *
GitLab Endpoint: GET /projects/:id/boards
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param itemsPerPage the number of items per page + * @return a Pager of project's issue boards + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #getProjectIssueBoards(Object, int)} instead + */ + @Deprecated + public Pager getBoards(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException { + return getProjectIssueBoards(projectIdOrPath, itemsPerPage); + } + + /** + * Get a Stream of all issue boards for the specified project. + * + *
GitLab Endpoint: GET /projects/:id/boards
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @return a Stream of project's issue boards + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #getProjectIssueBoardsStream(Object)} instead + */ + @Deprecated + public Stream getBoardsStream(Object projectIdOrPath) throws GitLabApiException { + return getProjectIssueBoardsStream(projectIdOrPath); + } + + /** + * Get a single issue board. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @return a Board instance for the specified board ID + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #getProjectIssueBoard(Object, Long)} instead + */ + @Deprecated + public Board getBoard(Object projectIdOrPath, Long boardId) throws GitLabApiException { + return getProjectIssueBoard(projectIdOrPath, boardId); + } + + /** + * Get an issue board as an Optional instance. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @return the Board instance for the specified board ID as an Optional instance + * @deprecated use {@link #getOptionalProjectIssueBoard(Object, Long)} instead + */ + @Deprecated + public Optional getOptionalBoard(Object projectIdOrPath, Long boardId) { + return getOptionalProjectIssueBoard(projectIdOrPath, boardId); + } + + /** + * Creates a new Issue Board. + * + *
GitLab Endpoint: POST /projects/:id/boards
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param name the name for the new board + * @return the created Board instance + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #createProjectIssueBoard(Object, String)} instead + */ + @Deprecated + public Board createBoard(Object projectIdOrPath, String name) throws GitLabApiException { + return createProjectIssueBoard(projectIdOrPath, name); + } + + /** + * Updates an existing Issue Board. + * + *
GitLab Endpoint: PUT /projects/:id/boards/:board_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required + * @param boardId the ID of the board, required + * @param name the new name of the board, optional (can be null) + * @param hideBacklogList hide the Open list, optional (can be null) + * @param hideClosedList hide the Closed list, optional (can be null) + * @param assigneeId the assignee the board should be scoped to, optional (can be null) + * @param milestoneId the milestone the board should be scoped to, optional (can be null) + * @param labels a comma-separated list of label names which the board should be scoped to, optional (can be null) + * @param weight the weight range from 0 to 9, to which the board should be scoped to, optional (can be null) + * @return the updated Board instance + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #updateProjectIssueBoard(Object, Long, String, Boolean, Boolean, Long, Long, String, Integer)} instead + */ + @Deprecated + public Board updateBoard( + Object projectIdOrPath, + Long boardId, + String name, + Boolean hideBacklogList, + Boolean hideClosedList, + Long assigneeId, + Long milestoneId, + String labels, + Integer weight) + throws GitLabApiException { + return updateProjectIssueBoard( + projectIdOrPath, + boardId, + name, + hideBacklogList, + hideClosedList, + assigneeId, + milestoneId, + labels, + weight); + } + + /** + * Soft deletes an existing Issue Board. + * + *
GitLab Endpoint: DELETE /projects/:id/boards/:board_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #deleteBoard(Object, Long)} instead + */ + @Deprecated + public void deleteBoard(Object projectIdOrPath, Long boardId) throws GitLabApiException { + delete(Response.Status.NO_CONTENT, null, "projects", getProjectIdOrPath(projectIdOrPath), "boards", boardId); + } + + /** + * Get a list of the board’s lists. Does not include open and closed lists. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @return a list of the issue board's lists + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #getProjectIssueBoardLists(Object, Long)} instead + */ + @Deprecated + public List getBoardLists(Object projectIdOrPath, Long boardId) throws GitLabApiException { + return getProjectIssueBoardLists(projectIdOrPath, boardId); + } + + /** + * Get a list of the board’s lists for the specified project to using the specified page and per page setting. + * Does not include open and closed lists. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param page the page to get + * @param perPage the number of Boards per page + * @return a list of the issue board's lists in the specified range + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #getProjectIssueBoardLists(Object, Long, int, int)} instead + */ + @Deprecated + public List getBoardLists(Object projectIdOrPath, Long boardId, int page, int perPage) + throws GitLabApiException { + return getProjectIssueBoardLists(projectIdOrPath, boardId, page, perPage); + } + + /** + * Get a Pager of the board’s lists. Does not include open and closed lists. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param itemsPerPage the number of Board instances that will be fetched per page + * @return a Pager of the issue board's lists + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #getProjectIssueBoardLists(Object, Long, int)} instead + */ + @Deprecated + public Pager getBoardLists(Object projectIdOrPath, Long boardId, int itemsPerPage) + throws GitLabApiException { + return getProjectIssueBoardLists(projectIdOrPath, boardId, itemsPerPage); + } + + /** + * Get a Stream of the board’s lists. Does not include open and closed lists. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @return a Stream of the issue board's lists + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #getProjectIssueBoardsListsStream(Object, Long)} instead + */ + @Deprecated + public Stream getBoardsListsStream(Object projectIdOrPath, Long boardId) throws GitLabApiException { + return getProjectIssueBoardsListsStream(projectIdOrPath, boardId); + } + + /** + * Get a single issue board list. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists/:list_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param listId the ID of the board lists to get + * @return a BoardList instance for the specified board ID and list ID + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #getProjectIssueBoardList(Object, Long, Long)} instead + */ + @Deprecated + public BoardList getBoardList(Object projectIdOrPath, Long boardId, Long listId) throws GitLabApiException { + return getProjectIssueBoardList(projectIdOrPath, boardId, listId); + } + + /** + * Get a single issue board list as an Optional instance. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists/:list_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param listId the ID of the board lists to get + * @return a BoardList instance for the specified board ID and list ID as an Optional instance + * @deprecated use {@link #getOptionalProjectIssueBoardList(Object, Long, Long)} instead + */ + @Deprecated + public Optional getOptionalBoardList(Object projectIdOrPath, Long boardId, Long listId) { + return getOptionalProjectIssueBoardList(projectIdOrPath, boardId, listId); + } + + /** + * Creates a new Issue Board list. + * + *
GitLab Endpoint: POST /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param labelId the ID of the label, optional (can be null) + * @param assigneeId The ID of a user. Premium and Ultimate only, optional (can be null) + * @param milestoneId The ID of a milestone. Premium and Ultimate only, optional (can be null) + * @param iterationId The ID of a milestone. Premium and Ultimate only, optional (can be null) + * @return the created BoardList instance + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #createProjectIssueBoardList(Object, Long, Long, Long, Long, Long)} instead + */ + @Deprecated + public BoardList createBoardList( + Object projectIdOrPath, Long boardId, Long labelId, Long assigneeId, Long milestoneId, Long iterationId) + throws GitLabApiException { + return createProjectIssueBoardList(projectIdOrPath, boardId, labelId, assigneeId, milestoneId, iterationId); + } + + /** + * Creates a new Issue Board list. + * + *
GitLab Endpoint: POST /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param labelId the ID of the label + * @return the created BoardList instance + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #createProjectIssueBoardList(Object, Long, Long, Long, Long, Long)} instead + */ + @Deprecated + public BoardList createBoardList(Object projectIdOrPath, Long boardId, Long labelId) throws GitLabApiException { + return createProjectIssueBoardList(projectIdOrPath, boardId, labelId, null, null, null); + } + + /** + * Updates an existing Issue Board list. This call is used to change list position. + * + *
GitLab Endpoint: PUT /projects/:id/boards/:board_id/lists/:list_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param listId the ID of the list + * @param position the new position for the list + * @return the updated BoardList instance + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #updateProjectIssueBoardList(Object, Long, Long, Integer)} instead + */ + @Deprecated + public BoardList updateBoardList(Object projectIdOrPath, Long boardId, Long listId, Integer position) + throws GitLabApiException { + return updateProjectIssueBoardList(projectIdOrPath, boardId, listId, position); + } + + /** + * Soft deletes an existing Issue Board list. Only for admins and project owners. + * + *
GitLab Endpoint: DELETE /projects/:id/boards/:board_id/lists/:list_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param listId the ID of the list + * @throws GitLabApiException if any exception occurs + * @deprecated use {@link #deleteProjectIssueBoardList(Object, Long, Long)} instead + */ + @Deprecated + public void deleteBoardList(Object projectIdOrPath, Long boardId, Long listId) throws GitLabApiException { + deleteProjectIssueBoardList(projectIdOrPath, boardId, listId); + } + + /** + * Lists Issue Boards in the given project. + * + *
GitLab Endpoint: GET /projects/:id/boards
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @return a list of project's issue boards + * @throws GitLabApiException if any exception occurs + */ + public List getProjectIssueBoards(Object projectIdOrPath) throws GitLabApiException { + return (getProjectIssueBoards(projectIdOrPath, getDefaultPerPage()).all()); + } + + /** + * Get all issue boards for the specified project using the specified page and per page setting + * + *
GitLab Endpoint: GET /projects/:id/boards
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param page the page to get + * @param perPage the number of items per page + * @return a list of project's Boards in the specified range + * @throws GitLabApiException if any exception occurs + */ + public List getProjectIssueBoards(Object projectIdOrPath, int page, int perPage) throws GitLabApiException { + Response response = get( + jakarta.ws.rs.core.Response.Status.OK, + getPageQueryParams(page, perPage), + "projects", + getProjectIdOrPath(projectIdOrPath), + "boards"); + return (response.readEntity(new GenericType>() {})); + } + + /** + * Get a Pager of all issue boards for the specified project. + * + *
GitLab Endpoint: GET /projects/:id/boards
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param itemsPerPage the number of items per page + * @return a Pager of project's issue boards + * @throws GitLabApiException if any exception occurs + */ + public Pager getProjectIssueBoards(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException { + return (new Pager( + this, Board.class, itemsPerPage, null, "projects", getProjectIdOrPath(projectIdOrPath), "boards")); + } + + /** + * Get a Stream of all issue boards for the specified project. + * + *
GitLab Endpoint: GET /projects/:id/boards
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @return a Stream of project's issue boards + * @throws GitLabApiException if any exception occurs + */ + public Stream getProjectIssueBoardsStream(Object projectIdOrPath) throws GitLabApiException { + return (getProjectIssueBoards(projectIdOrPath, getDefaultPerPage()).stream()); + } + + /** + * Get a single issue board. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @return a Board instance for the specified board ID + * @throws GitLabApiException if any exception occurs + */ + public Board getProjectIssueBoard(Object projectIdOrPath, Long boardId) throws GitLabApiException { + Response response = + get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "boards", boardId); + return (response.readEntity(Board.class)); + } + + /** + * Get an issue board as an Optional instance. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @return the Board instance for the specified board ID as an Optional instance + */ + public Optional getOptionalProjectIssueBoard(Object projectIdOrPath, Long boardId) { + try { + return (Optional.ofNullable(getProjectIssueBoard(projectIdOrPath, boardId))); + } catch (GitLabApiException glae) { + return (GitLabApi.createOptionalFromException(glae)); + } + } + + /** + * Creates a new Issue Board. + * + *
GitLab Endpoint: POST /projects/:id/boards
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param name the name for the new board + * @return the created Board instance + * @throws GitLabApiException if any exception occurs + */ + public Board createProjectIssueBoard(Object projectIdOrPath, String name) throws GitLabApiException { + GitLabApiForm formData = new GitLabApiForm().withParam("name", name, true); + Response response = post( + Response.Status.CREATED, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "boards"); + return (response.readEntity(Board.class)); + } + + /** + * Updates an existing Issue Board. + * + *
GitLab Endpoint: PUT /projects/:id/boards/:board_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required + * @param boardId the ID of the board, required + * @param name the new name of the board, optional (can be null) + * @param hideBacklogList hide the Open list, optional (can be null) + * @param hideClosedList hide the Closed list, optional (can be null) + * @param assigneeId the assignee the board should be scoped to, optional (can be null) + * @param milestoneId the milestone the board should be scoped to, optional (can be null) + * @param labels a comma-separated list of label names which the board should be scoped to, optional (can be null) + * @param weight the weight range from 0 to 9, to which the board should be scoped to, optional (can be null) + * @return the updated Board instance + * @throws GitLabApiException if any exception occurs + */ + public Board updateProjectIssueBoard( + Object projectIdOrPath, + Long boardId, + String name, + Boolean hideBacklogList, + Boolean hideClosedList, + Long assigneeId, + Long milestoneId, + String labels, + Integer weight) + throws GitLabApiException { + GitLabApiForm formData = new GitLabApiForm() + .withParam("name", name) + .withParam("hide_backlog_list", hideBacklogList) + .withParam("hide_closed_list", hideClosedList) + .withParam("assignee_id", assigneeId) + .withParam("milestone_id", milestoneId) + .withParam("labels", labels) + .withParam("weight", weight); + + Response response = put( + Response.Status.OK, + formData.asMap(), + "projects", + getProjectIdOrPath(projectIdOrPath), + "boards", + boardId); + return (response.readEntity(Board.class)); + } + + /** + * Soft deletes an existing Issue Board. + * + *
GitLab Endpoint: DELETE /projects/:id/boards/:board_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @throws GitLabApiException if any exception occurs + */ + public void deleteProjectIssueBoard(Object projectIdOrPath, Long boardId) throws GitLabApiException { + delete(Response.Status.NO_CONTENT, null, "projects", getProjectIdOrPath(projectIdOrPath), "boards", boardId); + } + + /** + * Get a list of the board’s lists. Does not include open and closed lists. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @return a list of the issue board's lists + * @throws GitLabApiException if any exception occurs + */ + public List getProjectIssueBoardLists(Object projectIdOrPath, Long boardId) throws GitLabApiException { + return (getProjectIssueBoardLists(projectIdOrPath, boardId, getDefaultPerPage()) + .all()); + } + + /** + * Get a list of the board’s lists for the specified project to using the specified page and per page setting. + * Does not include open and closed lists. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param page the page to get + * @param perPage the number of Boards per page + * @return a list of the issue board's lists in the specified range + * @throws GitLabApiException if any exception occurs + */ + public List getProjectIssueBoardLists(Object projectIdOrPath, Long boardId, int page, int perPage) + throws GitLabApiException { + Response response = get( + jakarta.ws.rs.core.Response.Status.OK, + getPageQueryParams(page, perPage), + "projects", + getProjectIdOrPath(projectIdOrPath), + "boards", + boardId, + "lists"); + return (response.readEntity(new GenericType>() {})); + } + + /** + * Get a Pager of the board’s lists. Does not include open and closed lists. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param itemsPerPage the number of Board instances that will be fetched per page + * @return a Pager of the issue board's lists + * @throws GitLabApiException if any exception occurs + */ + public Pager getProjectIssueBoardLists(Object projectIdOrPath, Long boardId, int itemsPerPage) + throws GitLabApiException { + return (new Pager( + this, + BoardList.class, + itemsPerPage, + null, + "projects", + getProjectIdOrPath(projectIdOrPath), + "boards", + boardId, + "lists")); + } + + /** + * Get a Stream of the board’s lists. Does not include open and closed lists. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @return a Stream of the issue board's lists + * @throws GitLabApiException if any exception occurs + */ + public Stream getProjectIssueBoardsListsStream(Object projectIdOrPath, Long boardId) + throws GitLabApiException { + return (getProjectIssueBoardLists(projectIdOrPath, boardId, getDefaultPerPage()).stream()); + } + + /** + * Get a single issue board list. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists/:list_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param listId the ID of the board lists to get + * @return a BoardList instance for the specified board ID and list ID + * @throws GitLabApiException if any exception occurs + */ + public BoardList getProjectIssueBoardList(Object projectIdOrPath, Long boardId, Long listId) + throws GitLabApiException { + Response response = get( + Response.Status.OK, + null, + "projects", + getProjectIdOrPath(projectIdOrPath), + "boards", + boardId, + "lists", + listId); + return (response.readEntity(BoardList.class)); + } + + /** + * Get a single issue board list as an Optional instance. + * + *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists/:list_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param listId the ID of the board lists to get + * @return a BoardList instance for the specified board ID and list ID as an Optional instance + */ + public Optional getOptionalProjectIssueBoardList(Object projectIdOrPath, Long boardId, Long listId) { + try { + return (Optional.ofNullable(getProjectIssueBoardList(projectIdOrPath, boardId, listId))); + } catch (GitLabApiException glae) { + return (GitLabApi.createOptionalFromException(glae)); + } + } + + /** + * Creates a new Issue Board list. + * + *
GitLab Endpoint: POST /projects/:id/boards/:board_id/lists
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param labelId the ID of the label, optional (can be null) + * @param assigneeId The ID of a user. Premium and Ultimate only, optional (can be null) + * @param milestoneId The ID of a milestone. Premium and Ultimate only, optional (can be null) + * @param iterationId The ID of a milestone. Premium and Ultimate only, optional (can be null) + * @return the created BoardList instance + * @throws GitLabApiException if any exception occurs + */ + public BoardList createProjectIssueBoardList( + Object projectIdOrPath, Long boardId, Long labelId, Long assigneeId, Long milestoneId, Long iterationId) + throws GitLabApiException { + GitLabApiForm formData = new GitLabApiForm() + .withParam("label_id", labelId) + .withParam("assignee_id", assigneeId) + .withParam("milestone_id", milestoneId) + .withParam("iteration_id", iterationId); + Response response = post( + Response.Status.CREATED, + formData, + "projects", + getProjectIdOrPath(projectIdOrPath), + "boards", + boardId, + "lists"); + return (response.readEntity(BoardList.class)); + } + + /** + * Updates an existing Issue Board list. This call is used to change list position. + * + *
GitLab Endpoint: PUT /projects/:id/boards/:board_id/lists/:list_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param listId the ID of the list + * @param position the new position for the list + * @return the updated BoardList instance + * @throws GitLabApiException if any exception occurs + */ + public BoardList updateProjectIssueBoardList(Object projectIdOrPath, Long boardId, Long listId, Integer position) + throws GitLabApiException { + GitLabApiForm formData = new GitLabApiForm().withParam("position", position, true); + Response response = putWithFormData( + Response.Status.OK, + formData, + "projects", + getProjectIdOrPath(projectIdOrPath), + "boards", + boardId, + "lists", + listId); + return (response.readEntity(BoardList.class)); + } + + /** + * Soft deletes an existing Issue Board list. Only for admins and project owners. + * + *
GitLab Endpoint: DELETE /projects/:id/boards/:board_id/lists/:list_id
+ * + * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param boardId the ID of the board + * @param listId the ID of the list + * @throws GitLabApiException if any exception occurs + */ + public void deleteProjectIssueBoardList(Object projectIdOrPath, Long boardId, Long listId) + throws GitLabApiException { + delete( + Response.Status.NO_CONTENT, + null, + "projects", + getProjectIdOrPath(projectIdOrPath), + "boards", + boardId, + "lists", + listId); + } + + /** + * Lists Issue Boards in the given group. + * + *
GitLab Endpoint: GET /groups/:id/boards
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @return a list of group's issue boards + * @throws GitLabApiException if any exception occurs + */ + public List getGroupIssueBoards(Object groupIdOrPath) throws GitLabApiException { + return (getGroupIssueBoards(groupIdOrPath, getDefaultPerPage()).all()); + } + + /** + * Get all issue boards for the specified group using the specified page and per page setting + * + *
GitLab Endpoint: GET /groups/:id/boards
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param page the page to get + * @param perPage the number of items per page + * @return a list of group's Boards in the specified range + * @throws GitLabApiException if any exception occurs + */ + public List getGroupIssueBoards(Object groupIdOrPath, int page, int perPage) throws GitLabApiException { Response response = get( jakarta.ws.rs.core.Response.Status.OK, getPageQueryParams(page, perPage), - "projects", - getProjectIdOrPath(projectIdOrPath), + "groups", + getGroupIdOrPath(groupIdOrPath), "boards"); return (response.readEntity(new GenericType>() {})); } /** - * Get a Pager of all issue boards for the specified project. + * Get a Pager of all issue boards for the specified group. * - *
GitLab Endpoint: GET /projects/:id/boards
+ *
GitLab Endpoint: GET /groups/:id/boards
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param itemsPerPage the number of items per page - * @return a Pager of project's issue boards + * @return a Pager of group's issue boards * @throws GitLabApiException if any exception occurs */ - public Pager getBoards(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException { + public Pager getGroupIssueBoards(Object groupIdOrPath, int itemsPerPage) throws GitLabApiException { return (new Pager( - this, Board.class, itemsPerPage, null, "projects", getProjectIdOrPath(projectIdOrPath), "boards")); + this, Board.class, itemsPerPage, null, "groups", getGroupIdOrPath(groupIdOrPath), "boards")); } /** - * Get a Stream of all issue boards for the specified project. + * Get a Stream of all issue boards for the specified group. * - *
GitLab Endpoint: GET /projects/:id/boards
+ *
GitLab Endpoint: GET /groups/:id/boards
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance - * @return a Stream of project's issue boards + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @return a Stream of group's issue boards * @throws GitLabApiException if any exception occurs */ - public Stream getBoardsStream(Object projectIdOrPath) throws GitLabApiException { - return (getBoards(projectIdOrPath, getDefaultPerPage()).stream()); + public Stream getGroupIssueBoardsStream(Object groupIdOrPath) throws GitLabApiException { + return (getGroupIssueBoards(groupIdOrPath, getDefaultPerPage()).stream()); } /** * Get a single issue board. * - *
GitLab Endpoint: GET /projects/:id/boards/:board_id
+ *
GitLab Endpoint: GET /groups/:id/boards/:board_id
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @return a Board instance for the specified board ID * @throws GitLabApiException if any exception occurs */ - public Board getBoard(Object projectIdOrPath, Long boardId) throws GitLabApiException { - Response response = - get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "boards", boardId); + public Board getGroupIssueBoard(Object groupIdOrPath, Long boardId) throws GitLabApiException { + Response response = get(Response.Status.OK, null, "groups", getGroupIdOrPath(groupIdOrPath), "boards", boardId); return (response.readEntity(Board.class)); } /** * Get an issue board as an Optional instance. * - *
GitLab Endpoint: GET /projects/:id/boards/:board_id
+ *
GitLab Endpoint: GET /groups/:id/boards/:board_id
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @return the Board instance for the specified board ID as an Optional instance */ - public Optional getOptionalBoard(Object projectIdOrPath, Long boardId) { + public Optional getOptionalGroupIssueBoard(Object groupIdOrPath, Long boardId) { try { - return (Optional.ofNullable(getBoard(projectIdOrPath, boardId))); + return (Optional.ofNullable(getGroupIssueBoard(groupIdOrPath, boardId))); } catch (GitLabApiException glae) { return (GitLabApi.createOptionalFromException(glae)); } @@ -122,32 +844,30 @@ public Optional getOptionalBoard(Object projectIdOrPath, Long boardId) { /** * Creates a new Issue Board. * - *

NOTE: This is only available in GitLab EE

+ *
GitLab Endpoint: POST /groups/:id/boards
* - *
GitLab Endpoint: POST /projects/:id/boards
- * - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param name the name for the new board * @return the created Board instance * @throws GitLabApiException if any exception occurs */ - public Board createBoard(Object projectIdOrPath, String name) throws GitLabApiException { + public Board createGroupIssueBoard(Object groupIdOrPath, String name) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm().withParam("name", name, true); - Response response = post( - Response.Status.CREATED, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "boards"); + Response response = + post(Response.Status.CREATED, formData.asMap(), "groups", getGroupIdOrPath(groupIdOrPath), "boards"); return (response.readEntity(Board.class)); } /** * Updates an existing Issue Board. * - *

NOTE: This is only available in GitLab EE

- * - *
GitLab Endpoint: PUT /projects/:id/boards/:board_id
+ *
GitLab Endpoint: PUT /groups/:id/boards/:board_id
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance, required + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance, required * @param boardId the ID of the board, required * @param name the new name of the board, optional (can be null) + * @param hideBacklogList hide the Open list, optional (can be null) + * @param hideClosedList hide the Closed list, optional (can be null) * @param assigneeId the assignee the board should be scoped to, optional (can be null) * @param milestoneId the milestone the board should be scoped to, optional (can be null) * @param labels a comma-separated list of label names which the board should be scoped to, optional (can be null) @@ -155,10 +875,12 @@ public Board createBoard(Object projectIdOrPath, String name) throws GitLabApiEx * @return the updated Board instance * @throws GitLabApiException if any exception occurs */ - public BoardList updateBoard( - Object projectIdOrPath, + public Board updateGroupIssueBoard( + Object groupIdOrPath, Long boardId, String name, + Boolean hideBacklogList, + Boolean hideClosedList, Long assigneeId, Long milestoneId, String labels, @@ -166,69 +888,65 @@ public BoardList updateBoard( throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm() .withParam("name", name) + .withParam("hide_backlog_list", hideBacklogList) + .withParam("hide_closed_list", hideClosedList) .withParam("assignee_id", assigneeId) .withParam("milestone_id", milestoneId) .withParam("labels", labels) .withParam("weight", weight); - Response response = put( - Response.Status.OK, - formData.asMap(), - "projects", - getProjectIdOrPath(projectIdOrPath), - "boards", - boardId); - return (response.readEntity(BoardList.class)); + Response response = + put(Response.Status.OK, formData.asMap(), "groups", getGroupIdOrPath(groupIdOrPath), "boards", boardId); + return (response.readEntity(Board.class)); } /** * Soft deletes an existing Issue Board. * - *

NOTE: This is only available in GitLab EE

- * - *
GitLab Endpoint: DELETE /projects/:id/boards/:board_id
+ *
GitLab Endpoint: DELETE /groups/:id/boards/:board_id
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @throws GitLabApiException if any exception occurs */ - public void deleteBoard(Object projectIdOrPath, Long boardId) throws GitLabApiException { - delete(Response.Status.NO_CONTENT, null, "projects", getProjectIdOrPath(projectIdOrPath), "boards", boardId); + public void deleteGroupIssueBoard(Object groupIdOrPath, Long boardId) throws GitLabApiException { + delete(Response.Status.NO_CONTENT, null, "groups", getGroupIdOrPath(groupIdOrPath), "boards", boardId); } /** * Get a list of the board’s lists. Does not include open and closed lists. * - *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ *
GitLab Endpoint: GET /groups/:id/boards/:board_id/lists
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @return a list of the issue board's lists * @throws GitLabApiException if any exception occurs */ - public List getBoardLists(Object projectIdOrPath, Long boardId) throws GitLabApiException { - return (getBoardLists(projectIdOrPath, boardId, getDefaultPerPage()).all()); + public List getGroupIssueBoardLists(Object groupIdOrPath, Long boardId) throws GitLabApiException { + return (getGroupIssueBoardLists(groupIdOrPath, boardId, getDefaultPerPage()) + .all()); } /** - * Get a list of the board’s lists for the specified project to using the specified page and per page setting. + * Get a list of the board’s lists for the specified group to using the specified page and per page setting. * Does not include open and closed lists. * - *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ *
GitLab Endpoint: GET /groups/:id/boards/:board_id/lists
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @param page the page to get * @param perPage the number of Boards per page * @return a list of the issue board's lists in the specified range * @throws GitLabApiException if any exception occurs */ - public List getBoardLists(Object projectIdOrPath, Long boardId, int page, int perPage) + public List getGroupIssueBoardLists(Object groupIdOrPath, Long boardId, int page, int perPage) throws GitLabApiException { Response response = get( jakarta.ws.rs.core.Response.Status.OK, getPageQueryParams(page, perPage), - "projects", - getProjectIdOrPath(projectIdOrPath), + "groups", + getGroupIdOrPath(groupIdOrPath), "boards", boardId, "lists"); @@ -238,23 +956,23 @@ public List getBoardLists(Object projectIdOrPath, Long boardId, int p /** * Get a Pager of the board’s lists. Does not include open and closed lists. * - *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ *
GitLab Endpoint: GET /groups/:id/boards/:board_id/lists
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @param itemsPerPage the number of Board instances that will be fetched per page * @return a Pager of the issue board's lists * @throws GitLabApiException if any exception occurs */ - public Pager getBoardLists(Object projectIdOrPath, Long boardId, int itemsPerPage) + public Pager getGroupIssueBoardLists(Object groupIdOrPath, Long boardId, int itemsPerPage) throws GitLabApiException { return (new Pager( this, BoardList.class, itemsPerPage, null, - "projects", - getProjectIdOrPath(projectIdOrPath), + "groups", + getGroupIdOrPath(groupIdOrPath), "boards", boardId, "lists")); @@ -263,34 +981,35 @@ public Pager getBoardLists(Object projectIdOrPath, Long boardId, int /** * Get a Stream of the board’s lists. Does not include open and closed lists. * - *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
+ *
GitLab Endpoint: GET /groups/:id/boards/:board_id/lists
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @return a Stream of the issue board's lists * @throws GitLabApiException if any exception occurs */ - public Stream getBoardsListsStream(Object projectIdOrPath, Long boardId) throws GitLabApiException { - return (getBoardLists(projectIdOrPath, boardId, getDefaultPerPage()).stream()); + public Stream getGroupIssueBoardsListsStream(Object groupIdOrPath, Long boardId) + throws GitLabApiException { + return (getGroupIssueBoardLists(groupIdOrPath, boardId, getDefaultPerPage()).stream()); } /** * Get a single issue board list. * - *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists/:list_id
+ *
GitLab Endpoint: GET /groups/:id/boards/:board_id/lists/:list_id
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @param listId the ID of the board lists to get * @return a BoardList instance for the specified board ID and list ID * @throws GitLabApiException if any exception occurs */ - public BoardList getBoardList(Object projectIdOrPath, Long boardId, Long listId) throws GitLabApiException { + public BoardList getGroupIssueBoardList(Object groupIdOrPath, Long boardId, Long listId) throws GitLabApiException { Response response = get( Response.Status.OK, null, - "projects", - getProjectIdOrPath(projectIdOrPath), + "groups", + getGroupIdOrPath(groupIdOrPath), "boards", boardId, "lists", @@ -301,16 +1020,16 @@ public BoardList getBoardList(Object projectIdOrPath, Long boardId, Long listId) /** * Get a single issue board list as an Optional instance. * - *
GitLab Endpoint: GET /projects/:id/boards/:board_id/lists/:list_id
+ *
GitLab Endpoint: GET /groups/:id/boards/:board_id/lists/:list_id
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @param listId the ID of the board lists to get * @return a BoardList instance for the specified board ID and list ID as an Optional instance */ - public Optional getOptionalBoardList(Object projectIdOrPath, Long boardId, Long listId) { + public Optional getOptionalGroupIssueBoardList(Object groupIdOrPath, Long boardId, Long listId) { try { - return (Optional.ofNullable(getBoardList(projectIdOrPath, boardId, listId))); + return (Optional.ofNullable(getGroupIssueBoardList(groupIdOrPath, boardId, listId))); } catch (GitLabApiException glae) { return (GitLabApi.createOptionalFromException(glae)); } @@ -319,21 +1038,30 @@ public Optional getOptionalBoardList(Object projectIdOrPath, Long boa /** * Creates a new Issue Board list. * - *
GitLab Endpoint: POST /projects/:id/boards/:board_id/lists
+ *
GitLab Endpoint: POST /groups/:id/boards/:board_id/lists
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @param labelId the ID of the label + * @param assigneeId The ID of a user. Premium and Ultimate only, optional (can be null) + * @param milestoneId The ID of a milestone. Premium and Ultimate only, optional (can be null) + * @param iterationId The ID of a milestone. Premium and Ultimate only, optional (can be null) * @return the created BoardList instance * @throws GitLabApiException if any exception occurs */ - public BoardList createBoardList(Object projectIdOrPath, Long boardId, Long labelId) throws GitLabApiException { - GitLabApiForm formData = new GitLabApiForm().withParam("label_id", labelId, true); + public BoardList createGroupIssueBoardList( + Object groupIdOrPath, Long boardId, Long labelId, Long assigneeId, Long milestoneId, Long iterationId) + throws GitLabApiException { + GitLabApiForm formData = new GitLabApiForm() + .withParam("label_id", labelId) + .withParam("assignee_id", assigneeId) + .withParam("milestone_id", milestoneId) + .withParam("iteration_id", iterationId); Response response = post( Response.Status.CREATED, formData, - "projects", - getProjectIdOrPath(projectIdOrPath), + "groups", + getGroupIdOrPath(groupIdOrPath), "boards", boardId, "lists"); @@ -343,23 +1071,23 @@ public BoardList createBoardList(Object projectIdOrPath, Long boardId, Long labe /** * Updates an existing Issue Board list. This call is used to change list position. * - *
GitLab Endpoint: PUT /projects/:id/boards/:board_id/lists/:list_id
+ *
GitLab Endpoint: PUT /groups/:id/boards/:board_id/lists/:list_id
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @param listId the ID of the list * @param position the new position for the list * @return the updated BoardList instance * @throws GitLabApiException if any exception occurs */ - public BoardList updateBoardList(Object projectIdOrPath, Long boardId, Long listId, Integer position) + public BoardList updateGroupIssueBoardList(Object groupIdOrPath, Long boardId, Long listId, Integer position) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm().withParam("position", position, true); Response response = putWithFormData( Response.Status.OK, formData, - "projects", - getProjectIdOrPath(projectIdOrPath), + "groups", + getGroupIdOrPath(groupIdOrPath), "boards", boardId, "lists", @@ -368,24 +1096,241 @@ public BoardList updateBoardList(Object projectIdOrPath, Long boardId, Long list } /** - * Soft deletes an existing Issue Board list. Only for admins and project owners. + * Soft deletes an existing Issue Board list. Only for admins and group owners. * - *
GitLab Endpoint: DELETE /projects/:id/boards/:board_id/lists/:list_id
+ *
GitLab Endpoint: DELETE /groups/:id/boards/:board_id/lists/:list_id
* - * @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance * @param boardId the ID of the board * @param listId the ID of the list * @throws GitLabApiException if any exception occurs */ - public void deleteBoardList(Object projectIdOrPath, Long boardId, Long listId) throws GitLabApiException { + public void deleteGroupIssueBoardList(Object groupIdOrPath, Long boardId, Long listId) throws GitLabApiException { delete( Response.Status.NO_CONTENT, null, - "projects", - getProjectIdOrPath(projectIdOrPath), + "groups", + getGroupIdOrPath(groupIdOrPath), "boards", boardId, "lists", listId); } + + /** + * Lists epic boards in the given group. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @return a list of group's epic boards + * @throws GitLabApiException if any exception occurs + */ + public List getGroupEpicBoards(Object groupIdOrPath) throws GitLabApiException { + return (getGroupEpicBoards(groupIdOrPath, getDefaultPerPage()).all()); + } + + /** + * Get all epic boards for the specified group using the specified page and per page setting + * + *
GitLab Endpoint: GET /groups/:id/epic_boards
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param page the page to get + * @param perPage the number of items per page + * @return a list of group's Boards in the specified range + * @throws GitLabApiException if any exception occurs + */ + public List getGroupEpicBoards(Object groupIdOrPath, int page, int perPage) throws GitLabApiException { + Response response = get( + jakarta.ws.rs.core.Response.Status.OK, + getPageQueryParams(page, perPage), + "groups", + getGroupIdOrPath(groupIdOrPath), + "epic_boards"); + return (response.readEntity(new GenericType>() {})); + } + + /** + * Get a Pager of all epic boards for the specified group. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param itemsPerPage the number of items per page + * @return a Pager of group's epic boards + * @throws GitLabApiException if any exception occurs + */ + public Pager getGroupEpicBoards(Object groupIdOrPath, int itemsPerPage) throws GitLabApiException { + return (new Pager( + this, Board.class, itemsPerPage, null, "groups", getGroupIdOrPath(groupIdOrPath), "epic_boards")); + } + + /** + * Get a Stream of all epic boards for the specified group. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @return a Stream of group's epic boards + * @throws GitLabApiException if any exception occurs + */ + public Stream getGroupEpicBoardsStream(Object groupIdOrPath) throws GitLabApiException { + return (getGroupEpicBoards(groupIdOrPath, getDefaultPerPage()).stream()); + } + + /** + * Get a single epic board. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards/:board_id
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param boardId the ID of the board + * @return a Board instance for the specified board ID + * @throws GitLabApiException if any exception occurs + */ + public Board getGroupEpicBoard(Object groupIdOrPath, Long boardId) throws GitLabApiException { + Response response = + get(Response.Status.OK, null, "groups", getGroupIdOrPath(groupIdOrPath), "epic_boards", boardId); + return (response.readEntity(Board.class)); + } + + /** + * Get an epic board as an Optional instance. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards/:board_id
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param boardId the ID of the board + * @return the Board instance for the specified board ID as an Optional instance + */ + public Optional getOptionalGroupEpicBoard(Object groupIdOrPath, Long boardId) { + try { + return (Optional.ofNullable(getGroupEpicBoard(groupIdOrPath, boardId))); + } catch (GitLabApiException glae) { + return (GitLabApi.createOptionalFromException(glae)); + } + } + + /** + * Get a list of the board’s lists. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards/:board_id/lists
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param boardId the ID of the board + * @return a list of the epic board's lists + * @throws GitLabApiException if any exception occurs + */ + public List getGroupEpicBoardLists(Object groupIdOrPath, Long boardId) throws GitLabApiException { + return (getGroupEpicBoardLists(groupIdOrPath, boardId, getDefaultPerPage()) + .all()); + } + + /** + * Get a list of the board’s lists for the specified group to using the specified page and per page setting. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards/:board_id/lists
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param boardId the ID of the board + * @param page the page to get + * @param perPage the number of Boards per page + * @return a list of the epic board's lists in the specified range + * @throws GitLabApiException if any exception occurs + */ + public List getGroupEpicBoardLists(Object groupIdOrPath, Long boardId, int page, int perPage) + throws GitLabApiException { + Response response = get( + jakarta.ws.rs.core.Response.Status.OK, + getPageQueryParams(page, perPage), + "groups", + getGroupIdOrPath(groupIdOrPath), + "epic_boards", + boardId, + "lists"); + return (response.readEntity(new GenericType>() {})); + } + + /** + * Get a Pager of the board’s lists. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards/:board_id/lists
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param boardId the ID of the board + * @param itemsPerPage the number of Board instances that will be fetched per page + * @return a Pager of the epic board's lists + * @throws GitLabApiException if any exception occurs + */ + public Pager getGroupEpicBoardLists(Object groupIdOrPath, Long boardId, int itemsPerPage) + throws GitLabApiException { + return (new Pager( + this, + BoardList.class, + itemsPerPage, + null, + "groups", + getGroupIdOrPath(groupIdOrPath), + "epic_boards", + boardId, + "lists")); + } + + /** + * Get a Stream of the board’s lists. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards/:board_id/lists
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param boardId the ID of the board + * @return a Stream of the epic board's lists + * @throws GitLabApiException if any exception occurs + */ + public Stream getGroupEpicBoardsListsStream(Object groupIdOrPath, Long boardId) + throws GitLabApiException { + return (getGroupEpicBoardLists(groupIdOrPath, boardId, getDefaultPerPage()).stream()); + } + + /** + * Get a single epic board list. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards/:board_id/lists/:list_id
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param boardId the ID of the board + * @param listId the ID of the board lists to get + * @return a BoardList instance for the specified board ID and list ID + * @throws GitLabApiException if any exception occurs + */ + public BoardList getGroupEpicBoardList(Object groupIdOrPath, Long boardId, Long listId) throws GitLabApiException { + Response response = get( + Response.Status.OK, + null, + "groups", + getGroupIdOrPath(groupIdOrPath), + "epic_boards", + boardId, + "lists", + listId); + return (response.readEntity(BoardList.class)); + } + + /** + * Get a single epic board list as an Optional instance. + * + *
GitLab Endpoint: GET /groups/:id/epic_boards/:board_id/lists/:list_id
+ * + * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance + * @param boardId the ID of the board + * @param listId the ID of the board lists to get + * @return a BoardList instance for the specified board ID and list ID as an Optional instance + */ + public Optional getOptionalGroupEpicBoardList(Object groupIdOrPath, Long boardId, Long listId) { + try { + return (Optional.ofNullable(getGroupEpicBoardList(groupIdOrPath, boardId, listId))); + } catch (GitLabApiException glae) { + return (GitLabApi.createOptionalFromException(glae)); + } + } } diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractEpic.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractEpic.java index d63d37a7..27cc2ad2 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractEpic.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractEpic.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; public class AbstractEpic> extends AbstractMinimalEpic implements Serializable { private static final long serialVersionUID = 1L; @@ -45,9 +46,16 @@ public String toString() { private References references; private Author author; private List labels; + + @JsonSerialize(using = JacksonJson.DateOnlySerializer.class) private Date startDate; + + @JsonSerialize(using = JacksonJson.DateOnlySerializer.class) private Date dueDate; + + @JsonSerialize(using = JacksonJson.DateOnlySerializer.class) private Date endDate; + private Date createdAt; private Date updatedAt; private Date closedAt; diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractUser.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractUser.java index fe22106e..dadc9b74 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractUser.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/AbstractUser.java @@ -17,6 +17,7 @@ public abstract class AbstractUser> implements Seriali private Long id; private String name; private String state; + private Boolean locked; private String username; private String webUrl; @@ -60,6 +61,14 @@ public void setName(String name) { this.name = name; } + public Boolean getLocked() { + return locked; + } + + public void setLocked(Boolean locked) { + this.locked = locked; + } + public String getState() { return state; } diff --git a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Board.java b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Board.java index 802bd78e..5e5b2b35 100644 --- a/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Board.java +++ b/gitlab4j-models/src/main/java/org/gitlab4j/api/models/Board.java @@ -10,9 +10,15 @@ public class Board implements Serializable { private Long id; private String name; + private Boolean hideBacklogList; + private Boolean hideClosedList; private Project project; - private Milestone milestone; private List lists; + private Group group; + private Milestone milestone; + private Assignee assignee; + private List