Class TodosApi

  • All Implemented Interfaces:
    Constants

    public class TodosApi
    extends AbstractApi
    This class implements the client side API for the GitLab Todos API.
    • Constructor Detail

      • TodosApi

        public TodosApi​(GitLabApi gitLabApi)
    • Method Detail

      • getPendingTodos

        public java.util.List<Todo> getPendingTodos()
                                             throws GitLabApiException
        Get a List of pending todos for the current user.
        GitLab Endpoint: GET /todos
        Returns:
        a List of pending Todos for the current user
        Throws:
        GitLabApiException - if any exception occurs
      • getPendingTodos

        public Pager<Todo> getPendingTodos​(int itemsPerPage)
                                    throws GitLabApiException
        Get a Pager of pending todos for the current user.
        GitLab Endpoint: GET /todos
        Parameters:
        itemsPerPage - the number of todo that will be fetched per page
        Returns:
        a Pager containing the pending Todos for the current user
        Throws:
        GitLabApiException - if any exception occurs
      • getPendingTodosStream

        public java.util.stream.Stream<Todo> getPendingTodosStream()
                                                            throws GitLabApiException
        Get a Stream of pending todos for the current user.
        GitLab Endpoint: GET /todos
        Returns:
        a Stream containing the pending Todos for the user
        Throws:
        GitLabApiException - if any exception occurs
      • getDoneTodos

        public java.util.List<Todo> getDoneTodos()
                                          throws GitLabApiException
        Get a List of done todos for the current user.
        GitLab Endpoint: GET /todos
        Returns:
        a List of done Todos for the current user
        Throws:
        GitLabApiException - if any exception occurs
      • getDoneTodos

        public Pager<Todo> getDoneTodos​(int itemsPerPage)
                                 throws GitLabApiException
        Get a Pager of done todos for the current user.
        GitLab Endpoint: GET /todos
        Parameters:
        itemsPerPage - the number of todo that will be fetched per page
        Returns:
        a Pager containing the done Todos for the current user
        Throws:
        GitLabApiException - if any exception occurs
      • getDoneTodosStream

        public java.util.stream.Stream<Todo> getDoneTodosStream()
                                                         throws GitLabApiException
        Get a Stream of done todos for the current user.
        GitLab Endpoint: GET /todos
        Returns:
        a Stream containing the done Todos for the current user
        Throws:
        GitLabApiException - if any exception occurs
      • getTodos

        public java.util.List<Todo> getTodos​(Constants.TodoAction action,
                                             java.lang.Long authorId,
                                             java.lang.Long projectId,
                                             java.lang.Long groupId,
                                             Constants.TodoState state,
                                             Constants.TodoType type)
                                      throws GitLabApiException
        Get a List of all todos that match the provided filter params.
        GitLab Endpoint: GET /todos
        Parameters:
        action - the action to be filtered. Can be assigned, mentioned, build_failed, marked, approval_required, unmergeable or directly_addressed.
        authorId - the ID of an author
        projectId - the ID of a project
        groupId - the ID of a group
        state - the state of the todo. Can be either pending or done
        type - the type of a todo. Can be either Issue or MergeRequest
        Returns:
        Stream of Todo instances
        Throws:
        GitLabApiException - if any exception occurs
      • getTodosStream

        public java.util.stream.Stream<Todo> getTodosStream​(Constants.TodoAction action,
                                                            java.lang.Long authorId,
                                                            java.lang.Long projectId,
                                                            java.lang.Long groupId,
                                                            Constants.TodoState state,
                                                            Constants.TodoType type)
                                                     throws GitLabApiException
        Get a List of all todos that match the provided filter params.
        GitLab Endpoint: GET /todos
        Parameters:
        action - the action to be filtered. Can be assigned, mentioned, build_failed, marked, approval_required, unmergeable or directly_addressed.
        authorId - the ID of an author
        projectId - the ID of a project
        groupId - the ID of a group
        state - the state of the todo. Can be either pending or done
        type - the type of a todo. Can be either Issue or MergeRequest
        Returns:
        Stream of Todo instances
        Throws:
        GitLabApiException - if any exception occurs
      • getTodos

        public Pager<Todo> getTodos​(Constants.TodoAction action,
                                    java.lang.Long authorId,
                                    java.lang.Long projectId,
                                    java.lang.Long groupId,
                                    Constants.TodoState state,
                                    Constants.TodoType type,
                                    int itemsPerPage)
                             throws GitLabApiException
        Returns a Pager of todos that match the provided filter params. When no filter params are provided, will returns all pending todos for the current user.
        GitLab Endpoint: GET /todos
        Parameters:
        action - the action to be filtered. Can be assigned, mentioned, build_failed, marked, approval_required, unmergeable or directly_addressed.
        authorId - the ID of an author
        projectId - the ID of a project
        groupId - the ID of a group
        state - the state of the todo. Can be either pending or done
        type - the type of a todo. Can be either Issue or MergeRequest
        itemsPerPage - the number of todo that will be fetched per page
        Returns:
        a list of pages in todo for the specified range
        Throws:
        GitLabApiException - if any exception occurs
      • markAsDone

        public Todo markAsDone​(java.lang.Long todoId)
                        throws GitLabApiException
        Marks a single pending todo given by its ID for the current user as done. The todo marked as done is returned in the response.
        GitLab Endpoint: POST /todos/:id/mark_as_done
        Parameters:
        todoId - the ID of a todo
        Returns:
        todo instance with info on the created page
        Throws:
        GitLabApiException - if any exception occurs
      • markAllAsDone

        public void markAllAsDone()
                           throws GitLabApiException
        Marks all pending todos for the current user as done.
        GitLab Endpoint: POST /todos/mark_as_done
        Throws:
        GitLabApiException - if any exception occurs