Constants
public class ProtectedBranchesApi extends AbstractApi
Constants.ActionType, Constants.GroupOrderBy, Constants.ImpersonationState, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestState, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.SortOrder, Constants.StateEvent, Constants.TargetType, Constants.TokenType
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
Constructor | Description |
---|---|
ProtectedBranchesApi(GitLabApi gitLabApi) |
Modifier and Type | Method | Description |
---|---|---|
List<ProtectedBranch> |
getProtectedBranches(Integer projectId) |
Gets a list of protected branches from a project.
|
ProtectedBranch |
protectBranch(Integer projectId,
String branchName) |
Protects a single repository branch or several project repository branches using a wildcard protected branch.
|
ProtectedBranch |
protectBranch(Integer projectId,
String branchName,
AccessLevel pushAccessLevel,
AccessLevel mergeAccessLevel) |
Protects a single repository branch or several project repository branches using a wildcard protected branch.
|
void |
unprotectBranch(Integer projectId,
String branchName) |
Unprotects the given protected branch or wildcard protected branch.
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getPageQueryParams, getWithAccepts, handle, isApiVersion, post, post, post, post, post, put, put, putWithFormData, upload, upload, urlEncode, validate
public ProtectedBranchesApi(GitLabApi gitLabApi)
public List<ProtectedBranch> getProtectedBranches(Integer projectId) throws GitLabApiException
projectId
- the ID of the project to protectGitLabApiException
- if any exception occurspublic void unprotectBranch(Integer projectId, String branchName) throws GitLabApiException
projectId
- the ID of the project to un-protectbranchName
- the name of the branch to un-protectGitLabApiException
- if any exception occurspublic ProtectedBranch protectBranch(Integer projectId, String branchName) throws GitLabApiException
projectId
- the ID of the project to protectbranchName
- the name of the branch to protectGitLabApiException
- if any exception occurspublic ProtectedBranch protectBranch(Integer projectId, String branchName, AccessLevel pushAccessLevel, AccessLevel mergeAccessLevel) throws GitLabApiException
projectId
- the ID of the project to protectbranchName
- the name of the branch to protectpushAccessLevel
- Access levels allowed to push (defaults: 40, master access level)mergeAccessLevel
- Access levels allowed to merge (defaults: 40, master access level)GitLabApiException
- if any exception occursCopyright © 2018. All rights reserved.