module GitHub.Endpoints.Repos.Invitations (
listInvitationsOnR,
listInvitationsForR,
acceptInvitationFromR
) where
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
listInvitationsOnR :: Name Owner -> Name Repo -> FetchCount -> GenRequest 'MtJSON k (Vector RepoInvitation)
listInvitationsOnR :: forall (k :: RW).
Name Owner
-> Name Repo
-> FetchCount
-> GenRequest 'MtJSON k (Vector RepoInvitation)
listInvitationsOnR Name Owner
user Name Repo
repo =
Paths
-> QueryString
-> FetchCount
-> GenRequest 'MtJSON k (Vector RepoInvitation)
forall a (t :: * -> *) b (mt :: MediaType (*)) (rw :: RW).
(a ~ t b, Foldable t, Semigroup a) =>
Paths -> QueryString -> FetchCount -> GenRequest mt rw 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
"invitations"] []
listInvitationsForR :: FetchCount -> Request k (Vector RepoInvitation)
listInvitationsForR :: forall (k :: RW). FetchCount -> Request k (Vector RepoInvitation)
listInvitationsForR =
Paths
-> QueryString -> FetchCount -> Request k (Vector RepoInvitation)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery [Text
"user", Text
"repository_invitations"] []
acceptInvitationFromR :: Id RepoInvitation -> GenRequest 'MtUnit 'RW ()
acceptInvitationFromR :: Id RepoInvitation -> GenRequest 'MtUnit 'RW ()
acceptInvitationFromR Id RepoInvitation
invId =
CommandMethod -> Paths -> ByteString -> GenRequest 'MtUnit 'RW ()
forall (mt :: MediaType (*)) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command CommandMethod
Patch [Text
"user", Text
"repository_invitations", Id RepoInvitation -> Text
forall a. IsPathPart a => a -> Text
toPathPart Id RepoInvitation
invId] ByteString
forall a. Monoid a => a
mempty