module GitHub.Endpoints.Activity.Watching (
watchersFor,
watchersFor',
watchersForR,
reposWatchedBy,
reposWatchedBy',
reposWatchedByR,
module GitHub.Data,
) where
import GitHub.Auth
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
watchersFor :: Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
watchersFor :: Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
watchersFor = Maybe Auth
-> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
watchersFor' Maybe Auth
forall a. Maybe a
Nothing
watchersFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
watchersFor' :: Maybe Auth
-> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
watchersFor' auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo =
Maybe Auth
-> GenRequest 'MtJSON 'RO (Vector SimpleUser)
-> IO (Either Error (Vector SimpleUser))
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO (Vector SimpleUser)
-> IO (Either Error (Vector SimpleUser)))
-> GenRequest 'MtJSON 'RO (Vector SimpleUser)
-> IO (Either Error (Vector SimpleUser))
forall a b. (a -> b) -> a -> b
$ Name Owner
-> Name Repo
-> FetchCount
-> GenRequest 'MtJSON 'RO (Vector SimpleUser)
forall (k :: RW).
Name Owner
-> Name Repo -> FetchCount -> Request k (Vector SimpleUser)
watchersForR Name Owner
user Name Repo
repo FetchCount
FetchAll
watchersForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector SimpleUser)
watchersForR :: Name Owner
-> Name Repo -> FetchCount -> Request k (Vector SimpleUser)
watchersForR user :: Name Owner
user repo :: Name Repo
repo limit :: FetchCount
limit =
Paths -> QueryString -> FetchCount -> Request k (Vector SimpleUser)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "watchers"] [] FetchCount
limit
reposWatchedBy :: Name Owner -> IO (Either Error (Vector Repo))
reposWatchedBy :: Name Owner -> IO (Either Error (Vector Repo))
reposWatchedBy = Maybe Auth -> Name Owner -> IO (Either Error (Vector Repo))
reposWatchedBy' Maybe Auth
forall a. Maybe a
Nothing
reposWatchedBy' :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Repo))
reposWatchedBy' :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Repo))
reposWatchedBy' auth :: Maybe Auth
auth user :: Name Owner
user =
Maybe Auth
-> GenRequest 'MtJSON 'RO (Vector Repo)
-> IO (Either Error (Vector Repo))
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO (Vector Repo)
-> IO (Either Error (Vector Repo)))
-> GenRequest 'MtJSON 'RO (Vector Repo)
-> IO (Either Error (Vector Repo))
forall a b. (a -> b) -> a -> b
$ Name Owner -> FetchCount -> GenRequest 'MtJSON 'RO (Vector Repo)
forall (k :: RW).
Name Owner -> FetchCount -> Request k (Vector Repo)
reposWatchedByR Name Owner
user FetchCount
FetchAll
reposWatchedByR :: Name Owner -> FetchCount -> Request k (Vector Repo)
reposWatchedByR :: Name Owner -> FetchCount -> Request k (Vector Repo)
reposWatchedByR user :: Name Owner
user =
Paths -> QueryString -> FetchCount -> Request k (Vector Repo)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery ["users", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, "subscriptions"] []