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:
  • Constructor Details

    • BoardsApi

      public BoardsApi(GitLabApi gitLabApi)
  • Method Details

    • getBoards

      public List<Board> getBoards(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 List<Board> getBoards(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(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 Stream<Board> getBoardsStream(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(Object projectIdOrPath, 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 Optional<Board> getOptionalBoard(Object projectIdOrPath, 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(Object projectIdOrPath, 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(Object projectIdOrPath, Long boardId, String name, Long assigneeId, Long milestoneId, String labels, 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(Object projectIdOrPath, 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 List<BoardList> getBoardLists(Object projectIdOrPath, 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 List<BoardList> getBoardLists(Object projectIdOrPath, 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(Object projectIdOrPath, 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 Stream<BoardList> getBoardsListsStream(Object projectIdOrPath, 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(Object projectIdOrPath, Long boardId, 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 Optional<BoardList> getOptionalBoardList(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
      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(Object projectIdOrPath, Long boardId, 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(Object projectIdOrPath, Long boardId, Long listId, 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(Object projectIdOrPath, Long boardId, 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