Interface AutoMergeSettingsService
public interface AutoMergeSettingsService
Service for managing pull request auto-merge settings.
- Since:
- 8.15
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
Whether auto-merge is globally enabled. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes the pull request auto-merge settings associated with a particularscope
.getOrDefault
(Scope scope) Retrieves the pull request auto-merge settings for a particularscope
.set
(AutoMergeSettingsCreateRequest request) Creates or updates the pull request auto-merge settings for a particularrepository scope
orproject scope
.
-
Field Details
-
AUTO_MERGE_GLOBAL_ENABLED
static final boolean AUTO_MERGE_GLOBAL_ENABLEDWhether auto-merge is globally enabled.- See Also:
-
-
Method Details
-
delete
Deletes the pull request auto-merge settings associated with a particularscope
.- Parameters:
scope
- arepository scope
orproject scope
- Throws:
AuthorisationException
- when the currently authenticated user does not have at least admin permission for the provided scope, e.g.Permission.REPO_ADMIN
for aRepositoryScope
orPermission.PROJECT_ADMIN
for aProjectScope
ArgumentValidationException
- if the provided scope isglobal scope
ForbiddenException
- if the repository's project has restricted its auto-merge settings
-
getOrDefault
Retrieves the pull request auto-merge settings for a particularscope
. If no settings are found, inherited settings are returned if they exist. Otherwise,global
pull request auto-merge settings are returned. If the provided scope is arepository scope
and the repository's project has restricted its auto-merge settings, then the project's auto-merge settings will be returned.- Parameters:
scope
- arepository scope
orproject scope
- Returns:
- pull request auto-merge settings for the provided scope
- Throws:
AuthorisationException
- when the currently authenticated user does not have at least read permission for the provided scope, e.g.Permission.REPO_READ
for aRepositoryScope
orPermission.PROJECT_VIEW
for aProjectScope
-
set
Creates or updates the pull request auto-merge settings for a particularrepository scope
orproject scope
.- Parameters:
request
- the request containing the pull request auto-merge settings- Returns:
- the created or updated pull request auto-merge settings
- Throws:
AuthorisationException
- when the currently authenticated user does not have at least admin permission for the provided scope, e.g.Permission.REPO_ADMIN
for aRepositoryScope
orPermission.PROJECT_ADMIN
for aProjectScope
ForbiddenException
- if the repository's project has restricted its auto-merge settings
-