Package org.gitlab4j.api
Class TodosApi
- java.lang.Object
-
- org.gitlab4j.api.AbstractApi
-
- org.gitlab4j.api.TodosApi
-
- All Implemented Interfaces:
org.gitlab4j.models.Constants
public class TodosApi extends AbstractApi
This class implements the client side API for the GitLab Todos API.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gitlab4j.models.Constants
org.gitlab4j.models.Constants.ActionType, org.gitlab4j.models.Constants.ApplicationScope, org.gitlab4j.models.Constants.ArchiveFormat, org.gitlab4j.models.Constants.AutoDevopsDeployStrategy, org.gitlab4j.models.Constants.BuildGitStrategy, org.gitlab4j.models.Constants.CommitBuildState, org.gitlab4j.models.Constants.ContributorOrderBy, org.gitlab4j.models.Constants.DefaultBranchProtectionLevel, org.gitlab4j.models.Constants.DeploymentOrderBy, org.gitlab4j.models.Constants.DeploymentStatus, org.gitlab4j.models.Constants.DeployTokenScope, org.gitlab4j.models.Constants.Encoding, org.gitlab4j.models.Constants.EpicOrderBy, org.gitlab4j.models.Constants.EventScope, org.gitlab4j.models.Constants.GroupOrderBy, org.gitlab4j.models.Constants.GroupSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.ImpersonationState, org.gitlab4j.models.Constants.IssueOrderBy, org.gitlab4j.models.Constants.IssueScope, org.gitlab4j.models.Constants.IssueState, org.gitlab4j.models.Constants.JobScope, org.gitlab4j.models.Constants.LineType, org.gitlab4j.models.Constants.MergeRequestOrderBy, org.gitlab4j.models.Constants.MergeRequestScope, org.gitlab4j.models.Constants.MergeRequestSearchIn, org.gitlab4j.models.Constants.MergeRequestState, org.gitlab4j.models.Constants.MilestoneState, org.gitlab4j.models.Constants.PackageOrderBy, org.gitlab4j.models.Constants.PackageStatus, org.gitlab4j.models.Constants.PipelineOrderBy, org.gitlab4j.models.Constants.PipelineScope, org.gitlab4j.models.Constants.PipelineSource, org.gitlab4j.models.Constants.ProjectAccessTokenScope, org.gitlab4j.models.Constants.ProjectCreationLevel, org.gitlab4j.models.Constants.ProjectOrderBy, org.gitlab4j.models.Constants.ProjectSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SortOrder, org.gitlab4j.models.Constants.SquashOption, org.gitlab4j.models.Constants.StateEvent, org.gitlab4j.models.Constants.SubgroupCreationLevel, org.gitlab4j.models.Constants.TagOrderBy, org.gitlab4j.models.Constants.TargetType, org.gitlab4j.models.Constants.TodoAction, org.gitlab4j.models.Constants.TodoState, org.gitlab4j.models.Constants.TodoType, org.gitlab4j.models.Constants.TokenType
-
-
Field Summary
-
Fields inherited from class org.gitlab4j.api.AbstractApi
gitLabApi
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<org.gitlab4j.api.models.Todo>
getDoneTodos()
Get a List of done todos for the current user.Pager<org.gitlab4j.api.models.Todo>
getDoneTodos(int itemsPerPage)
Get a Pager of done todos for the current user.java.util.stream.Stream<org.gitlab4j.api.models.Todo>
getDoneTodosStream()
Get a Stream of done todos for the current user.java.util.List<org.gitlab4j.api.models.Todo>
getPendingTodos()
Get a List of pending todos for the current user.Pager<org.gitlab4j.api.models.Todo>
getPendingTodos(int itemsPerPage)
Get a Pager of pending todos for the current user.java.util.stream.Stream<org.gitlab4j.api.models.Todo>
getPendingTodosStream()
Get a Stream of pending todos for the current user.java.util.List<org.gitlab4j.api.models.Todo>
getTodos(org.gitlab4j.models.Constants.TodoAction action, java.lang.Long authorId, java.lang.Long projectId, java.lang.Long groupId, org.gitlab4j.models.Constants.TodoState state, org.gitlab4j.models.Constants.TodoType type)
Get a List of all todos that match the provided filter params.Pager<org.gitlab4j.api.models.Todo>
getTodos(org.gitlab4j.models.Constants.TodoAction action, java.lang.Long authorId, java.lang.Long projectId, java.lang.Long groupId, org.gitlab4j.models.Constants.TodoState state, org.gitlab4j.models.Constants.TodoType type, int itemsPerPage)
Returns a Pager of todos that match the provided filter params.java.util.stream.Stream<org.gitlab4j.api.models.Todo>
getTodosStream(org.gitlab4j.models.Constants.TodoAction action, java.lang.Long authorId, java.lang.Long projectId, java.lang.Long groupId, org.gitlab4j.models.Constants.TodoState state, org.gitlab4j.models.Constants.TodoType type)
Get a List of all todos that match the provided filter params.void
markAllAsDone()
Marks all pending todos for the current user as done.org.gitlab4j.api.models.Todo
markAsDone(java.lang.Long todoId)
Marks a single pending todo given by its ID for the current user as done.-
Methods inherited from class org.gitlab4j.api.AbstractApi
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getLabelIdOrName, getNamespaceIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, patch, patch, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, putWithFormData, upload, upload, upload, upload, urlEncode, validate
-
-
-
-
Constructor Detail
-
TodosApi
public TodosApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getPendingTodos
public java.util.List<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.Todo> getTodos(org.gitlab4j.models.Constants.TodoAction action, java.lang.Long authorId, java.lang.Long projectId, java.lang.Long groupId, org.gitlab4j.models.Constants.TodoState state, org.gitlab4j.models.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 authorprojectId
- the ID of a projectgroupId
- the ID of a groupstate
- the state of the todo. Can be either pending or donetype
- 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<org.gitlab4j.api.models.Todo> getTodosStream(org.gitlab4j.models.Constants.TodoAction action, java.lang.Long authorId, java.lang.Long projectId, java.lang.Long groupId, org.gitlab4j.models.Constants.TodoState state, org.gitlab4j.models.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 authorprojectId
- the ID of a projectgroupId
- the ID of a groupstate
- the state of the todo. Can be either pending or donetype
- 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<org.gitlab4j.api.models.Todo> getTodos(org.gitlab4j.models.Constants.TodoAction action, java.lang.Long authorId, java.lang.Long projectId, java.lang.Long groupId, org.gitlab4j.models.Constants.TodoState state, org.gitlab4j.models.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 authorprojectId
- the ID of a projectgroupId
- the ID of a groupstate
- the state of the todo. Can be either pending or donetype
- the type of a todo. Can be either Issue or MergeRequestitemsPerPage
- 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 org.gitlab4j.api.models.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
-
-