Class BoardsApi

  • All Implemented Interfaces:
    Constants

    public class BoardsApi
    extends AbstractApi
    This class implements the client side API for the GitLab Issue Boards API calls. NOTE: If a user is not a member of a group and the group is private, a GET request on that group will result to a 404 status code.
    See Also:
    GitLab Issue Boards API Documentaion
    • Constructor Detail

      • BoardsApi

        public BoardsApi​(GitLabApi gitLabApi)
    • Method Detail

      • getBoards

        public java.util.List<Board> getBoards​(java.lang.Object projectIdOrPath)
                                        throws GitLabApiException
        Lists Issue Boards in the given project.
        GitLab Endpoint: GET /projects/:id/boards
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        Returns:
        a list of project's issue boards
        Throws:
        GitLabApiException - if any exception occurs
      • getBoards

        public java.util.List<Board> getBoards​(java.lang.Object projectIdOrPath,
                                               int page,
                                               int perPage)
                                        throws GitLabApiException
        Get all issue boards for the specified project using the specified page and per page setting
        GitLab Endpoint: GET /projects/:id/boards
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        page - the page to get
        perPage - the number of items per page
        Returns:
        a list of project's Boards in the specified range
        Throws:
        GitLabApiException - if any exception occurs
      • getBoards

        public Pager<Board> getBoards​(java.lang.Object projectIdOrPath,
                                      int itemsPerPage)
                               throws GitLabApiException
        Get a Pager of all issue boards for the specified project.
        GitLab Endpoint: GET /projects/:id/boards
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        itemsPerPage - the number of items per page
        Returns:
        a Pager of project's issue boards
        Throws:
        GitLabApiException - if any exception occurs
      • getBoardsStream

        public java.util.stream.Stream<Board> getBoardsStream​(java.lang.Object projectIdOrPath)
                                                       throws GitLabApiException
        Get a Stream of all issue boards for the specified project.
        GitLab Endpoint: GET /projects/:id/boards
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        Returns:
        a Stream of project's issue boards
        Throws:
        GitLabApiException - if any exception occurs
      • getBoard

        public Board getBoard​(java.lang.Object projectIdOrPath,
                              java.lang.Long boardId)
                       throws GitLabApiException
        Get a single issue board.
        GitLab Endpoint: GET /projects/:id/boards/:board_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        Returns:
        a Board instance for the specified board ID
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalBoard

        public java.util.Optional<Board> getOptionalBoard​(java.lang.Object projectIdOrPath,
                                                          java.lang.Long boardId)
        Get an issue board as an Optional instance.
        GitLab Endpoint: GET /projects/:id/boards/:board_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        Returns:
        the Board instance for the specified board ID as an Optional instance
      • createBoard

        public Board createBoard​(java.lang.Object projectIdOrPath,
                                 java.lang.String name)
                          throws GitLabApiException
        Creates a new Issue Board.

        NOTE: This is only available in GitLab EE

        GitLab Endpoint: POST /projects/:id/boards
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        name - the name for the new board
        Returns:
        the created Board instance
        Throws:
        GitLabApiException - if any exception occurs
      • updateBoard

        public BoardList updateBoard​(java.lang.Object projectIdOrPath,
                                     java.lang.Long boardId,
                                     java.lang.String name,
                                     java.lang.Long assigneeId,
                                     java.lang.Long milestoneId,
                                     java.lang.String labels,
                                     java.lang.Integer weight)
                              throws GitLabApiException
        Updates an existing Issue Board.

        NOTE: This is only available in GitLab EE

        GitLab Endpoint: PUT /projects/:id/boards/:board_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
        boardId - the ID of the board, required
        name - the new name of the board, optional (can be null)
        assigneeId - the assignee the board should be scoped to, optional (can be null)
        milestoneId - the milestone the board should be scoped to, optional (can be null)
        labels - a comma-separated list of label names which the board should be scoped to, optional (can be null)
        weight - the weight range from 0 to 9, to which the board should be scoped to, optional (can be null)
        Returns:
        the updated Board instance
        Throws:
        GitLabApiException - if any exception occurs
      • deleteBoard

        public void deleteBoard​(java.lang.Object projectIdOrPath,
                                java.lang.Long boardId)
                         throws GitLabApiException
        Soft deletes an existing Issue Board.

        NOTE: This is only available in GitLab EE

        GitLab Endpoint: DELETE /projects/:id/boards/:board_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        Throws:
        GitLabApiException - if any exception occurs
      • getBoardLists

        public java.util.List<BoardList> getBoardLists​(java.lang.Object projectIdOrPath,
                                                       java.lang.Long boardId)
                                                throws GitLabApiException
        Get a list of the board’s lists. Does not include open and closed lists.
        GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        Returns:
        a list of the issue board's lists
        Throws:
        GitLabApiException - if any exception occurs
      • getBoardLists

        public java.util.List<BoardList> getBoardLists​(java.lang.Object projectIdOrPath,
                                                       java.lang.Long boardId,
                                                       int page,
                                                       int perPage)
                                                throws GitLabApiException
        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
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        page - the page to get
        perPage - the number of Boards per page
        Returns:
        a list of the issue board's lists in the specified range
        Throws:
        GitLabApiException - if any exception occurs
      • getBoardLists

        public Pager<BoardList> getBoardLists​(java.lang.Object projectIdOrPath,
                                              java.lang.Long boardId,
                                              int itemsPerPage)
                                       throws GitLabApiException
        Get a Pager of the board’s lists. Does not include open and closed lists.
        GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        itemsPerPage - the number of Board instances that will be fetched per page
        Returns:
        a Pager of the issue board's lists
        Throws:
        GitLabApiException - if any exception occurs
      • getBoardsListsStream

        public java.util.stream.Stream<BoardList> getBoardsListsStream​(java.lang.Object projectIdOrPath,
                                                                       java.lang.Long boardId)
                                                                throws GitLabApiException
        Get a Stream of the board’s lists. Does not include open and closed lists.
        GitLab Endpoint: GET /projects/:id/boards/:board_id/lists
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        Returns:
        a Stream of the issue board's lists
        Throws:
        GitLabApiException - if any exception occurs
      • getBoardList

        public BoardList getBoardList​(java.lang.Object projectIdOrPath,
                                      java.lang.Long boardId,
                                      java.lang.Long listId)
                               throws GitLabApiException
        Get a single issue board list.
        GitLab Endpoint: GET /projects/:id/boards/:board_id/lists/:list_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        listId - the ID of the board lists to get
        Returns:
        a BoardList instance for the specified board ID and list ID
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalBoardList

        public java.util.Optional<BoardList> getOptionalBoardList​(java.lang.Object projectIdOrPath,
                                                                  java.lang.Long boardId,
                                                                  java.lang.Long listId)
        Get a single issue board list as an Optional instance.
        GitLab Endpoint: GET /projects/:id/boards/:board_id/lists/:list_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        listId - the ID of the board lists to get
        Returns:
        a BoardList instance for the specified board ID and list ID as an Optional instance
      • createBoardList

        public BoardList createBoardList​(java.lang.Object projectIdOrPath,
                                         java.lang.Long boardId,
                                         java.lang.Long labelId)
                                  throws GitLabApiException
        Creates a new Issue Board list.
        GitLab Endpoint: POST /projects/:id/boards/:board_id/lists
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        labelId - the ID of the label
        Returns:
        the created BoardList instance
        Throws:
        GitLabApiException - if any exception occurs
      • updateBoardList

        public BoardList updateBoardList​(java.lang.Object projectIdOrPath,
                                         java.lang.Long boardId,
                                         java.lang.Long listId,
                                         java.lang.Integer position)
                                  throws GitLabApiException
        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
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        listId - the ID of the list
        position - the new position for the list
        Returns:
        the updated BoardList instance
        Throws:
        GitLabApiException - if any exception occurs
      • deleteBoardList

        public void deleteBoardList​(java.lang.Object projectIdOrPath,
                                    java.lang.Long boardId,
                                    java.lang.Long listId)
                             throws GitLabApiException
        Soft deletes an existing Issue Board list. Only for admins and project owners.
        GitLab Endpoint: DELETE /projects/:id/boards/:board_id/lists/:list_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        boardId - the ID of the board
        listId - the ID of the list
        Throws:
        GitLabApiException - if any exception occurs