Package org.kohsuke.github
Class GHBranchProtectionBuilder
- java.lang.Object
-
- org.kohsuke.github.GHBranchProtectionBuilder
-
public class GHBranchProtectionBuilder extends Object
Builder to configure the branch protection settings.- See Also:
GHBranch#enableProtection()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GHBranchProtectionBuilder
addRequiredChecks(String... checks)
Add required checks gh branch protection builder.GHBranchProtectionBuilder
addRequiredChecks(Collection<String> checks)
Add required checks gh branch protection builder.GHBranchProtectionBuilder
dismissStaleReviews()
Dismiss stale reviews gh branch protection builder.GHBranchProtectionBuilder
dismissStaleReviews(boolean v)
Dismiss stale reviews gh branch protection builder.GHBranchProtection
enable()
Enable gh branch protection.GHBranchProtectionBuilder
includeAdmins()
Include admins gh branch protection builder.GHBranchProtectionBuilder
includeAdmins(boolean v)
Include admins gh branch protection builder.GHBranchProtectionBuilder
requireBranchIsUpToDate()
Require branch is up to date gh branch protection builder.GHBranchProtectionBuilder
requireBranchIsUpToDate(boolean v)
Require branch is up to date gh branch protection builder.GHBranchProtectionBuilder
requireCodeOwnReviews()
Require code own reviews gh branch protection builder.GHBranchProtectionBuilder
requireCodeOwnReviews(boolean v)
Require code own reviews gh branch protection builder.GHBranchProtectionBuilder
requiredReviewers(int v)
Required reviewers gh branch protection builder.GHBranchProtectionBuilder
requireReviews()
Require reviews gh branch protection builder.GHBranchProtectionBuilder
restrictPushAccess()
Restrict push access gh branch protection builder.GHBranchProtectionBuilder
restrictReviewDismissals()
Restrict review dismissals gh branch protection builder.GHBranchProtectionBuilder
teamPushAccess(Collection<GHTeam> teams)
Team push access gh branch protection builder.GHBranchProtectionBuilder
teamPushAccess(GHTeam... teams)
Team push access gh branch protection builder.GHBranchProtectionBuilder
teamReviewDismissals(Collection<GHTeam> teams)
Team review dismissals gh branch protection builder.GHBranchProtectionBuilder
teamReviewDismissals(GHTeam... teams)
Team review dismissals gh branch protection builder.GHBranchProtectionBuilder
userPushAccess(Collection<GHUser> users)
User push access gh branch protection builder.GHBranchProtectionBuilder
userPushAccess(GHUser... users)
User push access gh branch protection builder.GHBranchProtectionBuilder
userReviewDismissals(Collection<GHUser> users)
User review dismissals gh branch protection builder.GHBranchProtectionBuilder
userReviewDismissals(GHUser... users)
User review dismissals gh branch protection builder.
-
-
-
Method Detail
-
addRequiredChecks
public GHBranchProtectionBuilder addRequiredChecks(Collection<String> checks)
Add required checks gh branch protection builder.- Parameters:
checks
- the checks- Returns:
- the gh branch protection builder
-
addRequiredChecks
public GHBranchProtectionBuilder addRequiredChecks(String... checks)
Add required checks gh branch protection builder.- Parameters:
checks
- the checks- Returns:
- the gh branch protection builder
-
dismissStaleReviews
public GHBranchProtectionBuilder dismissStaleReviews()
Dismiss stale reviews gh branch protection builder.- Returns:
- the gh branch protection builder
-
dismissStaleReviews
public GHBranchProtectionBuilder dismissStaleReviews(boolean v)
Dismiss stale reviews gh branch protection builder.- Parameters:
v
- the v- Returns:
- the gh branch protection builder
-
enable
public GHBranchProtection enable() throws IOException
Enable gh branch protection.- Returns:
- the gh branch protection
- Throws:
IOException
- the io exception
-
includeAdmins
public GHBranchProtectionBuilder includeAdmins()
Include admins gh branch protection builder.- Returns:
- the gh branch protection builder
-
includeAdmins
public GHBranchProtectionBuilder includeAdmins(boolean v)
Include admins gh branch protection builder.- Parameters:
v
- the v- Returns:
- the gh branch protection builder
-
requiredReviewers
public GHBranchProtectionBuilder requiredReviewers(int v)
Required reviewers gh branch protection builder.- Parameters:
v
- the v- Returns:
- the gh branch protection builder
-
requireBranchIsUpToDate
public GHBranchProtectionBuilder requireBranchIsUpToDate()
Require branch is up to date gh branch protection builder.- Returns:
- the gh branch protection builder
-
requireBranchIsUpToDate
public GHBranchProtectionBuilder requireBranchIsUpToDate(boolean v)
Require branch is up to date gh branch protection builder.- Parameters:
v
- the v- Returns:
- the gh branch protection builder
-
requireCodeOwnReviews
public GHBranchProtectionBuilder requireCodeOwnReviews()
Require code own reviews gh branch protection builder.- Returns:
- the gh branch protection builder
-
requireCodeOwnReviews
public GHBranchProtectionBuilder requireCodeOwnReviews(boolean v)
Require code own reviews gh branch protection builder.- Parameters:
v
- the v- Returns:
- the gh branch protection builder
-
requireReviews
public GHBranchProtectionBuilder requireReviews()
Require reviews gh branch protection builder.- Returns:
- the gh branch protection builder
-
restrictReviewDismissals
public GHBranchProtectionBuilder restrictReviewDismissals()
Restrict review dismissals gh branch protection builder.- Returns:
- the gh branch protection builder
-
restrictPushAccess
public GHBranchProtectionBuilder restrictPushAccess()
Restrict push access gh branch protection builder.- Returns:
- the gh branch protection builder
-
teamPushAccess
public GHBranchProtectionBuilder teamPushAccess(Collection<GHTeam> teams)
Team push access gh branch protection builder.- Parameters:
teams
- the teams- Returns:
- the gh branch protection builder
-
teamPushAccess
public GHBranchProtectionBuilder teamPushAccess(GHTeam... teams)
Team push access gh branch protection builder.- Parameters:
teams
- the teams- Returns:
- the gh branch protection builder
-
teamReviewDismissals
public GHBranchProtectionBuilder teamReviewDismissals(Collection<GHTeam> teams)
Team review dismissals gh branch protection builder.- Parameters:
teams
- the teams- Returns:
- the gh branch protection builder
-
teamReviewDismissals
public GHBranchProtectionBuilder teamReviewDismissals(GHTeam... teams)
Team review dismissals gh branch protection builder.- Parameters:
teams
- the teams- Returns:
- the gh branch protection builder
-
userPushAccess
public GHBranchProtectionBuilder userPushAccess(Collection<GHUser> users)
User push access gh branch protection builder.- Parameters:
users
- the users- Returns:
- the gh branch protection builder
-
userPushAccess
public GHBranchProtectionBuilder userPushAccess(GHUser... users)
User push access gh branch protection builder.- Parameters:
users
- the users- Returns:
- the gh branch protection builder
-
userReviewDismissals
public GHBranchProtectionBuilder userReviewDismissals(Collection<GHUser> users)
User review dismissals gh branch protection builder.- Parameters:
users
- the users- Returns:
- the gh branch protection builder
-
userReviewDismissals
public GHBranchProtectionBuilder userReviewDismissals(GHUser... users)
User review dismissals gh branch protection builder.- Parameters:
users
- the users- Returns:
- the gh branch protection builder
-
-