module Github.Activity.Watching (
watchersFor,
watchersFor',
watchersForR,
reposWatchedBy,
reposWatchedBy',
reposWatchedByR,
module Github.Data,
) where
import Data.Vector (Vector)
import Github.Auth
import Github.Data
import Github.Request
watchersFor :: Name GithubOwner -> Name Repo -> IO (Either Error (Vector GithubOwner))
watchersFor = watchersFor' Nothing
watchersFor' :: Maybe GithubAuth -> Name GithubOwner -> Name Repo -> IO (Either Error (Vector GithubOwner))
watchersFor' auth user repo =
executeRequestMaybe auth $ watchersForR user repo Nothing
watchersForR :: Name GithubOwner -> Name Repo -> Maybe Count -> GithubRequest k (Vector GithubOwner)
watchersForR user repo limit =
GithubPagedGet ["repos", toPathPart user, toPathPart repo, "watchers"] [] limit
reposWatchedBy :: Name GithubOwner -> IO (Either Error (Vector Repo))
reposWatchedBy = reposWatchedBy' Nothing
reposWatchedBy' :: Maybe GithubAuth -> Name GithubOwner -> IO (Either Error (Vector Repo))
reposWatchedBy' auth user =
executeRequestMaybe auth $ reposWatchedByR user Nothing
reposWatchedByR :: Name GithubOwner -> Maybe Count -> GithubRequest k (Vector Repo)
reposWatchedByR user =
GithubPagedGet ["users", toPathPart user, "subscriptions"] []