java.lang.Object
org.miaixz.bus.gitlab.AbstractApi
org.miaixz.bus.gitlab.LabelsApi
- All Implemented Interfaces:
Constants
This class provides an entry point to all the GitLab API project and group label calls.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.miaixz.bus.gitlab.models.Constants
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.AutoCancelPendingPipelines, Constants.AutoDevopsDeployStrategy, Constants.BuildGitStrategy, Constants.CommitBuildState, Constants.ContributorOrderBy, Constants.DefaultBranchProtectionLevel, Constants.DeploymentOrderBy, Constants.DeploymentStatus, Constants.DeployTokenScope, Constants.Encoding, Constants.EpicOrderBy, Constants.EventScope, Constants.GroupOrderBy, Constants.GroupSearchScope<T>, 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.PipelineSource, Constants.ProjectAccessTokenScope, Constants.ProjectCreationLevel, Constants.ProjectFeatureVisibilityAccessLevel, Constants.ProjectOrderBy, Constants.ProjectSearchScope<T>, Constants.SearchScope<T>, Constants.SortOrder, Constants.SquashOption, Constants.StateEvent, Constants.SubgroupCreationLevel, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType -
Field Summary
Fields inherited from class org.miaixz.bus.gitlab.AbstractApi
gitLabApiFields inherited from interface org.miaixz.bus.gitlab.models.Constants
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateGroupLabel(Object groupIdOrPath, Label labelProperties) Create a group label.createProjectLabel(Object projectIdOrPath, Label labelProperties) Create a project label.voiddeleteGroupLabel(Object groupIdOrPath, Object labelIdOrName) Delete the specified labelvoiddeleteProjectLabel(Object projectIdOrPath, Object labelIdOrName) Delete the specified project label.getGroupLabel(Object groupIdOrPath, Object labelIdOrName) Get a single group label.getGroupLabels(Object groupIdOrPath) Get all labels of the specified group.getGroupLabels(Object groupIdOrPath, int itemsPerPage) Get a Pager of all labels of the specified group.getGroupLabelsStream(Object groupIdOrPath) Get a Stream of all labels of the specified group.getOptionalGroupLabel(Object groupIdOrPath, Object labelIdOrName) Get a single group label as the value of an Optional.getOptionalProjectLabel(Object projectIdOrPath, Object labelIdOrName) Get a single project label as the value of an Optional.getProjectLabel(Object projectIdOrPath, Object labelIdOrName) Get a single project label.getProjectLabels(Object projectIdOrPath) Get all labels of the specified project.getProjectLabels(Object projectIdOrPath, int itemsPerPage) Get a Pager of all labels of the specified project.getProjectLabelsStream(Object projectIdOrPath) Get a Stream of all labels of the specified project.subscribeGroupLabel(Object groupIdOrPath, Object labelIdOrName) Subscribe a specified group label.subscribeProjectLabel(Object projectIdOrPath, Object labelIdOrName) Subscribe a specified project label.unsubscribeGroupLabel(Object groupIdOrPath, Object labelIdOrName) Unsubscribe a specified group label.unsubscribeProjectLabel(Object projectIdOrPath, Object labelIdOrName) Unsubscribe a specified project label.updateGroupLabel(Object groupIdOrPath, Object labelIdOrName, Label labelConfig) Update the specified label.updateProjectLabel(Object projectIdOrPath, Object labelIdOrName, Label labelConfig) Update the specified project label.Methods inherited from class org.miaixz.bus.gitlab.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 Details
-
LabelsApi
-
-
Method Details
-
getProjectLabels
Get all labels of the specified project.- Parameters:
projectIdOrPath- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a list of project's labels
- Throws:
GitLabApiException- if any exception occurs
-
getProjectLabels
public Pager<Label> getProjectLabels(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException Get a Pager of all labels of the specified project.- Parameters:
projectIdOrPath- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage- the number of items per page- Returns:
- a list of project's labels in the specified range
- Throws:
GitLabApiException- if any exception occurs
-
getProjectLabelsStream
Get a Stream of all labels of the specified project.- Parameters:
projectIdOrPath- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a Stream of project's labels
- Throws:
GitLabApiException- if any exception occurs
-
getProjectLabel
public Label getProjectLabel(Object projectIdOrPath, Object labelIdOrName) throws GitLabApiException Get a single project label.- Parameters:
projectIdOrPath- the project in the form of an Long(ID), String(path), or Project instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instance- Returns:
- a Label instance holding the information for the group label
- Throws:
GitLabApiException- if any exception occurs
-
getOptionalProjectLabel
public Optional<Label> getOptionalProjectLabel(Object projectIdOrPath, Object labelIdOrName) throws GitLabApiException Get a single project label as the value of an Optional.- Parameters:
projectIdOrPath- the project in the form of an Long(ID), String(path), or Project instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instance- Returns:
- a Optional instance with a Label instance as its value
- Throws:
GitLabApiException- if any exception occurs
-
createProjectLabel
public Label createProjectLabel(Object projectIdOrPath, Label labelProperties) throws GitLabApiException Create a project label. A Label instance is used to set the label properties. withXXX() methods are provided to set the properties of the label to create:// name and color properties are required Label labelProperties = new Label() .withName("a-pink-project-label") .withColor("pink") .withDescription("A new pink project label") .withPriority(10); gitLabApi.getLabelsApi().createProjectLabel(projectId, labelProperties);GitLab Endpoint: POST /groups/:id/labels- Parameters:
projectIdOrPath- the project in the form of an Long(ID), String(path), or Project instancelabelProperties- a Label instance holding the properties for the new group label- Returns:
- the created Label instance
- Throws:
GitLabApiException- if any exception occurs
-
updateProjectLabel
public Label updateProjectLabel(Object projectIdOrPath, Object labelIdOrName, Label labelConfig) throws GitLabApiException Update the specified project label. The name, color, and description can be updated. A Label instance is used to set the properties of the label to update, withXXX() methods are provided to set the properties to update:Label labelUpdates = new Label() .withName("a-new-name") .withColor("red") .withDescription("A red group label"); gitLabApi.getLabelsApi().updateGroupLabel(projectId, labelId, labelUpdates);GitLab Endpoint: PUT /projects/:id/labels/:label_id- Parameters:
projectIdOrPath- the project in the form of an Long(ID), String(path), or Project instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instancelabelConfig- a Label instance holding the label properties to update- Returns:
- the updated Label instance
- Throws:
GitLabApiException- if any exception occurs
-
deleteProjectLabel
public void deleteProjectLabel(Object projectIdOrPath, Object labelIdOrName) throws GitLabApiException Delete the specified project label.- Parameters:
projectIdOrPath- the project in the form of an Long(ID), String(path), or Project instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instance- Throws:
GitLabApiException- if any exception occurs
-
subscribeProjectLabel
public Label subscribeProjectLabel(Object projectIdOrPath, Object labelIdOrName) throws GitLabApiException Subscribe a specified project label.- Parameters:
projectIdOrPath- the project in the form of an Long(ID), String(path), or Project instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instance- Returns:
- HttpStatusCode 503
- Throws:
GitLabApiException- if any exception occurs
-
unsubscribeProjectLabel
public Label unsubscribeProjectLabel(Object projectIdOrPath, Object labelIdOrName) throws GitLabApiException Unsubscribe a specified project label.- Parameters:
projectIdOrPath- the project in the form of an Long(ID), String(path), or Project instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instance- Returns:
- HttpStatusCode 503
- Throws:
GitLabApiException- if any exception occurs
-
getGroupLabels
Get all labels of the specified group.- Parameters:
groupIdOrPath- the group in the form of an Long(ID), String(path), or Group instance- Returns:
- a list of group's labels
- Throws:
GitLabApiException- if any exception occurs
-
getGroupLabels
public Pager<Label> getGroupLabels(Object groupIdOrPath, int itemsPerPage) throws GitLabApiException Get a Pager of all labels of the specified group.- Parameters:
groupIdOrPath- the group in the form of an Long(ID), String(path), or Group instanceitemsPerPage- the number of items per page- Returns:
- a list of group's labels in the specified range
- Throws:
GitLabApiException- if any exception occurs
-
getGroupLabelsStream
Get a Stream of all labels of the specified group.- Parameters:
groupIdOrPath- the group in the form of an Long(ID), String(path), or Group instance- Returns:
- a Stream of group's labels
- Throws:
GitLabApiException- if any exception occurs
-
getGroupLabel
Get a single group label.- Parameters:
groupIdOrPath- the group in the form of an Long(ID), String(path), or Group instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instance- Returns:
- a Label instance holding the information for the group label
- Throws:
GitLabApiException- if any exception occurs
-
getOptionalGroupLabel
public Optional<Label> getOptionalGroupLabel(Object groupIdOrPath, Object labelIdOrName) throws GitLabApiException Get a single group label as the value of an Optional.- Parameters:
groupIdOrPath- the group in the form of an Long(ID), String(path), or Group instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instance- Returns:
- a Optional instance with a Label instance as its value
- Throws:
GitLabApiException- if any exception occurs
-
createGroupLabel
public Label createGroupLabel(Object groupIdOrPath, Label labelProperties) throws GitLabApiException Create a group label. A Label instance is used to set the label properties. withXXX() methods are provided to set the properties of the label to create:Label labelProperties = new Label() .withName("a-name") .withColor("green") .withDescription("A new green group label"); gitLabApi.getLabelsApi().createGroupLabel(projectId, labelProperties);GitLab Endpoint: POST /groups/:id/labels- Parameters:
groupIdOrPath- the group in the form of an Long(ID), String(path), or Group instancelabelProperties- a Label instance holding the properties for the new group label- Returns:
- the created Label instance
- Throws:
GitLabApiException- if any exception occurs
-
updateGroupLabel
public Label updateGroupLabel(Object groupIdOrPath, Object labelIdOrName, Label labelConfig) throws GitLabApiException Update the specified label. The name, color, and description can be updated. A Label instance is used to set the properties of the label to update, withXXX() methods are provided to set the properties to update:Label labelUpdates = new Label() .withName("a-new-name") .withColor("red") .withDescription("A red group label"); gitLabApi.getLabelsApi().updateGroupLabel(projectId, labelId, labelUpdates);GitLab Endpoint: PUT /groups/:id/labels/:label_id- Parameters:
groupIdOrPath- the group in the form of an Long(ID), String(path), or Group instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instancelabelConfig- a Label instance holding the label properties to update- Returns:
- the updated Label instance
- Throws:
GitLabApiException- if any exception occurs
-
deleteGroupLabel
Delete the specified label- Parameters:
groupIdOrPath- the group in the form of an Long(ID), String(path), or Group instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instance- Throws:
GitLabApiException- if any exception occurs
-
subscribeGroupLabel
public Label subscribeGroupLabel(Object groupIdOrPath, Object labelIdOrName) throws GitLabApiException Subscribe a specified group label.- Parameters:
groupIdOrPath- the group in the form of an Long(ID), String(path), or Group instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instance- Returns:
- HttpStatusCode 503
- Throws:
GitLabApiException- if any exception occurs
-
unsubscribeGroupLabel
public Label unsubscribeGroupLabel(Object groupIdOrPath, Object labelIdOrName) throws GitLabApiException Unsubscribe a specified group label.- Parameters:
groupIdOrPath- the group in the form of an Long(ID), String(path), or Group instancelabelIdOrName- the label in the form of an Long(ID), String(name), or Label instance- Returns:
- HttpStatusCode 503
- Throws:
GitLabApiException- if any exception occurs
-