Package org.gitlab4j.api
Class LabelsApi
- java.lang.Object
-
- org.gitlab4j.api.AbstractApi
-
- org.gitlab4j.api.LabelsApi
-
- All Implemented Interfaces:
Constants
public class LabelsApi extends AbstractApi
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gitlab4j.api.Constants
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.CommitBuildState, Constants.Encoding, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestState, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.SortOrder, Constants.StateEvent, Constants.TargetType, Constants.TokenType
-
-
Field Summary
-
Fields inherited from interface org.gitlab4j.api.Constants
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
-
-
Method Summary
Modifier and Type Method Description Label
createLabel(Object projectIdOrPath, String name, String color)
Create a labelLabel
createLabel(Object projectIdOrPath, String name, String color, Integer priority)
Create a labelLabel
createLabel(Object projectIdOrPath, String name, String color, String description)
Create a labelLabel
createLabel(Object projectIdOrPath, String name, String color, String description, Integer priority)
Create a labelvoid
deleteLabel(Object projectIdOrPath, String name)
Delete the specified labelList<Label>
getLabels(Object projectIdOrPath)
Get all labels of the specified project.Pager<Label>
getLabels(Object projectIdOrPath, int itemsPerPage)
Get a Pager of all labels of the specified project.List<Label>
getLabels(Object projectIdOrPath, int page, int perPage)
Get all labels of the specified project to using the specified page and per page settingStream<Label>
getLabelsStream(Object projectIdOrPath)
Get a Stream of all labels of the specified project.Label
subscribeLabel(Object projectIdOrPath, Integer labelId)
Subscribe a specified labelLabel
unsubscribeLabel(Object projectIdOrPath, Integer labelId)
Unsubscribe a specified labelLabel
updateLabel(Object projectIdOrPath, String name, String newName, String color, String description, Integer priority)
Update the specified labelLabel
updateLabelColor(Object projectIdOrPath, String name, String color, String description, Integer priority)
Update the specified labelLabel
updateLabelName(Object projectIdOrPath, String name, String newName, String description, Integer priority)
Update the specified label-
Methods inherited from class org.gitlab4j.api.AbstractApi
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, urlEncode, validate
-
-
-
-
Constructor Detail
-
LabelsApi
public LabelsApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getLabels
public List<Label> getLabels(Object projectIdOrPath) throws GitLabApiException
Get all labels of the specified project.- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance- Returns:
- a list of project's labels
- Throws:
GitLabApiException
- if any exception occurs
-
getLabels
public List<Label> getLabels(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get all labels of the specified project to using the specified page and per page setting- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancepage
- the page to getperPage
- the number of items per page- Returns:
- a list of project's labels in the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getLabels
public Pager<Label> getLabels(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 Integer(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
-
getLabelsStream
public Stream<Label> getLabelsStream(Object projectIdOrPath) throws GitLabApiException
Get a Stream of all labels of the specified project.- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instance- Returns:
- a Stream of project's labels
- Throws:
GitLabApiException
- if any exception occurs
-
createLabel
public Label createLabel(Object projectIdOrPath, String name, String color, String description) throws GitLabApiException
Create a label- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancename
- the name for the labelcolor
- the color for the labeldescription
- the description for the label- Returns:
- the created Label instance
- Throws:
GitLabApiException
- if any exception occurs
-
createLabel
public Label createLabel(Object projectIdOrPath, String name, String color) throws GitLabApiException
Create a label- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancename
- the name for the labelcolor
- the color for the label- Returns:
- the created Label instance
- Throws:
GitLabApiException
- if any exception occurs
-
createLabel
public Label createLabel(Object projectIdOrPath, String name, String color, Integer priority) throws GitLabApiException
Create a label- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancename
- the name for the labelcolor
- the color for the labelpriority
- the priority for the label- Returns:
- the created Label instance
- Throws:
GitLabApiException
- if any exception occurs
-
createLabel
public Label createLabel(Object projectIdOrPath, String name, String color, String description, Integer priority) throws GitLabApiException
Create a label- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancename
- the name for the labelcolor
- the color for the labeldescription
- the description for the labelpriority
- the priority for the label- Returns:
- the created Label instance
- Throws:
GitLabApiException
- if any exception occurs
-
updateLabelName
public Label updateLabelName(Object projectIdOrPath, String name, String newName, String description, Integer priority) throws GitLabApiException
Update the specified label- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancename
- the name for the labelnewName
- the new name for the labeldescription
- the description for the labelpriority
- the priority for the label- Returns:
- the modified Label instance
- Throws:
GitLabApiException
- if any exception occurs
-
updateLabelColor
public Label updateLabelColor(Object projectIdOrPath, String name, String color, String description, Integer priority) throws GitLabApiException
Update the specified label- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancename
- the name for the labelcolor
- the color for the labeldescription
- the description for the labelpriority
- the priority for the label- Returns:
- the modified Label instance
- Throws:
GitLabApiException
- if any exception occurs
-
updateLabel
public Label updateLabel(Object projectIdOrPath, String name, String newName, String color, String description, Integer priority) throws GitLabApiException
Update the specified label- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancename
- the name for the labelnewName
- the new name for the labelcolor
- the color for the labeldescription
- the description for the labelpriority
- the priority for the label- Returns:
- the modified Label instance
- Throws:
GitLabApiException
- if any exception occurs
-
deleteLabel
public void deleteLabel(Object projectIdOrPath, String name) throws GitLabApiException
Delete the specified label- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancename
- the name for the label- Throws:
GitLabApiException
- if any exception occurs
-
subscribeLabel
public Label subscribeLabel(Object projectIdOrPath, Integer labelId) throws GitLabApiException
Subscribe a specified label- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancelabelId
- the label ID- Returns:
- HttpStatusCode 503
- Throws:
GitLabApiException
- if any exception occurs
-
unsubscribeLabel
public Label unsubscribeLabel(Object projectIdOrPath, Integer labelId) throws GitLabApiException
Unsubscribe a specified label- Parameters:
projectIdOrPath
- the project in the form of an Integer(ID), String(path), or Project instancelabelId
- the label ID- Returns:
- HttpStatusCode 503
- Throws:
GitLabApiException
- if any exception occurs
-
-