module GitHub.Endpoints.Repos.Collaborators (
collaboratorsOnR,
collaboratorPermissionOnR,
isCollaboratorOnR,
addCollaboratorR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
collaboratorsOnR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector SimpleUser)
collaboratorsOnR :: forall (k :: RW).
Name Owner
-> Name Repo -> FetchCount -> Request k (Vector SimpleUser)
collaboratorsOnR 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
"collaborators"] []
collaboratorPermissionOnR
:: Name Owner
-> Name Repo
-> Name User
-> GenRequest 'MtJSON rw CollaboratorWithPermission
collaboratorPermissionOnR :: forall (rw :: RW).
Name Owner
-> Name Repo
-> Name User
-> GenRequest 'MtJSON rw CollaboratorWithPermission
collaboratorPermissionOnR Name Owner
owner Name Repo
repo Name User
coll =
Paths -> QueryString -> Request rw CollaboratorWithPermission
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query [Text
"repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
owner, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"collaborators", Name User -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name User
coll, Text
"permission"] []
isCollaboratorOnR
:: Name Owner
-> Name Repo
-> Name User
-> GenRequest 'MtStatus rw Bool
isCollaboratorOnR :: forall (rw :: RW).
Name Owner
-> Name Repo -> Name User -> GenRequest 'MtStatus rw Bool
isCollaboratorOnR Name Owner
user Name Repo
repo Name User
coll =
Paths -> QueryString -> GenRequest 'MtStatus rw Bool
forall (mt :: MediaType (*)) (rw :: RW) a.
Paths -> QueryString -> GenRequest mt rw a
Query [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
"collaborators", Name User -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name User
coll] []
addCollaboratorR
:: Name Owner
-> Name Repo
-> Name User
-> GenRequest 'MtJSON 'RW (Maybe RepoInvitation)
addCollaboratorR :: Name Owner
-> Name Repo
-> Name User
-> GenRequest 'MtJSON 'RW (Maybe RepoInvitation)
addCollaboratorR Name Owner
owner Name Repo
repo Name User
coll =
CommandMethod
-> Paths
-> ByteString
-> GenRequest 'MtJSON 'RW (Maybe RepoInvitation)
forall (mt :: MediaType (*)) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command CommandMethod
Put [Text
"repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
owner, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, Text
"collaborators", Name User -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name User
coll] ByteString
forall a. Monoid a => a
mempty