Interface PreRepositoryHook<T extends com.atlassian.bitbucket.hook.repository.RepositoryHookRequest>
- All Known Subinterfaces:
RepositoryMergeCheck
public interface PreRepositoryHook<T extends com.atlassian.bitbucket.hook.repository.RepositoryHookRequest>
Hook that is called for all veto-able changes to 1 or more Refs. Examples are: pushes, pull request merges, branch
creation/deletion through the REST API, file-edit, etc.
- Since:
- 5.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
onEnd
(PreRepositoryHookContext context, T request, com.atlassian.bitbucket.hook.repository.RepositoryHookResult result) Callback method that is called after all registered and enabled hooks have been calledcom.atlassian.bitbucket.hook.repository.RepositoryHookResult
preUpdate
(PreRepositoryHookContext context, T request) Callback method that is called just before a request to update one or morerefs
is completed.
-
Method Details
-
preUpdate
@Nonnull com.atlassian.bitbucket.hook.repository.RepositoryHookResult preUpdate(@Nonnull PreRepositoryHookContext context, @Nonnull T request) Callback method that is called just before a request to update one or morerefs
is completed.- Parameters:
context
- provides hook settings and provides a way to obtain the commits added/removedrequest
- provides the refs that are about to be updated.- Returns:
- the outcome of the repository hook
-
onEnd
default void onEnd(@Nonnull PreRepositoryHookContext context, @Nonnull T request, @Nonnull com.atlassian.bitbucket.hook.repository.RepositoryHookResult result) Callback method that is called after all registered and enabled hooks have been called- Parameters:
context
- provides hook settings and a way to obtain the commits added/removedrequest
- the change requestresult
- the combined outcome of all hooks that have been called, containing all vetoes returned by any of the hooks
-