Package org.gitlab4j.api
Class TopicsApi
- java.lang.Object
-
- org.gitlab4j.api.AbstractApi
-
- org.gitlab4j.api.TopicsApi
-
- All Implemented Interfaces:
org.gitlab4j.models.Constants
public class TopicsApi extends AbstractApi
-
-
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.AutoCancelPendingPipelines, 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.ProjectFeatureVisibilityAccessLevel, 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 org.gitlab4j.api.models.Topic
createTopic(org.gitlab4j.api.models.TopicParams params)
Creates a new Topic.void
deleteTopic(java.lang.Integer id)
Delete a topic.org.gitlab4j.api.models.Topic
deleteTopicAvatar(java.lang.Integer id)
Delete the topic's avatar for the specified topic.java.util.Optional<org.gitlab4j.api.models.Topic>
getOptionalTopic(java.lang.Integer id)
Get all details of a topic as an Optional instance.org.gitlab4j.api.models.Topic
getTopic(java.lang.Integer id)
Get all details of a topic.java.util.List<org.gitlab4j.api.models.Topic>
getTopics()
Get a list of Topics.Pager<org.gitlab4j.api.models.Topic>
getTopics(int itemsPerPage)
Get a Pager of topics.java.util.List<org.gitlab4j.api.models.Topic>
getTopics(int page, int perPage)
Get a list of topics in the specified page range.java.util.stream.Stream<org.gitlab4j.api.models.Topic>
getTopicsStream()
Get a Stream of topics.org.gitlab4j.api.models.Topic
mergeTopics(java.lang.Integer sourceTopicId, java.lang.Integer targetTopicId)
Merge two topics together.org.gitlab4j.api.models.Topic
updateTopic(java.lang.Integer id, org.gitlab4j.api.models.TopicParams params)
Update a project topic.org.gitlab4j.api.models.Topic
updateTopicAvatar(java.lang.Integer id, java.io.File avatarFile)
Uploads and sets the topic's avatar for the specified topic.-
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
-
TopicsApi
public TopicsApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getTopics
public java.util.List<org.gitlab4j.api.models.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
- Returns:
- the list of topics viewable by the authenticated user
- Throws:
GitLabApiException
- if any exception occurs
-
getTopics
public java.util.List<org.gitlab4j.api.models.Topic> getTopics(int page, int perPage) throws GitLabApiException
Get a list of topics in the specified page range.GitLab Endpoint: GET /topics
- Parameters:
page
- the page to getperPage
- the number of Topic instances per page- Returns:
- the list of topics
- Throws:
GitLabApiException
- if any exception occurs
-
getTopics
public Pager<org.gitlab4j.api.models.Topic> getTopics(int itemsPerPage) throws GitLabApiException
Get a Pager of topics.GitLab Endpoint: GET /topics
- Parameters:
itemsPerPage
- the number of Topic instances that will be fetched per page- Returns:
- the pager of topics
- Throws:
GitLabApiException
- if any exception occurs
-
getTopicsStream
public java.util.stream.Stream<org.gitlab4j.api.models.Topic> getTopicsStream() throws GitLabApiException
Get a Stream of topics.GitLab Endpoint: GET /topics
- Returns:
- the stream of topics
- Throws:
GitLabApiException
- if any exception occurs
-
getTopic
public org.gitlab4j.api.models.Topic getTopic(java.lang.Integer id) throws GitLabApiException
Get all details of a topic.GitLab Endpoint: GET /topics/:id
- Parameters:
id
- the topic ID- Returns:
- the topic for the specified topic id
- Throws:
GitLabApiException
- if any exception occurs
-
getOptionalTopic
public java.util.Optional<org.gitlab4j.api.models.Topic> getOptionalTopic(java.lang.Integer id)
Get all details of a topic as an Optional instance.GitLab Endpoint: GET /topics/:id
- Parameters:
id
- the topic ID- Returns:
- the Topic for the specified topic id as an Optional instance
-
createTopic
public org.gitlab4j.api.models.Topic createTopic(org.gitlab4j.api.models.TopicParams params) throws GitLabApiException
Creates a new Topic. Available only for users who can create topics.GitLab Endpoint: POST /topics
- Parameters:
params
- a TopicParams instance holding the parameters for the topic creation- Returns:
- the created Topic instance
- Throws:
GitLabApiException
- if any exception occurs
-
updateTopic
public org.gitlab4j.api.models.Topic updateTopic(java.lang.Integer id, org.gitlab4j.api.models.TopicParams params) throws GitLabApiException
Update a project topic.GitLab Endpoint: PUT /topics/:id
- Parameters:
id
- the topic idparams
- a TopicParams instance holding the properties to Update- Returns:
- the updated Topic instance
- Throws:
GitLabApiException
- at any exception
-
updateTopicAvatar
public org.gitlab4j.api.models.Topic updateTopicAvatar(java.lang.Integer id, java.io.File avatarFile) throws GitLabApiException
Uploads and sets the topic's avatar for the specified topic.GitLab Endpoint: PUT /topics/:id
- Parameters:
id
- the topic in the form of an IntegeravatarFile
- the File instance of the avatar file to upload- Returns:
- the updated Topic instance
- Throws:
GitLabApiException
- if any exception occurs
-
deleteTopicAvatar
public org.gitlab4j.api.models.Topic deleteTopicAvatar(java.lang.Integer id) throws GitLabApiException
Delete the topic's avatar for the specified topic.GitLab Endpoint: PUT /topics/:id
- Parameters:
id
- the topic in the form of an Integer- Returns:
- the updated Topic instance
- Throws:
GitLabApiException
- if any exception occurs
-
deleteTopic
public void deleteTopic(java.lang.Integer id) throws GitLabApiException
Delete a topic. You must be an administrator to delete a project topic. When you delete a project topic, you also delete the topic assignment for projects.GitLab Endpoint: DELETE /topics/:id
- Parameters:
id
- the topic to deleted in the form of an Integer- Throws:
GitLabApiException
- if any exception occurs
-
mergeTopics
public org.gitlab4j.api.models.Topic mergeTopics(java.lang.Integer sourceTopicId, java.lang.Integer targetTopicId) throws GitLabApiException
Merge two topics together. You must be an administrator to merge a source topic into a target topic. When you merge topics, you delete the source topic and move all assigned projects to the target topic.GitLab Endpoint: POST /topics/merge
- Parameters:
sourceTopicId
- ID of source project topictargetTopicId
- ID of target project topic- Returns:
- the merged Topic instance
- Throws:
GitLabApiException
- if any exception occurs
-
-