Package com.atlassian.bitbucket.watcher
Interface WatcherService
public interface WatcherService
A service for interacting with
watchers
- Since:
- 5.10
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isWatching
(IsWatchingRequest request) Checks if awatcher
exists that matches the provided requestsearch
(WatcherSearchRequest request, PageRequest pageRequest) boolean
unwatch
(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 awatcher
exists that matches the provided request- Parameters:
request
- a request describing the watcher to match- Returns:
true
if a watcher exists that matches the provided request,false
otherwise
-
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 theuser
is 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:
true
if the watcher existed and was removed,false
otherwise
-
watch
Adds a new user as awatcher
. If theuser
is not provided, the authenticated user is used. If the user is already watching thewatchable
this method will simply return the correspondingwatcher
instance.- Parameters:
request
- a request describing the watcher to create- Returns:
- the created watcher
-