Package com.atlassian.bitbucket.watcher
Interface WatcherService
public interface WatcherService
A service for interacting with
watchers- Since:
- 5.10
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisWatching(IsWatchingRequest request) Checks if awatcherexists that matches the provided requestsearch(WatcherSearchRequest request, PageRequest pageRequest) booleanunwatch(UnwatchRequest request) Removes a user as a watcher of the givenwatchable.watch(WatchRequest request) Adds a new user as awatcher.
-
Method Details
-
isWatching
Checks if awatcherexists that matches the provided request- Parameters:
request- a request describing the watcher to match- Returns:
trueif a watcher exists that matches the provided request,falseotherwise
-
search
@Nonnull Page<Watcher> search(@Nonnull WatcherSearchRequest request, @Nonnull PageRequest pageRequest) - Parameters:
request- a request describing the watchers to search forpageRequest- the page request- Returns:
- a page of watchers matching the criteria in the provided request
-
unwatch
Removes a user as a watcher of the givenwatchable. If theuseris not provided the authenticated user is used. If the user is not watching the watchable, this method will have no effect and returnfalse.- Parameters:
request- a request describing the watcher to delete- Returns:
trueif the watcher existed and was removed,falseotherwise
-
watch
Adds a new user as awatcher. If theuseris not provided, the authenticated user is used. If the user is already watching thewatchablethis method will simply return the correspondingwatcherinstance.- Parameters:
request- a request describing the watcher to create- Returns:
- the created watcher
-