module GitHub.Endpoints.Repos.Collaborators (
collaboratorsOn,
collaboratorsOn',
collaboratorsOnR,
isCollaboratorOn,
isCollaboratorOnR,
addCollaborator,
addCollaboratorR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
collaboratorsOn :: Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
collaboratorsOn = collaboratorsOn' Nothing
collaboratorsOn' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
collaboratorsOn' auth user repo =
executeRequestMaybe auth $ collaboratorsOnR user repo FetchAll
collaboratorsOnR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector SimpleUser)
collaboratorsOnR user repo =
pagedQuery ["repos", toPathPart user, toPathPart repo, "collaborators"] []
isCollaboratorOn
:: Maybe Auth
-> Name Owner
-> Name Repo
-> Name User
-> IO (Either Error Bool)
isCollaboratorOn auth user repo coll =
executeRequestMaybe auth $ isCollaboratorOnR user repo coll
isCollaboratorOnR
:: Name Owner
-> Name Repo
-> Name User
-> GenRequest 'MtStatus rw Bool
isCollaboratorOnR user repo coll =
Query ["repos", toPathPart user, toPathPart repo, "collaborators", toPathPart coll] []
addCollaborator
:: Auth
-> Name Owner
-> Name Repo
-> Name User
-> IO (Either Error ())
addCollaborator auth owner repo coll =
executeRequest auth $ addCollaboratorR owner repo coll
addCollaboratorR
:: Name Owner
-> Name Repo
-> Name User
-> GenRequest 'MtUnit 'RW ()
addCollaboratorR owner repo coll =
Command Put ["repos", toPathPart owner, toPathPart repo, "collaborators", toPathPart coll] mempty