public class TopicsApi extends AbstractApi
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.AutoDevopsDeployStrategy, Constants.BuildGitStrategy, Constants.CommitBuildState, Constants.ContributorOrderBy, Constants.DeploymentOrderBy, Constants.DeploymentStatus, Constants.DeployTokenScope, Constants.Encoding, Constants.EpicOrderBy, Constants.EventScope, Constants.GroupOrderBy, Constants.GroupSearchScope, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestSearchIn, Constants.MergeRequestState, Constants.MilestoneState, Constants.PackageOrderBy, Constants.PackageStatus, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectAccessTokenScope, Constants.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.SquashOption, Constants.StateEvent, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType
gitLabApi
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
Modifier and Type | Method and Description |
---|---|
Topic |
createTopic(TopicParams params)
Creates a new Topic.
|
void |
deleteTopic(java.lang.Integer id)
Delete a topic.
|
Topic |
deleteTopicAvatar(java.lang.Integer id)
Delete the topic's avatar for the specified topic.
|
java.util.Optional<Topic> |
getOptionalTopic(java.lang.Integer id)
Get all details of a topic as an Optional instance.
|
Topic |
getTopic(java.lang.Integer id)
Get all details of a topic.
|
java.util.List<Topic> |
getTopics()
Get a list of Topics.
|
Pager<Topic> |
getTopics(int itemsPerPage)
Get a Pager of topics.
|
java.util.List<Topic> |
getTopics(int page,
int perPage)
Get a list of topics in the specified page range.
|
java.util.stream.Stream<Topic> |
getTopicsStream()
Get a Stream of topics.
|
Topic |
mergeTopics(java.lang.Integer sourceTopicId,
java.lang.Integer targetTopicId)
Merge two topics together.
|
Topic |
updateTopic(java.lang.Integer id,
TopicParams params)
Update a project topic.
|
Topic |
updateTopicAvatar(java.lang.Integer id,
java.io.File avatarFile)
Uploads and sets the topic's avatar for the specified topic.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getLabelIdOrName, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, patch, patch, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, upload, urlEncode, validate
public TopicsApi(GitLabApi gitLabApi)
public java.util.List<Topic> getTopics() throws GitLabApiException
Get a list of Topics.
WARNING: Do not use this method to fetch Topics from https://gitlab.com, gitlab.com has many 1,000's of public topics and it will a long time to fetch all of them. Instead usegetTopics(int itemsPerPage)
which will return a Pager of Topic instances.
GitLab Endpoint: GET /topics
GitLabApiException
- if any exception occurspublic java.util.List<Topic> getTopics(int page, int perPage) throws GitLabApiException
GitLab Endpoint: GET /topics
page
- the page to getperPage
- the number of Topic instances per pageGitLabApiException
- if any exception occurspublic Pager<Topic> getTopics(int itemsPerPage) throws GitLabApiException
GitLab Endpoint: GET /topics
itemsPerPage
- the number of Topic instances that will be fetched per pageGitLabApiException
- if any exception occurspublic java.util.stream.Stream<Topic> getTopicsStream() throws GitLabApiException
GitLab Endpoint: GET /topics
GitLabApiException
- if any exception occurspublic Topic getTopic(java.lang.Integer id) throws GitLabApiException
GitLab Endpoint: GET /topics/:id
id
- the topic IDGitLabApiException
- if any exception occurspublic java.util.Optional<Topic> getOptionalTopic(java.lang.Integer id)
GitLab Endpoint: GET /topics/:id
id
- the topic IDpublic Topic createTopic(TopicParams params) throws GitLabApiException
GitLab Endpoint: POST /topics
params
- a TopicParams instance holding the parameters for the topic creationGitLabApiException
- if any exception occurspublic Topic updateTopic(java.lang.Integer id, TopicParams params) throws GitLabApiException
GitLab Endpoint: PUT /topics/:id
id
- the topic idparams
- a TopicParams instance holding the properties to UpdateGitLabApiException
- at any exceptionpublic Topic updateTopicAvatar(java.lang.Integer id, java.io.File avatarFile) throws GitLabApiException
GitLab Endpoint: PUT /topics/:id
id
- the topic in the form of an IntegeravatarFile
- the File instance of the avatar file to uploadGitLabApiException
- if any exception occurspublic Topic deleteTopicAvatar(java.lang.Integer id) throws GitLabApiException
GitLab Endpoint: PUT /topics/:id
id
- the topic in the form of an IntegerGitLabApiException
- if any exception occurspublic void deleteTopic(java.lang.Integer id) throws GitLabApiException
GitLab Endpoint: DELETE /topics/:id
id
- the topic to deleted in the form of an IntegerGitLabApiException
- if any exception occurspublic Topic mergeTopics(java.lang.Integer sourceTopicId, java.lang.Integer targetTopicId) throws GitLabApiException
GitLab Endpoint: POST /topics/merge
sourceTopicId
- ID of source project topictargetTopicId
- ID of target project topicGitLabApiException
- if any exception occurs