module GitHub.Endpoints.Activity.Starring (
stargazersForR,
reposStarredByR,
myStarredR,
myStarredAcceptStarR,
starRepoR,
unstarRepoR,
module GitHub.Data,
) where
import GitHub.Auth
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
stargazersForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector SimpleUser)
stargazersForR :: forall (k :: RW).
Name Owner
-> Name Repo -> FetchCount -> Request k (Vector SimpleUser)
stargazersForR Name Owner
user Name Repo
repo =
Paths -> QueryString -> FetchCount -> Request k (Vector SimpleUser)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery [Text
"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, Text
"stargazers"] []
reposStarredByR :: Name Owner -> FetchCount -> Request k (Vector Repo)
reposStarredByR :: forall (k :: RW).
Name Owner -> FetchCount -> Request k (Vector Repo)
reposStarredByR Name Owner
user =
Paths -> QueryString -> FetchCount -> Request k (Vector Repo)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery [Text
"users", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Text
"starred"] []
myStarredR :: FetchCount -> Request 'RA (Vector Repo)
myStarredR :: FetchCount -> Request 'RA (Vector Repo)
myStarredR = Paths -> QueryString -> FetchCount -> Request 'RA (Vector Repo)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery [Text
"user", Text
"starred"] []
myStarredAcceptStarR :: FetchCount -> GenRequest 'MtStar 'RA (Vector RepoStarred)
myStarredAcceptStarR :: FetchCount -> GenRequest 'MtStar 'RA (Vector RepoStarred)
myStarredAcceptStarR = Paths
-> QueryString
-> FetchCount
-> GenRequest 'MtStar 'RA (Vector RepoStarred)
forall a (t :: * -> *) b (mt :: MediaType (*)) (rw :: RW).
(a ~ t b, Foldable t, Semigroup a) =>
Paths -> QueryString -> FetchCount -> GenRequest mt rw a
PagedQuery [Text
"user", Text
"starred"] []
starRepoR :: Name Owner -> Name Repo -> GenRequest 'MtUnit 'RW ()
starRepoR :: Name Owner -> Name Repo -> GenRequest 'MtUnit 'RW ()
starRepoR Name Owner
user Name Repo
repo = CommandMethod -> Paths -> ByteString -> GenRequest 'MtUnit 'RW ()
forall (mt :: MediaType (*)) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command CommandMethod
Put Paths
paths ByteString
forall a. Monoid a => a
mempty
where
paths :: Paths
paths = [Text
"user", Text
"starred", 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]
unstarRepoR :: Name Owner -> Name Repo -> GenRequest 'MtUnit 'RW ()
unstarRepoR :: Name Owner -> Name Repo -> GenRequest 'MtUnit 'RW ()
unstarRepoR Name Owner
user Name Repo
repo = CommandMethod -> Paths -> ByteString -> GenRequest 'MtUnit 'RW ()
forall (mt :: MediaType (*)) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command CommandMethod
Delete Paths
paths ByteString
forall a. Monoid a => a
mempty
where
paths :: Paths
paths = [Text
"user", Text
"starred", 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]