Repository navigation
Expand file tree
/
Copy pathInvitations.hs
More file actions
35 lines (30 loc) · 1.39 KB
/
Copy pathInvitations.hs
File metadata and controls
35 lines (30 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-----------------------------------------------------------------------------
-- |
-- License : BSD-3-Clause
-- Maintainer : Oleg Grenrus <oleg.grenrus@iki.fi>
--
-- The repo invitations API as described on
-- <https://developer.github.com/v3/repos/invitations/>.
module GitHub.Endpoints.Repos.Invitations (
listInvitationsOnR,
listInvitationsForR,
acceptInvitationFromR
) where
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
-- | List open invitations of a repository
-- See <https://developer.github.com/v3/repos/invitations/#list-invitations-for-a-repository>
listInvitationsOnR :: Name Owner -> Name Repo -> FetchCount -> GenRequest 'MtJSON k (Vector RepoInvitation)
listInvitationsOnR user repo =
PagedQuery ["repos", toPathPart user, toPathPart repo, "invitations"] []
-- | List a user's repository invitations
-- See <https://developer.github.com/v3/repos/invitations/#list-a-users-repository-invitations>
listInvitationsForR :: FetchCount -> Request k (Vector RepoInvitation)
listInvitationsForR =
pagedQuery ["user", "repository_invitations"] []
-- | Accept a repository invitation
-- See <https://developer.github.com/v3/repos/invitations/#accept-a-repository-invitation>
acceptInvitationFromR :: Id RepoInvitation -> GenRequest 'MtUnit 'RW ()
acceptInvitationFromR invId =
Command Patch ["user", "repository_invitations", toPathPart invId] mempty