github 0.23 → 0.24
raw patch · 51 files changed
+287/−1922 lines, 51 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- GitHub: createMilestone :: Auth -> Name Owner -> Name Repo -> NewMilestone -> IO (Either Error Milestone)
- GitHub: deleteMilestone :: Auth -> Name Owner -> Name Repo -> Id Milestone -> IO (Either Error ())
- GitHub: pullRequestReview :: Name Owner -> Name Repo -> Id PullRequest -> Id Review -> IO (Either Error Review)
- GitHub: pullRequestReview' :: Maybe Auth -> Name Owner -> Name Repo -> Id PullRequest -> Id Review -> IO (Either Error Review)
- GitHub: pullRequestReviewCommentsIO :: Name Owner -> Name Repo -> Id PullRequest -> Id Review -> IO (Either Error [ReviewComment])
- GitHub: pullRequestReviewCommentsIO' :: Maybe Auth -> Name Owner -> Name Repo -> Id PullRequest -> Id Review -> IO (Either Error [ReviewComment])
- GitHub: pullRequestReviews :: Name Owner -> Name Repo -> Id PullRequest -> IO (Either Error (Vector Review))
- GitHub: pullRequestReviews' :: Maybe Auth -> Name Owner -> Name Repo -> Id PullRequest -> IO (Either Error (Vector Review))
- GitHub: updateMilestone :: Auth -> Name Owner -> Name Repo -> Id Milestone -> UpdateMilestone -> IO (Either Error Milestone)
- GitHub.Data.Repos: [editHasDownloads] :: EditRepo -> !Maybe Bool
- GitHub.Data.Repos: [editPublic] :: EditRepo -> !Maybe Bool
- GitHub.Data.Repos: [repoForks] :: Repo -> !Maybe Int
- GitHub.Data.Repos: [repoOpenIssues] :: Repo -> !Maybe Int
- GitHub.Data.Repos: [repoParent] :: Repo -> !Maybe RepoRef
- GitHub.Data.Repos: [repoSource] :: Repo -> !Maybe RepoRef
- GitHub.Data.Repos: [repoWatchers] :: Repo -> !Maybe Int
- GitHub.Endpoints.Activity.Notifications: getNotifications :: Auth -> IO (Either Error (Vector Notification))
- GitHub.Endpoints.Activity.Notifications: markNotificationAsRead :: Auth -> Id Notification -> IO (Either Error ())
- GitHub.Endpoints.Activity.Notifications: markNotificationsAsRead :: Auth -> IO (Either Error ())
- GitHub.Endpoints.Activity.Starring: myStarred :: Auth -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Activity.Starring: myStarredAcceptStar :: Auth -> IO (Either Error (Vector RepoStarred))
- GitHub.Endpoints.Activity.Starring: reposStarredBy :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Activity.Starring: starRepo :: Auth -> Name Owner -> Name Repo -> IO (Either Error ())
- GitHub.Endpoints.Activity.Starring: stargazersFor :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
- GitHub.Endpoints.Activity.Starring: unstarRepo :: Auth -> Name Owner -> Name Repo -> IO (Either Error ())
- GitHub.Endpoints.Activity.Watching: reposWatchedBy :: Name Owner -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Activity.Watching: reposWatchedBy' :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Activity.Watching: watchersFor :: Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
- GitHub.Endpoints.Activity.Watching: watchersFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
- GitHub.Endpoints.Gists: deleteGist :: Auth -> Name Gist -> IO (Either Error ())
- GitHub.Endpoints.Gists: gist :: Name Gist -> IO (Either Error Gist)
- GitHub.Endpoints.Gists: gist' :: Maybe Auth -> Name Gist -> IO (Either Error Gist)
- GitHub.Endpoints.Gists: gists :: Name Owner -> IO (Either Error (Vector Gist))
- GitHub.Endpoints.Gists: gists' :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Gist))
- GitHub.Endpoints.Gists: starGist :: Auth -> Name Gist -> IO (Either Error ())
- GitHub.Endpoints.Gists: unstarGist :: Auth -> Name Gist -> IO (Either Error ())
- GitHub.Endpoints.Gists.Comments: comment :: Id GistComment -> IO (Either Error GistComment)
- GitHub.Endpoints.Gists.Comments: commentsOn :: Name Gist -> IO (Either Error (Vector GistComment))
- GitHub.Endpoints.GitData.Blobs: blob :: Name Owner -> Name Repo -> Name Blob -> IO (Either Error Blob)
- GitHub.Endpoints.GitData.Blobs: blob' :: Maybe Auth -> Name Owner -> Name Repo -> Name Blob -> IO (Either Error Blob)
- GitHub.Endpoints.GitData.Commits: commit :: Name Owner -> Name Repo -> Name GitCommit -> IO (Either Error GitCommit)
- GitHub.Endpoints.GitData.References: createReference :: Auth -> Name Owner -> Name Repo -> NewGitReference -> IO (Either Error GitReference)
- GitHub.Endpoints.GitData.References: namespacedReferences :: Name Owner -> Name Repo -> Text -> IO (Either Error [GitReference])
- GitHub.Endpoints.GitData.References: reference :: Name Owner -> Name Repo -> Name GitReference -> IO (Either Error GitReference)
- GitHub.Endpoints.GitData.References: reference' :: Maybe Auth -> Name Owner -> Name Repo -> Name GitReference -> IO (Either Error GitReference)
- GitHub.Endpoints.GitData.References: references :: Name Owner -> Name Repo -> IO (Either Error (Vector GitReference))
- GitHub.Endpoints.GitData.References: references' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector GitReference))
- GitHub.Endpoints.GitData.Trees: nestedTree :: Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
- GitHub.Endpoints.GitData.Trees: nestedTree' :: Maybe Auth -> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
- GitHub.Endpoints.GitData.Trees: tree :: Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
- GitHub.Endpoints.GitData.Trees: tree' :: Maybe Auth -> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
- GitHub.Endpoints.Issues: createIssue :: Auth -> Name Owner -> Name Repo -> NewIssue -> IO (Either Error Issue)
- GitHub.Endpoints.Issues: editIssue :: Auth -> Name Owner -> Name Repo -> Id Issue -> EditIssue -> IO (Either Error Issue)
- GitHub.Endpoints.Issues: issue :: Name Owner -> Name Repo -> Id Issue -> IO (Either Error Issue)
- GitHub.Endpoints.Issues: issue' :: Maybe Auth -> Name Owner -> Name Repo -> Id Issue -> IO (Either Error Issue)
- GitHub.Endpoints.Issues: issuesForRepo :: Name Owner -> Name Repo -> IssueRepoMod -> IO (Either Error (Vector Issue))
- GitHub.Endpoints.Issues: issuesForRepo' :: Maybe Auth -> Name Owner -> Name Repo -> IssueRepoMod -> IO (Either Error (Vector Issue))
- GitHub.Endpoints.Issues.Comments: comment :: Name Owner -> Name Repo -> Id Comment -> IO (Either Error IssueComment)
- GitHub.Endpoints.Issues.Comments: comments :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector IssueComment))
- GitHub.Endpoints.Issues.Comments: comments' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector IssueComment))
- GitHub.Endpoints.Issues.Comments: createComment :: Auth -> Name Owner -> Name Repo -> IssueNumber -> Text -> IO (Either Error Comment)
- GitHub.Endpoints.Issues.Comments: deleteComment :: Auth -> Name Owner -> Name Repo -> Id Comment -> IO (Either Error ())
- GitHub.Endpoints.Issues.Comments: editComment :: Auth -> Name Owner -> Name Repo -> Id Comment -> Text -> IO (Either Error Comment)
- GitHub.Endpoints.Issues.Events: event :: Name Owner -> Name Repo -> Id IssueEvent -> IO (Either Error IssueEvent)
- GitHub.Endpoints.Issues.Events: event' :: Maybe Auth -> Name Owner -> Name Repo -> Id IssueEvent -> IO (Either Error IssueEvent)
- GitHub.Endpoints.Issues.Events: eventsForIssue :: Name Owner -> Name Repo -> Id Issue -> IO (Either Error (Vector IssueEvent))
- GitHub.Endpoints.Issues.Events: eventsForIssue' :: Maybe Auth -> Name Owner -> Name Repo -> Id Issue -> IO (Either Error (Vector IssueEvent))
- GitHub.Endpoints.Issues.Events: eventsForRepo :: Name Owner -> Name Repo -> IO (Either Error (Vector IssueEvent))
- GitHub.Endpoints.Issues.Events: eventsForRepo' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector IssueEvent))
- GitHub.Endpoints.Issues.Labels: addLabelsToIssue :: Foldable f => Auth -> Name Owner -> Name Repo -> Id Issue -> f (Name IssueLabel) -> IO (Either Error (Vector IssueLabel))
- GitHub.Endpoints.Issues.Labels: createLabel :: Auth -> Name Owner -> Name Repo -> Name IssueLabel -> String -> IO (Either Error IssueLabel)
- GitHub.Endpoints.Issues.Labels: deleteLabel :: Auth -> Name Owner -> Name Repo -> Name IssueLabel -> IO (Either Error ())
- GitHub.Endpoints.Issues.Labels: label :: Name Owner -> Name Repo -> Name IssueLabel -> IO (Either Error IssueLabel)
- GitHub.Endpoints.Issues.Labels: label' :: Maybe Auth -> Name Owner -> Name Repo -> Name IssueLabel -> IO (Either Error IssueLabel)
- GitHub.Endpoints.Issues.Labels: labelsOnIssue :: Name Owner -> Name Repo -> Id Issue -> IO (Either Error (Vector IssueLabel))
- GitHub.Endpoints.Issues.Labels: labelsOnIssue' :: Maybe Auth -> Name Owner -> Name Repo -> Id Issue -> IO (Either Error (Vector IssueLabel))
- GitHub.Endpoints.Issues.Labels: labelsOnMilestone :: Name Owner -> Name Repo -> Id Milestone -> IO (Either Error (Vector IssueLabel))
- GitHub.Endpoints.Issues.Labels: labelsOnMilestone' :: Maybe Auth -> Name Owner -> Name Repo -> Id Milestone -> IO (Either Error (Vector IssueLabel))
- GitHub.Endpoints.Issues.Labels: labelsOnRepo :: Name Owner -> Name Repo -> IO (Either Error (Vector IssueLabel))
- GitHub.Endpoints.Issues.Labels: labelsOnRepo' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector IssueLabel))
- GitHub.Endpoints.Issues.Labels: removeAllLabelsFromIssue :: Auth -> Name Owner -> Name Repo -> Id Issue -> IO (Either Error ())
- GitHub.Endpoints.Issues.Labels: removeLabelFromIssue :: Auth -> Name Owner -> Name Repo -> Id Issue -> Name IssueLabel -> IO (Either Error ())
- GitHub.Endpoints.Issues.Labels: replaceAllLabelsForIssue :: Foldable f => Auth -> Name Owner -> Name Repo -> Id Issue -> f (Name IssueLabel) -> IO (Either Error (Vector IssueLabel))
- GitHub.Endpoints.Issues.Labels: updateLabel :: Auth -> Name Owner -> Name Repo -> Name IssueLabel -> Name IssueLabel -> String -> IO (Either Error IssueLabel)
- GitHub.Endpoints.Issues.Milestones: createMilestone :: Auth -> Name Owner -> Name Repo -> NewMilestone -> IO (Either Error Milestone)
- GitHub.Endpoints.Issues.Milestones: deleteMilestone :: Auth -> Name Owner -> Name Repo -> Id Milestone -> IO (Either Error ())
- GitHub.Endpoints.Issues.Milestones: milestone :: Name Owner -> Name Repo -> Id Milestone -> IO (Either Error Milestone)
- GitHub.Endpoints.Issues.Milestones: milestones :: Name Owner -> Name Repo -> IO (Either Error (Vector Milestone))
- GitHub.Endpoints.Issues.Milestones: milestones' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Milestone))
- GitHub.Endpoints.Issues.Milestones: updateMilestone :: Auth -> Name Owner -> Name Repo -> Id Milestone -> UpdateMilestone -> IO (Either Error Milestone)
- GitHub.Endpoints.Organizations: publicOrganization :: Name Organization -> IO (Either Error Organization)
- GitHub.Endpoints.Organizations: publicOrganization' :: Maybe Auth -> Name Organization -> IO (Either Error Organization)
- GitHub.Endpoints.Organizations: publicOrganizationsFor :: Name User -> IO (Either Error (Vector SimpleOrganization))
- GitHub.Endpoints.Organizations: publicOrganizationsFor' :: Maybe Auth -> Name User -> IO (Either Error (Vector SimpleOrganization))
- GitHub.Endpoints.Organizations.Members: isMemberOf :: Name User -> Name Organization -> IO (Either Error Bool)
- GitHub.Endpoints.Organizations.Members: isMemberOf' :: Maybe Auth -> Name User -> Name Organization -> IO (Either Error Bool)
- GitHub.Endpoints.Organizations.Members: membersOf :: Name Organization -> IO (Either Error (Vector SimpleUser))
- GitHub.Endpoints.Organizations.Members: membersOf' :: Maybe Auth -> Name Organization -> IO (Either Error (Vector SimpleUser))
- GitHub.Endpoints.Organizations.Teams: addOrUpdateTeamRepo' :: Auth -> Id Team -> Name Organization -> Name Repo -> Permission -> IO (Either Error ())
- GitHub.Endpoints.Organizations.Teams: addTeamMembershipFor' :: Auth -> Id Team -> Name Owner -> Role -> IO (Either Error TeamMembership)
- GitHub.Endpoints.Organizations.Teams: createTeamFor' :: Auth -> Name Organization -> CreateTeam -> IO (Either Error Team)
- GitHub.Endpoints.Organizations.Teams: deleteTeam' :: Auth -> Id Team -> IO (Either Error ())
- GitHub.Endpoints.Organizations.Teams: deleteTeamMembershipFor' :: Auth -> Id Team -> Name Owner -> IO (Either Error ())
- GitHub.Endpoints.Organizations.Teams: editTeam' :: Auth -> Id Team -> EditTeam -> IO (Either Error Team)
- GitHub.Endpoints.Organizations.Teams: listTeamRepos :: Id Team -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Organizations.Teams: listTeamRepos' :: Maybe Auth -> Id Team -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Organizations.Teams: listTeamsCurrent' :: Auth -> IO (Either Error (Vector Team))
- GitHub.Endpoints.Organizations.Teams: teamInfoFor :: Id Team -> IO (Either Error Team)
- GitHub.Endpoints.Organizations.Teams: teamInfoFor' :: Maybe Auth -> Id Team -> IO (Either Error Team)
- GitHub.Endpoints.Organizations.Teams: teamMembershipInfoFor :: Id Team -> Name Owner -> IO (Either Error TeamMembership)
- GitHub.Endpoints.Organizations.Teams: teamMembershipInfoFor' :: Maybe Auth -> Id Team -> Name Owner -> IO (Either Error TeamMembership)
- GitHub.Endpoints.Organizations.Teams: teamsOf :: Name Organization -> IO (Either Error (Vector SimpleTeam))
- GitHub.Endpoints.Organizations.Teams: teamsOf' :: Maybe Auth -> Name Organization -> IO (Either Error (Vector SimpleTeam))
- GitHub.Endpoints.PullRequests: createPullRequest :: Auth -> Name Owner -> Name Repo -> CreatePullRequest -> IO (Either Error PullRequest)
- GitHub.Endpoints.PullRequests: isPullRequestMerged :: Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error Bool)
- GitHub.Endpoints.PullRequests: mergePullRequest :: Auth -> Name Owner -> Name Repo -> IssueNumber -> Maybe Text -> IO (Either Error MergeResult)
- GitHub.Endpoints.PullRequests: pullRequest :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error PullRequest)
- GitHub.Endpoints.PullRequests: pullRequest' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error PullRequest)
- GitHub.Endpoints.PullRequests: pullRequestCommits' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector Commit))
- GitHub.Endpoints.PullRequests: pullRequestCommitsIO :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector Commit))
- GitHub.Endpoints.PullRequests: pullRequestDiff :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error ByteString)
- GitHub.Endpoints.PullRequests: pullRequestDiff' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error ByteString)
- GitHub.Endpoints.PullRequests: pullRequestFiles :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector File))
- GitHub.Endpoints.PullRequests: pullRequestFiles' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector File))
- GitHub.Endpoints.PullRequests: pullRequestPatch :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error ByteString)
- GitHub.Endpoints.PullRequests: pullRequestPatch' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error ByteString)
- GitHub.Endpoints.PullRequests: pullRequestsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector SimplePullRequest))
- GitHub.Endpoints.PullRequests: pullRequestsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimplePullRequest))
- GitHub.Endpoints.PullRequests: updatePullRequest :: Auth -> Name Owner -> Name Repo -> IssueNumber -> EditPullRequest -> IO (Either Error PullRequest)
- GitHub.Endpoints.PullRequests.Comments: createPullComment :: Auth -> Name Owner -> Name Repo -> IssueNumber -> Text -> Text -> Int -> Text -> IO (Either Error Comment)
- GitHub.Endpoints.PullRequests.Comments: pullRequestComment :: Name Owner -> Name Repo -> Id Comment -> IO (Either Error Comment)
- GitHub.Endpoints.PullRequests.Comments: pullRequestCommentsIO :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector Comment))
- GitHub.Endpoints.PullRequests.Reviews: pullRequestReview :: Name Owner -> Name Repo -> Id PullRequest -> Id Review -> IO (Either Error Review)
- GitHub.Endpoints.PullRequests.Reviews: pullRequestReview' :: Maybe Auth -> Name Owner -> Name Repo -> Id PullRequest -> Id Review -> IO (Either Error Review)
- GitHub.Endpoints.PullRequests.Reviews: pullRequestReviewCommentsIO :: Name Owner -> Name Repo -> Id PullRequest -> Id Review -> IO (Either Error [ReviewComment])
- GitHub.Endpoints.PullRequests.Reviews: pullRequestReviewCommentsIO' :: Maybe Auth -> Name Owner -> Name Repo -> Id PullRequest -> Id Review -> IO (Either Error [ReviewComment])
- GitHub.Endpoints.PullRequests.Reviews: pullRequestReviews :: Name Owner -> Name Repo -> Id PullRequest -> IO (Either Error (Vector Review))
- GitHub.Endpoints.PullRequests.Reviews: pullRequestReviews' :: Maybe Auth -> Name Owner -> Name Repo -> Id PullRequest -> IO (Either Error (Vector Review))
- GitHub.Endpoints.RateLimit: rateLimit :: IO (Either Error RateLimit)
- GitHub.Endpoints.RateLimit: rateLimit' :: Maybe Auth -> IO (Either Error RateLimit)
- GitHub.Endpoints.Repos: branchesFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Branch))
- GitHub.Endpoints.Repos: branchesFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Branch))
- GitHub.Endpoints.Repos: contributors :: Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))
- GitHub.Endpoints.Repos: contributors' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))
- GitHub.Endpoints.Repos: contributorsWithAnonymous :: Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))
- GitHub.Endpoints.Repos: contributorsWithAnonymous' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))
- GitHub.Endpoints.Repos: createOrganizationRepo' :: Auth -> Name Organization -> NewRepo -> IO (Either Error Repo)
- GitHub.Endpoints.Repos: createRepo' :: Auth -> NewRepo -> IO (Either Error Repo)
- GitHub.Endpoints.Repos: currentUserRepos :: Auth -> RepoPublicity -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Repos: deleteRepo :: Auth -> Name Owner -> Name Repo -> IO (Either Error ())
- GitHub.Endpoints.Repos: editRepo :: Auth -> Name Owner -> Name Repo -> EditRepo -> IO (Either Error Repo)
- GitHub.Endpoints.Repos: forkExistingRepo' :: Auth -> Name Owner -> Name Repo -> Maybe (Name Owner) -> IO (Either Error Repo)
- GitHub.Endpoints.Repos: languagesFor :: Name Owner -> Name Repo -> IO (Either Error Languages)
- GitHub.Endpoints.Repos: languagesFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Languages)
- GitHub.Endpoints.Repos: organizationRepos :: Name Organization -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Repos: organizationRepos' :: Maybe Auth -> Name Organization -> RepoPublicity -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Repos: repository :: Name Owner -> Name Repo -> IO (Either Error Repo)
- GitHub.Endpoints.Repos: repository' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Repo)
- GitHub.Endpoints.Repos: tagsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Tag))
- GitHub.Endpoints.Repos: tagsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Tag))
- GitHub.Endpoints.Repos: userRepos :: Name Owner -> RepoPublicity -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Repos: userRepos' :: Maybe Auth -> Name Owner -> RepoPublicity -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Repos.Collaborators: addCollaborator :: Auth -> Name Owner -> Name Repo -> Name User -> IO (Either Error (Maybe RepoInvitation))
- GitHub.Endpoints.Repos.Collaborators: collaboratorsOn :: Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
- GitHub.Endpoints.Repos.Collaborators: collaboratorsOn' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))
- GitHub.Endpoints.Repos.Collaborators: isCollaboratorOn :: Maybe Auth -> Name Owner -> Name Repo -> Name User -> IO (Either Error Bool)
- GitHub.Endpoints.Repos.Comments: commentsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Comment))
- GitHub.Endpoints.Repos.Comments: commentsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Comment))
- GitHub.Endpoints.Repos.Comments: commitCommentFor :: Name Owner -> Name Repo -> Id Comment -> IO (Either Error Comment)
- GitHub.Endpoints.Repos.Comments: commitCommentFor' :: Maybe Auth -> Name Owner -> Name Repo -> Id Comment -> IO (Either Error Comment)
- GitHub.Endpoints.Repos.Comments: commitCommentsFor :: Name Owner -> Name Repo -> Name Commit -> IO (Either Error (Vector Comment))
- GitHub.Endpoints.Repos.Comments: commitCommentsFor' :: Maybe Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error (Vector Comment))
- GitHub.Endpoints.Repos.Commits: commit :: Name Owner -> Name Repo -> Name Commit -> IO (Either Error Commit)
- GitHub.Endpoints.Repos.Commits: commit' :: Maybe Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error Commit)
- GitHub.Endpoints.Repos.Commits: commitsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Commit))
- GitHub.Endpoints.Repos.Commits: commitsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Commit))
- GitHub.Endpoints.Repos.Commits: commitsWithOptionsFor :: Name Owner -> Name Repo -> [CommitQueryOption] -> IO (Either Error (Vector Commit))
- GitHub.Endpoints.Repos.Commits: commitsWithOptionsFor' :: Maybe Auth -> Name Owner -> Name Repo -> [CommitQueryOption] -> IO (Either Error (Vector Commit))
- GitHub.Endpoints.Repos.Commits: diff :: Name Owner -> Name Repo -> Name Commit -> Name Commit -> IO (Either Error Diff)
- GitHub.Endpoints.Repos.Commits: diff' :: Maybe Auth -> Name Owner -> Name Repo -> Name Commit -> Name Commit -> IO (Either Error Diff)
- GitHub.Endpoints.Repos.Contents: archiveFor :: Name Owner -> Name Repo -> ArchiveFormat -> Maybe Text -> IO (Either Error URI)
- GitHub.Endpoints.Repos.Contents: archiveFor' :: Maybe Auth -> Name Owner -> Name Repo -> ArchiveFormat -> Maybe Text -> IO (Either Error URI)
- GitHub.Endpoints.Repos.Contents: contentsFor :: Name Owner -> Name Repo -> Text -> Maybe Text -> IO (Either Error Content)
- GitHub.Endpoints.Repos.Contents: contentsFor' :: Maybe Auth -> Name Owner -> Name Repo -> Text -> Maybe Text -> IO (Either Error Content)
- GitHub.Endpoints.Repos.Contents: createFile :: Auth -> Name Owner -> Name Repo -> CreateFile -> IO (Either Error ContentResult)
- GitHub.Endpoints.Repos.Contents: deleteFile :: Auth -> Name Owner -> Name Repo -> DeleteFile -> IO (Either Error ())
- GitHub.Endpoints.Repos.Contents: readmeFor :: Name Owner -> Name Repo -> IO (Either Error Content)
- GitHub.Endpoints.Repos.Contents: readmeFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Content)
- GitHub.Endpoints.Repos.Contents: updateFile :: Auth -> Name Owner -> Name Repo -> UpdateFile -> IO (Either Error ContentResult)
- GitHub.Endpoints.Repos.DeployKeys: createRepoDeployKey' :: Auth -> Name Owner -> Name Repo -> NewRepoDeployKey -> IO (Either Error RepoDeployKey)
- GitHub.Endpoints.Repos.DeployKeys: deleteRepoDeployKey' :: Auth -> Name Owner -> Name Repo -> Id RepoDeployKey -> IO (Either Error ())
- GitHub.Endpoints.Repos.DeployKeys: deployKeyFor' :: Auth -> Name Owner -> Name Repo -> Id RepoDeployKey -> IO (Either Error RepoDeployKey)
- GitHub.Endpoints.Repos.DeployKeys: deployKeysFor' :: Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector RepoDeployKey))
- GitHub.Endpoints.Repos.Forks: forksFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Repos.Forks: forksFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Repo))
- GitHub.Endpoints.Repos.Releases: latestRelease :: Name Owner -> Name Repo -> IO (Either Error Release)
- GitHub.Endpoints.Repos.Releases: latestRelease' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Release)
- GitHub.Endpoints.Repos.Releases: release :: Name Owner -> Name Repo -> Id Release -> IO (Either Error Release)
- GitHub.Endpoints.Repos.Releases: release' :: Maybe Auth -> Name Owner -> Name Repo -> Id Release -> IO (Either Error Release)
- GitHub.Endpoints.Repos.Releases: releaseByTagName :: Name Owner -> Name Repo -> Text -> IO (Either Error Release)
- GitHub.Endpoints.Repos.Releases: releaseByTagName' :: Maybe Auth -> Name Owner -> Name Repo -> Text -> IO (Either Error Release)
- GitHub.Endpoints.Repos.Releases: releases :: Name Owner -> Name Repo -> IO (Either Error (Vector Release))
- GitHub.Endpoints.Repos.Releases: releases' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Release))
- GitHub.Endpoints.Repos.Statuses: createStatus :: Auth -> Name Owner -> Name Repo -> Name Commit -> NewStatus -> IO (Either Error Status)
- GitHub.Endpoints.Repos.Statuses: statusFor :: Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error CombinedStatus)
- GitHub.Endpoints.Repos.Statuses: statusesFor :: Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error (Vector Status))
- GitHub.Endpoints.Repos.Webhooks: createRepoWebhook' :: Auth -> Name Owner -> Name Repo -> NewRepoWebhook -> IO (Either Error RepoWebhook)
- GitHub.Endpoints.Repos.Webhooks: deleteRepoWebhook' :: Auth -> Name Owner -> Name Repo -> Id RepoWebhook -> IO (Either Error ())
- GitHub.Endpoints.Repos.Webhooks: editRepoWebhook' :: Auth -> Name Owner -> Name Repo -> Id RepoWebhook -> EditRepoWebhook -> IO (Either Error RepoWebhook)
- GitHub.Endpoints.Repos.Webhooks: pingRepoWebhook' :: Auth -> Name Owner -> Name Repo -> Id RepoWebhook -> IO (Either Error Bool)
- GitHub.Endpoints.Repos.Webhooks: testPushRepoWebhook' :: Auth -> Name Owner -> Name Repo -> Id RepoWebhook -> IO (Either Error Bool)
- GitHub.Endpoints.Repos.Webhooks: webhookFor' :: Auth -> Name Owner -> Name Repo -> Id RepoWebhook -> IO (Either Error RepoWebhook)
- GitHub.Endpoints.Repos.Webhooks: webhooksFor' :: Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector RepoWebhook))
- GitHub.Endpoints.Search: searchCode :: Text -> IO (Either Error (SearchResult Code))
- GitHub.Endpoints.Search: searchCode' :: Maybe Auth -> Text -> IO (Either Error (SearchResult Code))
- GitHub.Endpoints.Search: searchIssues :: Text -> IO (Either Error (SearchResult Issue))
- GitHub.Endpoints.Search: searchIssues' :: Maybe Auth -> Text -> IO (Either Error (SearchResult Issue))
- GitHub.Endpoints.Search: searchRepos :: Text -> IO (Either Error (SearchResult Repo))
- GitHub.Endpoints.Search: searchRepos' :: Maybe Auth -> Text -> IO (Either Error (SearchResult Repo))
- GitHub.Endpoints.Users: userInfoCurrent' :: Auth -> IO (Either Error User)
- GitHub.Endpoints.Users: userInfoFor :: Name User -> IO (Either Error User)
- GitHub.Endpoints.Users: userInfoFor' :: Maybe Auth -> Name User -> IO (Either Error User)
- GitHub.Endpoints.Users.Emails: currentUserEmails' :: Auth -> IO (Either Error (Vector Email))
- GitHub.Endpoints.Users.Emails: currentUserPublicEmails' :: Auth -> IO (Either Error (Vector Email))
- GitHub.Endpoints.Users.Followers: usersFollowedBy :: Name User -> IO (Either Error (Vector SimpleUser))
- GitHub.Endpoints.Users.Followers: usersFollowing :: Name User -> IO (Either Error (Vector SimpleUser))
- GitHub.Endpoints.Users.PublicSSHKeys: createUserPublicSSHKey' :: Auth -> NewPublicSSHKey -> IO (Either Error PublicSSHKey)
- GitHub.Endpoints.Users.PublicSSHKeys: deleteUserPublicSSHKey' :: Auth -> Id PublicSSHKey -> IO (Either Error ())
- GitHub.Endpoints.Users.PublicSSHKeys: publicSSHKey' :: Auth -> Id PublicSSHKey -> IO (Either Error PublicSSHKey)
- GitHub.Endpoints.Users.PublicSSHKeys: publicSSHKeys' :: Auth -> IO (Either Error (Vector PublicSSHKey))
- GitHub.Endpoints.Users.PublicSSHKeys: publicSSHKeysFor' :: Name Owner -> IO (Either Error (Vector PublicSSHKeyBasic))
+ GitHub: createRepoDeployKeyR :: Name Owner -> Name Repo -> NewRepoDeployKey -> Request 'RW RepoDeployKey
+ GitHub: deleteRepoDeployKeyR :: Name Owner -> Name Repo -> Id RepoDeployKey -> GenRequest 'MtUnit 'RW ()
+ GitHub: deployKeyForR :: Name Owner -> Name Repo -> Id RepoDeployKey -> Request 'RA RepoDeployKey
+ GitHub: deployKeysForR :: Name Owner -> Name Repo -> FetchCount -> Request 'RA (Vector RepoDeployKey)
+ GitHub.Data.Repos: [editAllowMergeCommit] :: EditRepo -> !Maybe Bool
+ GitHub.Data.Repos: [editAllowRebaseMerge] :: EditRepo -> !Maybe Bool
+ GitHub.Data.Repos: [editAllowSquashMerge] :: EditRepo -> !Maybe Bool
+ GitHub.Data.Repos: [editArchived] :: EditRepo -> !Maybe Bool
+ GitHub.Data.Repos: [editDefaultBranch] :: EditRepo -> !Maybe Text
+ GitHub.Data.Repos: [editHasProjects] :: EditRepo -> !Maybe Bool
+ GitHub.Data.Repos: [editPrivate] :: EditRepo -> !Maybe Bool
+ GitHub.Data.Repos: [newRepoAllowMergeCommit] :: NewRepo -> !Maybe Bool
+ GitHub.Data.Repos: [newRepoAllowRebaseMerge] :: NewRepo -> !Maybe Bool
+ GitHub.Data.Repos: [newRepoAllowSquashMerge] :: NewRepo -> !Maybe Bool
+ GitHub.Data.Repos: [newRepoGitignoreTemplate] :: NewRepo -> !Maybe Text
+ GitHub.Data.Repos: [newRepoHasProjects] :: NewRepo -> !Maybe Bool
+ GitHub.Data.Repos: [newRepoLicenseTemplate] :: NewRepo -> !Maybe Text
+ GitHub.Data.Repos: [repoDisabled] :: Repo -> !Bool
+ GitHub.Data.Repos: [repoForksCount] :: Repo -> !Int
+ GitHub.Data.Repos: [repoHasPages] :: Repo -> !Maybe Bool
+ GitHub.Data.Repos: [repoHasProjects] :: Repo -> !Maybe Bool
+ GitHub.Data.Repos: [repoOpenIssuesCount] :: Repo -> !Int
+ GitHub.Data.Repos: [repoWatchersCount] :: Repo -> !Int
+ GitHub.Endpoints.GitData.References: namespacedReferencesR :: Name Owner -> Name Repo -> Text -> Request k [GitReference]
+ GitHub.Request: class GitHubRO req res | req -> res
+ GitHub.Request: class GitHubRW req res | req -> res
+ GitHub.Request: github :: (AuthMethod am, GitHubRW req res) => am -> req -> res
+ GitHub.Request: github' :: GitHubRO req res => req -> res
+ GitHub.Request: instance (GitHub.Request.ParseResponse mt req, res Data.Type.Equality.~ Data.Either.Either GitHub.Data.Definitions.Error req) => GitHub.Request.GitHubRW (GitHub.Data.Request.GenRequest mt rw req) (GHC.Types.IO res)
+ GitHub.Request: instance (GitHub.Request.ParseResponse mt req, res Data.Type.Equality.~ Data.Either.Either GitHub.Data.Definitions.Error req, rw Data.Type.Equality.~ 'GitHub.Data.Request.RO) => GitHub.Request.GitHubRO (GitHub.Data.Request.GenRequest mt rw req) (GHC.Types.IO res)
+ GitHub.Request: instance GitHub.Request.GitHubRO req res => GitHub.Request.GitHubRO (a -> req) (a -> res)
+ GitHub.Request: instance GitHub.Request.GitHubRW req res => GitHub.Request.GitHubRW (a -> req) (a -> res)
- GitHub: pullRequestReviewCommentsR :: Name Owner -> Name Repo -> Id PullRequest -> Id Review -> Request k [ReviewComment]
+ GitHub: pullRequestReviewCommentsR :: Name Owner -> Name Repo -> IssueNumber -> Id Review -> Request k [ReviewComment]
- GitHub: pullRequestReviewR :: Name Owner -> Name Repo -> Id PullRequest -> Id Review -> Request k Review
+ GitHub: pullRequestReviewR :: Name Owner -> Name Repo -> IssueNumber -> Id Review -> Request k Review
- GitHub: pullRequestReviewsR :: Name Owner -> Name Repo -> Id PullRequest -> FetchCount -> Request k (Vector Review)
+ GitHub: pullRequestReviewsR :: Name Owner -> Name Repo -> IssueNumber -> FetchCount -> Request k (Vector Review)
- GitHub.Data.Repos: EditRepo :: !Maybe (Name Repo) -> !Maybe Text -> !Maybe Text -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> EditRepo
+ GitHub.Data.Repos: EditRepo :: !Maybe (Name Repo) -> !Maybe Text -> !Maybe Text -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Text -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> EditRepo
- GitHub.Data.Repos: NewRepo :: !Name Repo -> !Maybe Text -> !Maybe Text -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> NewRepo
+ GitHub.Data.Repos: NewRepo :: !Name Repo -> !Maybe Text -> !Maybe Text -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Text -> !Maybe Text -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> NewRepo
- GitHub.Data.Repos: Repo :: !Maybe URL -> !Maybe Text -> !Maybe UTCTime -> !URL -> !Maybe URL -> !Maybe Int -> !Maybe Text -> !Maybe Bool -> !Maybe URL -> !Bool -> !Bool -> !Maybe URL -> !Maybe Int -> !Maybe UTCTime -> !Maybe Int -> !SimpleOwner -> !Name Repo -> !Maybe Language -> !Maybe Text -> !Maybe UTCTime -> !Id Repo -> !URL -> !Maybe Int -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe RepoRef -> !Maybe RepoRef -> !URL -> !Int -> Repo
+ GitHub.Data.Repos: Repo :: !Id Repo -> !Name Repo -> !SimpleOwner -> !Bool -> !URL -> !Maybe Text -> !Maybe Bool -> !URL -> !Maybe URL -> !Maybe URL -> !Maybe URL -> !URL -> !Maybe URL -> !Maybe Text -> !Maybe Language -> !Int -> !Int -> !Int -> !Maybe Int -> !Maybe Text -> !Int -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Maybe Bool -> !Bool -> !Bool -> !Maybe UTCTime -> !Maybe UTCTime -> !Maybe UTCTime -> Repo
- GitHub.Endpoints.PullRequests.Reviews: pullRequestReviewCommentsR :: Name Owner -> Name Repo -> Id PullRequest -> Id Review -> Request k [ReviewComment]
+ GitHub.Endpoints.PullRequests.Reviews: pullRequestReviewCommentsR :: Name Owner -> Name Repo -> IssueNumber -> Id Review -> Request k [ReviewComment]
- GitHub.Endpoints.PullRequests.Reviews: pullRequestReviewR :: Name Owner -> Name Repo -> Id PullRequest -> Id Review -> Request k Review
+ GitHub.Endpoints.PullRequests.Reviews: pullRequestReviewR :: Name Owner -> Name Repo -> IssueNumber -> Id Review -> Request k Review
- GitHub.Endpoints.PullRequests.Reviews: pullRequestReviewsR :: Name Owner -> Name Repo -> Id PullRequest -> FetchCount -> Request k (Vector Review)
+ GitHub.Endpoints.PullRequests.Reviews: pullRequestReviewsR :: Name Owner -> Name Repo -> IssueNumber -> FetchCount -> Request k (Vector Review)
Files
- CHANGELOG.md +18/−1
- README.md +4/−3
- github.cabal +2/−2
- spec/GitHub/ActivitySpec.hs +0/−1
- spec/GitHub/CommitsSpec.hs +8/−12
- spec/GitHub/OrganizationsSpec.hs +5/−4
- spec/GitHub/PublicSSHKeysSpec.hs +5/−6
- spec/GitHub/PullRequestReviewsSpec.hs +2/−2
- spec/GitHub/ReleasesSpec.hs +0/−1
- spec/GitHub/ReposSpec.hs +10/−10
- spec/GitHub/SearchSpec.hs +3/−2
- spec/GitHub/UsersSpec.hs +11/−11
- src/GitHub.hs +16/−11
- src/GitHub/Data/Repos.hs +115/−80
- src/GitHub/Endpoints/Activity/Notifications.hs +5/−14
- src/GitHub/Endpoints/Activity/Starring.hs +0/−40
- src/GitHub/Endpoints/Activity/Watching.hs +0/−33
- src/GitHub/Endpoints/Gists.hs +0/−52
- src/GitHub/Endpoints/Gists/Comments.hs +0/−17
- src/GitHub/Endpoints/GitData/Blobs.hs +0/−17
- src/GitHub/Endpoints/GitData/Commits.hs +0/−10
- src/GitHub/Endpoints/GitData/References.hs +2/−46
- src/GitHub/Endpoints/GitData/Trees.hs +0/−31
- src/GitHub/Endpoints/Issues.hs +0/−56
- src/GitHub/Endpoints/Issues/Comments.hs +0/−53
- src/GitHub/Endpoints/Issues/Events.hs +0/−46
- src/GitHub/Endpoints/Issues/Labels.hs +0/−135
- src/GitHub/Endpoints/Issues/Milestones.hs +0/−36
- src/GitHub/Endpoints/Organizations.hs +0/−30
- src/GitHub/Endpoints/Organizations/Members.hs +0/−35
- src/GitHub/Endpoints/Organizations/Teams.hs +0/−127
- src/GitHub/Endpoints/PullRequests.hs +0/−125
- src/GitHub/Endpoints/PullRequests/Comments.hs +0/−27
- src/GitHub/Endpoints/PullRequests/Reviews.hs +3/−91
- src/GitHub/Endpoints/RateLimit.hs +0/−14
- src/GitHub/Endpoints/Repos.hs +0/−194
- src/GitHub/Endpoints/Repos/Collaborators.hs +0/−40
- src/GitHub/Endpoints/Repos/Comments.hs +0/−48
- src/GitHub/Endpoints/Repos/Commits.hs +0/−63
- src/GitHub/Endpoints/Repos/Contents.hs +0/−82
- src/GitHub/Endpoints/Repos/DeployKeys.hs +0/−24
- src/GitHub/Endpoints/Repos/Forks.hs +0/−17
- src/GitHub/Endpoints/Repos/Releases.hs +0/−61
- src/GitHub/Endpoints/Repos/Statuses.hs +0/−29
- src/GitHub/Endpoints/Repos/Webhooks.hs +0/−38
- src/GitHub/Endpoints/Search.hs +0/−49
- src/GitHub/Endpoints/Users.hs +7/−25
- src/GitHub/Endpoints/Users/Emails.hs +0/−17
- src/GitHub/Endpoints/Users/Followers.hs +0/−17
- src/GitHub/Endpoints/Users/PublicSSHKeys.hs +0/−30
- src/GitHub/Request.hs +71/−7
CHANGELOG.md view
@@ -1,3 +1,20 @@+## Changes for 0.24++**Major change**:+Introduce `github` n-ary combinator to hoist `... -> Request rw res`+into `... -> IO (Either Error res)` (i.e. n-ary `executeRequest`).+With that in place drop `.. -> IO (Either Error res)` functions.++This reduces symbol bloat in the library.+[#415](https://github.com/phadej/github/pull/415)++- Remove double `withOpenSSL`+ [#414](https://github.com/phadej/github/pull/414)+- Pull requests reviews API uses issue number+ [#409](https://github.com/phadej/github/pull/409)+- Update `Repo`, `NewRepo` and `EditRepo` data types+ [#407](https://github.com/phadej/github/pull/407)+ ## Changes for 0.23 - Escape URI paths@@ -93,7 +110,7 @@ ## Changes for 0.18 -- Endpoints for deleting issue comments. +- Endpoints for deleting issue comments. [#294](https://github.com/phadej/github/pull/294) - Endpoints for (un)starring gists. [#296](https://github.com/phadej/github/pull/296)
README.md view
@@ -63,11 +63,12 @@ import Data.Text.IO as T (putStrLn) import Data.Monoid ((<>)) -import qualified GitHub.Endpoints.Users.Followers as GitHub+import GitHub (github')+import qualified GitHub main :: IO () main = do- possibleUsers <- GitHub.usersFollowing "mike-burns"+ possibleUsers <- github GitHub.usersFollowingR "phadej" T.putStrLn $ either (("Error: " <>) . pack . show) (foldMap ((<> "\n") . formatUser)) possibleUsers@@ -98,7 +99,7 @@ Copyright 2011-2012 Mike Burns. Copyright 2013-2015 John Wiegley.-Copyright 2016 Oleg Grenrus.+Copyright 2016-2019 Oleg Grenrus. Available under the BSD 3-clause license.
github.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: github-version: 0.23+version: 0.24 synopsis: Access to the GitHub API, v3. category: Network description:@@ -15,7 +15,7 @@ > > main :: IO () > main = do- > possibleUser <- GH.executeRequest' $ GH.userInfoForR "phadej"+ > possibleUser <- GH.github' GH.userInfoForR "phadej" > print possibleUser . For more of an overview please see the README: <https://github.com/phadej/github/blob/master/README.md>
spec/GitHub/ActivitySpec.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-} module GitHub.ActivitySpec where import qualified GitHub
spec/GitHub/CommitsSpec.hs view
@@ -1,13 +1,9 @@ {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-} module GitHub.CommitsSpec where -import qualified GitHub- import GitHub.Auth (Auth (..))-import GitHub.Endpoints.Repos.Commits (commitSha, commitsFor',- commitsForR, diffR, mkCommitName)-import GitHub.Request (executeRequest)+import GitHub.Endpoints.Repos.Commits (commitSha, commitsForR, diffR, mkCommitName, FetchCount (..))+import GitHub.Request (github) import Control.Monad (forM_) import Data.Either.Compat (isRight)@@ -34,13 +30,13 @@ spec = do describe "commitsFor" $ do it "works" $ withAuth $ \auth -> do- cs <- commitsFor' (Just auth) "phadej" "github"+ cs <- github auth commitsForR "phadej" "github" FetchAll cs `shouldSatisfy` isRight V.length (fromRightS cs) `shouldSatisfy` (> 300) -- Page size is 30, so we get 60 commits it "limits the response" $ withAuth $ \auth -> do- cs <- executeRequest auth $ commitsForR "phadej" "github" (GitHub.FetchAtLeast 40)+ cs <- github auth commitsForR "phadej" "github" (FetchAtLeast 40) cs `shouldSatisfy` isRight let cs' = fromRightS cs V.length cs' `shouldSatisfy` (< 70)@@ -49,19 +45,19 @@ describe "diff" $ do it "works" $ withAuth $ \auth -> do- cs <- executeRequest auth $ commitsForR "phadej" "github" (GitHub.FetchAtLeast 30)+ cs <- github auth commitsForR "phadej" "github" (FetchAtLeast 30) cs `shouldSatisfy` isRight let commits = take 10 . V.toList . fromRightS $ cs let pairs = zip commits $ drop 1 commits forM_ pairs $ \(a, b) -> do- d <- executeRequest auth $ diffR "phadej" "github" (commitSha a) (commitSha b)+ d <- github auth diffR "phadej" "github" (commitSha a) (commitSha b) d `shouldSatisfy` isRight it "issue #155" $ withAuth $ \auth -> do- d <- executeRequest auth $ diffR "nomeata" "codespeed" (mkCommitName "ghc") (mkCommitName "tobami:master")+ d <- github auth diffR "nomeata" "codespeed" (mkCommitName "ghc") (mkCommitName "tobami:master") d `shouldSatisfy` isRight -- diff that includes a commit where a submodule is removed it "issue #339" $ withAuth $ \auth -> do- d <- executeRequest auth $ diffR "scott-fleischman" "repo-remove-submodule" "d03c152482169d809be9b1eab71dcf64d7405f76" "42cfd732b20cd093534f246e630b309186eb485d"+ d <- github auth diffR "scott-fleischman" "repo-remove-submodule" "d03c152482169d809be9b1eab71dcf64d7405f76" "42cfd732b20cd093534f246e630b309186eb485d" d `shouldSatisfy` isRight
spec/GitHub/OrganizationsSpec.hs view
@@ -2,11 +2,12 @@ {-# LANGUAGE TemplateHaskell #-} module GitHub.OrganizationsSpec where +import GitHub (FetchCount (..), github) import GitHub.Auth (Auth (..)) import GitHub.Data (SimpleOrganization (..), SimpleOwner (..), SimpleTeam (..))-import GitHub.Endpoints.Organizations (publicOrganizationsFor')-import GitHub.Endpoints.Organizations.Members (membersOf')+import GitHub.Endpoints.Organizations (publicOrganizationsForR)+import GitHub.Endpoints.Organizations.Members (membersOfR) import Data.Aeson (eitherDecodeStrict) import Data.Either.Compat (isRight)@@ -35,7 +36,7 @@ simpleOrganizationLogin (head $ fromRightS orgs) `shouldBe` "github" it "returns information about the user's organizations" $ withAuth $ \auth -> do- orgs <- publicOrganizationsFor' (Just auth) "mike-burns"+ orgs <- github auth publicOrganizationsForR "mike-burns" FetchAll orgs `shouldSatisfy` isRight describe "teamsOf" $ do@@ -49,5 +50,5 @@ simpleOwnerLogin (head $ fromRightS ms) `shouldBe` "octocat" it "works" $ withAuth $ \auth -> do- ms <- membersOf' (Just auth) "haskell"+ ms <- github auth membersOfR "haskell" FetchAll ms `shouldSatisfy` isRight
spec/GitHub/PublicSSHKeysSpec.hs view
@@ -1,11 +1,10 @@ {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-} module GitHub.PublicSSHKeysSpec where import GitHub- (Auth (..), FetchCount (..), PublicSSHKey (..), executeRequest)+ (Auth (..), FetchCount (..), PublicSSHKey (..),github) import GitHub.Endpoints.Users.PublicSSHKeys- (publicSSHKey', publicSSHKeys', publicSSHKeysForR)+ (publicSSHKeyR, publicSSHKeysR, publicSSHKeysForR) import Data.Either.Compat (isRight) import Data.String (fromString)@@ -29,13 +28,13 @@ spec = do describe "publicSSHKeysFor'" $ do it "works" $ withAuth $ \auth -> do- keys <- executeRequest auth $ publicSSHKeysForR "phadej" FetchAll+ keys <- github auth publicSSHKeysForR "phadej" FetchAll V.length (fromRightS keys) `shouldSatisfy` (> 1) describe "publicSSHKeys' and publicSSHKey'" $ do it "works" $ withAuth $ \auth -> do- keys <- publicSSHKeys' auth+ keys <- github auth publicSSHKeysR V.length (fromRightS keys) `shouldSatisfy` (> 1) - key <- publicSSHKey' auth (publicSSHKeyId $ V.head (fromRightS keys))+ key <- github auth publicSSHKeyR (publicSSHKeyId $ V.head (fromRightS keys)) key `shouldSatisfy` isRight
spec/GitHub/PullRequestReviewsSpec.hs view
@@ -2,7 +2,7 @@ module GitHub.PullRequestReviewsSpec where import qualified GitHub-import GitHub.Data.Id (Id (Id))+import GitHub.Data (IssueNumber (IssueNumber)) import Prelude () import Prelude.Compat@@ -29,4 +29,4 @@ cs `shouldSatisfy` isRight where prs =- [("phadej", "github", Id 268)]+ [("phadej", "github", IssueNumber 268)]
spec/GitHub/ReleasesSpec.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-} module GitHub.ReleasesSpec where import qualified GitHub
spec/GitHub/ReposSpec.hs view
@@ -1,16 +1,16 @@ {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TemplateHaskell #-} module GitHub.ReposSpec where -import GitHub (Auth (..), Repo (..), RepoPublicity (..),- executeRequest, repositoryR)-import GitHub.Endpoints.Repos (currentUserRepos, languagesFor', userRepos')+import GitHub+ (Auth (..), FetchCount (..), Repo (..), RepoPublicity (..), github,+ repositoryR)+import GitHub.Endpoints.Repos (currentUserReposR, languagesForR, userReposR) import Data.Either.Compat (isRight) import Data.String (fromString) import System.Environment (lookupEnv)-import Test.Hspec (Spec, describe, it, pendingWith, shouldBe,- shouldSatisfy)+import Test.Hspec+ (Spec, describe, it, pendingWith, shouldBe, shouldSatisfy) import qualified Data.HashMap.Strict as HM @@ -29,7 +29,7 @@ spec = do describe "repositoryR" $ do it "works" $ withAuth $ \auth -> do- er <- executeRequest auth $ repositoryR "phadej" "github"+ er <- github auth repositoryR "phadej" "github" er `shouldSatisfy` isRight let Right r = er -- https://github.com/phadej/github/pull/219@@ -37,16 +37,16 @@ describe "currentUserRepos" $ do it "works" $ withAuth $ \auth -> do- cs <- currentUserRepos auth RepoPublicityAll+ cs <- github auth currentUserReposR RepoPublicityAll FetchAll cs `shouldSatisfy` isRight describe "userRepos" $ do it "works" $ withAuth $ \auth -> do- cs <- userRepos' (Just auth) "phadej" RepoPublicityAll+ cs <- github auth userReposR "phadej" RepoPublicityAll FetchAll cs `shouldSatisfy` isRight describe "languagesFor'" $ do it "works" $ withAuth $ \auth -> do- ls <- languagesFor' (Just auth) "phadej" "github"+ ls <- github auth languagesForR "phadej" "github" ls `shouldSatisfy` isRight fromRightS ls `shouldSatisfy` HM.member "Haskell"
spec/GitHub/SearchSpec.hs view
@@ -14,9 +14,10 @@ import qualified Data.Vector as V +import GitHub (github) import GitHub.Data (Auth (..), Issue (..), IssueNumber (..), IssueState (..), mkId)-import GitHub.Endpoints.Search (SearchResult (..), searchIssues')+import GitHub.Endpoints.Search (SearchResult (..), searchIssuesR) fromRightS :: Show a => Either a b -> b fromRightS (Right b) = b@@ -53,6 +54,6 @@ it "performs an issue search via the API" $ withAuth $ \auth -> do let query = "Decouple in:title repo:phadej/github created:<=2015-12-01"- issues <- searchResultResults . fromRightS <$> searchIssues' (Just auth) query+ issues <- searchResultResults . fromRightS <$> github auth searchIssuesR query length issues `shouldBe` 1 issueId (V.head issues) `shouldBe` mkId (Proxy :: Proxy Issue) 119694665
spec/GitHub/UsersSpec.hs view
@@ -15,9 +15,9 @@ import GitHub.Data (Auth (..), Organization (..), User (..), fromOwner) import GitHub.Endpoints.Users- (ownerInfoForR, userInfoCurrent', userInfoFor')+ (ownerInfoForR, userInfoCurrentR, userInfoForR) import GitHub.Endpoints.Users.Followers (usersFollowedByR, usersFollowingR)-import GitHub.Request (executeRequest)+import GitHub.Request (github) fromRightS :: Show a => Either a b -> b fromRightS (Right b) = b@@ -46,37 +46,37 @@ userLogin (fromRightS userInfo) `shouldBe` "mike-burns" it "returns information about the user" $ withAuth $ \auth -> do- userInfo <- userInfoFor' (Just auth) "mike-burns"+ userInfo <- github auth userInfoForR "mike-burns" userLogin (fromRightS userInfo) `shouldBe` "mike-burns" it "catches http exceptions" $ withAuth $ \auth -> do- userInfo <- userInfoFor' (Just auth) "i-hope-this-user-will-never-exist"+ userInfo <- github auth userInfoForR "i-hope-this-user-will-never-exist" userInfo `shouldSatisfy` isLeft it "should fail for organization" $ withAuth $ \auth -> do- userInfo <- userInfoFor' (Just auth) "haskell"+ userInfo <- github auth userInfoForR "haskell" userInfo `shouldSatisfy` isLeft describe "ownerInfoFor" $ do it "works for users and organizations" $ withAuth $ \auth -> do- a <- executeRequest auth $ ownerInfoForR "haskell"- b <- executeRequest auth $ ownerInfoForR "phadej"+ a <- github auth ownerInfoForR "haskell"+ b <- github auth ownerInfoForR "phadej" a `shouldSatisfy` isRight b `shouldSatisfy` isRight (organizationLogin . fromRightS . fromOwner . fromRightS $ a) `shouldBe` "haskell" (userLogin . fromLeftS . fromOwner . fromRightS $ b) `shouldBe` "phadej" - describe "userInfoCurrent'" $ do+ describe "userInfoCurrentR" $ do it "returns information about the autenticated user" $ withAuth $ \auth -> do- userInfo <- userInfoCurrent' auth+ userInfo <- github auth userInfoCurrentR userInfo `shouldSatisfy` isRight describe "usersFollowing" $ do it "works" $ withAuth $ \auth -> do- us <- executeRequest auth $ usersFollowingR "phadej" (GitHub.FetchAtLeast 10)+ us <- github auth usersFollowingR "phadej" (GitHub.FetchAtLeast 10) us `shouldSatisfy` isRight describe "usersFollowedBy" $ do it "works" $ withAuth $ \auth -> do- us <- executeRequest auth $ usersFollowedByR "phadej" (GitHub.FetchAtLeast 10)+ us <- github auth usersFollowedByR "phadej" (GitHub.FetchAtLeast 10) us `shouldSatisfy` isRight
src/GitHub.hs view
@@ -6,11 +6,17 @@ -- This module re-exports all request constructrors and data definitions from -- this package. ----- See "GitHub.Request" module for executing 'Request', or other modules--- of this package (e.g. "GitHub.Endpoints.Users") for already composed versions.+-- See "GitHub.Request" module for executing 'Request', in short+-- use @'github' request@, for example --+-- @+-- 'github' 'userInfoForR'+-- :: 'AuthMethod' am => am -> 'Name' 'User' -> IO (Either 'Error' 'User')+-- @+-- -- The missing endpoints lists show which endpoints we know are missing, there -- might be more.+-- module GitHub ( -- * Activity -- | See <https://developer.github.com/v3/activity/>@@ -146,11 +152,8 @@ -- milestonesR, milestoneR,- createMilestone, createMilestoneR,- updateMilestone, updateMilestoneR,- deleteMilestone, deleteMilestoneR, -- * Organizations@@ -231,14 +234,8 @@ -- * Submit a pull request review -- * Dismiss a pull request review pullRequestReviewsR,- pullRequestReviews,- pullRequestReviews', pullRequestReviewR,- pullRequestReview,- pullRequestReview', pullRequestReviewCommentsR,- pullRequestReviewCommentsIO,- pullRequestReviewCommentsIO', -- * Repositories -- | See <https://developer.github.com/v3/repos/>@@ -283,6 +280,13 @@ commitR, diffR, + -- ** Deploy Keys+ -- | See <https://developer.github.com/v3/repos/keys/>+ deployKeysForR,+ deployKeyForR,+ createRepoDeployKeyR,+ deleteRepoDeployKeyR,+ -- ** Deployments -- | See <https://developer.github.com/v3/repos/deployments/#deployments> --@@ -419,6 +423,7 @@ import GitHub.Endpoints.Repos.Collaborators import GitHub.Endpoints.Repos.Comments import GitHub.Endpoints.Repos.Commits+import GitHub.Endpoints.Repos.DeployKeys import GitHub.Endpoints.Repos.Deployments import GitHub.Endpoints.Repos.Forks import GitHub.Endpoints.Repos.Invitations
src/GitHub/Data/Repos.hs view
@@ -29,36 +29,37 @@ #endif data Repo = Repo- { repoSshUrl :: !(Maybe URL)- , repoDescription :: !(Maybe Text)- , repoCreatedAt :: !(Maybe UTCTime)+ { repoId :: !(Id Repo)+ , repoName :: !(Name Repo)+ , repoOwner :: !SimpleOwner+ , repoPrivate :: !Bool , repoHtmlUrl :: !URL- , repoSvnUrl :: !(Maybe URL)- , repoForks :: !(Maybe Int)- , repoHomepage :: !(Maybe Text)+ , repoDescription :: !(Maybe Text) , repoFork :: !(Maybe Bool)+ , repoUrl :: !URL , repoGitUrl :: !(Maybe URL)- , repoPrivate :: !Bool- , repoArchived :: !Bool+ , repoSshUrl :: !(Maybe URL) , repoCloneUrl :: !(Maybe URL)- , repoSize :: !(Maybe Int)- , repoUpdatedAt :: !(Maybe UTCTime)- , repoWatchers :: !(Maybe Int)- , repoOwner :: !SimpleOwner- , repoName :: !(Name Repo)+ , repoHooksUrl :: !URL+ , repoSvnUrl :: !(Maybe URL)+ , repoHomepage :: !(Maybe Text) , repoLanguage :: !(Maybe Language)+ , repoForksCount :: !Int+ , repoStargazersCount :: !Int+ , repoWatchersCount :: !Int+ , repoSize :: !(Maybe Int) , repoDefaultBranch :: !(Maybe Text)- , repoPushedAt :: !(Maybe UTCTime) -- ^ this is Nothing for new repositories- , repoId :: !(Id Repo)- , repoUrl :: !URL- , repoOpenIssues :: !(Maybe Int)- , repoHasWiki :: !(Maybe Bool)+ , repoOpenIssuesCount :: !Int , repoHasIssues :: !(Maybe Bool)+ , repoHasProjects :: !(Maybe Bool)+ , repoHasWiki :: !(Maybe Bool)+ , repoHasPages :: !(Maybe Bool) , repoHasDownloads :: !(Maybe Bool)- , repoParent :: !(Maybe RepoRef)- , repoSource :: !(Maybe RepoRef)- , repoHooksUrl :: !URL- , repoStargazersCount :: !Int+ , repoArchived :: !Bool+ , repoDisabled :: !Bool+ , repoPushedAt :: !(Maybe UTCTime) -- ^ this is Nothing for new repositories+ , repoCreatedAt :: !(Maybe UTCTime)+ , repoUpdatedAt :: !(Maybe UTCTime) } deriving (Show, Data, Typeable, Eq, Ord, Generic) @@ -75,29 +76,40 @@ instance Binary RepoRef data NewRepo = NewRepo- { newRepoName :: !(Name Repo)- , newRepoDescription :: !(Maybe Text)- , newRepoHomepage :: !(Maybe Text)- , newRepoPrivate :: !(Maybe Bool)- , newRepoHasIssues :: !(Maybe Bool)- , newRepoHasWiki :: !(Maybe Bool)- , newRepoAutoInit :: !(Maybe Bool)+ { newRepoName :: !(Name Repo)+ , newRepoDescription :: !(Maybe Text)+ , newRepoHomepage :: !(Maybe Text)+ , newRepoPrivate :: !(Maybe Bool)+ , newRepoHasIssues :: !(Maybe Bool)+ , newRepoHasProjects :: !(Maybe Bool)+ , newRepoHasWiki :: !(Maybe Bool)+ , newRepoAutoInit :: !(Maybe Bool)+ , newRepoGitignoreTemplate :: !(Maybe Text)+ , newRepoLicenseTemplate :: !(Maybe Text)+ , newRepoAllowSquashMerge :: !(Maybe Bool)+ , newRepoAllowMergeCommit :: !(Maybe Bool)+ , newRepoAllowRebaseMerge :: !(Maybe Bool) } deriving (Eq, Ord, Show, Data, Typeable, Generic) instance NFData NewRepo where rnf = genericRnf instance Binary NewRepo newRepo :: Name Repo -> NewRepo-newRepo name = NewRepo name Nothing Nothing Nothing Nothing Nothing Nothing+newRepo name = NewRepo name Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing data EditRepo = EditRepo- { editName :: !(Maybe (Name Repo))- , editDescription :: !(Maybe Text)- , editHomepage :: !(Maybe Text)- , editPublic :: !(Maybe Bool)- , editHasIssues :: !(Maybe Bool)- , editHasWiki :: !(Maybe Bool)- , editHasDownloads :: !(Maybe Bool)+ { editName :: !(Maybe (Name Repo))+ , editDescription :: !(Maybe Text)+ , editHomepage :: !(Maybe Text)+ , editPrivate :: !(Maybe Bool)+ , editHasIssues :: !(Maybe Bool)+ , editHasProjects :: !(Maybe Bool)+ , editHasWiki :: !(Maybe Bool)+ , editDefaultBranch :: !(Maybe Text)+ , editAllowSquashMerge :: !(Maybe Bool)+ , editAllowMergeCommit :: !(Maybe Bool)+ , editAllowRebaseMerge :: !(Maybe Bool)+ , editArchived :: !(Maybe Bool) } deriving (Eq, Ord, Show, Data, Typeable, Generic) @@ -149,71 +161,94 @@ -- JSON instances instance FromJSON Repo where- parseJSON = withObject "Repo" $ \o -> Repo <$> o .:? "ssh_url"- <*> o .: "description"- <*> o .:? "created_at"+ parseJSON = withObject "Repo" $ \o -> Repo <$> o .: "id"+ <*> o .: "name"+ <*> o .: "owner"+ <*> o .: "private" <*> o .: "html_url"- <*> o .:? "svn_url"- <*> o .:? "forks"- <*> o .:? "homepage"+ <*> o .:? "description" <*> o .: "fork"+ <*> o .: "url" <*> o .:? "git_url"- <*> o .: "private"- <*> o .:? "archived" .!= False+ <*> o .:? "ssh_url" <*> o .:? "clone_url"- <*> o .:? "size"- <*> o .:? "updated_at"- <*> o .:? "watchers"- <*> o .: "owner"- <*> o .: "name"+ <*> o .: "hooks_url"+ <*> o .:? "svn_url"+ <*> o .:? "homepage" <*> o .:? "language"+ <*> o .: "forks_count"+ <*> o .: "stargazers_count"+ <*> o .: "watchers_count"+ <*> o .:? "size" <*> o .:? "default_branch"- <*> o .:? "pushed_at"- <*> o .: "id"- <*> o .: "url"- <*> o .:? "open_issues"- <*> o .:? "has_wiki"+ <*> o .: "open_issues_count" <*> o .:? "has_issues"+ <*> o .:? "has_projects"+ <*> o .:? "has_wiki"+ <*> o .:? "has_pages" <*> o .:? "has_downloads"- <*> o .:? "parent"- <*> o .:? "source"- <*> o .: "hooks_url"- <*> o .: "stargazers_count"+ <*> o .:? "archived" .!= False+ <*> o .:? "disabled" .!= False+ <*> o .:? "pushed_at"+ <*> o .:? "created_at"+ <*> o .:? "updated_at" instance ToJSON NewRepo where- toJSON (NewRepo { newRepoName = name- , newRepoDescription = description- , newRepoHomepage = homepage- , newRepoPrivate = private- , newRepoHasIssues = hasIssues- , newRepoHasWiki = hasWiki- , newRepoAutoInit = autoInit+ toJSON (NewRepo { newRepoName = name+ , newRepoDescription = description+ , newRepoHomepage = homepage+ , newRepoPrivate = private+ , newRepoHasIssues = hasIssues+ , newRepoHasProjects = hasProjects+ , newRepoHasWiki = hasWiki+ , newRepoAutoInit = autoInit+ , newRepoGitignoreTemplate = gitignoreTemplate+ , newRepoLicenseTemplate = licenseTemplate+ , newRepoAllowSquashMerge = allowSquashMerge+ , newRepoAllowMergeCommit = allowMergeCommit+ , newRepoAllowRebaseMerge = allowRebaseMerge }) = object [ "name" .= name , "description" .= description , "homepage" .= homepage , "private" .= private , "has_issues" .= hasIssues+ , "has_projects" .= hasProjects , "has_wiki" .= hasWiki , "auto_init" .= autoInit+ , "gitignore_template" .= gitignoreTemplate+ , "license_template" .= licenseTemplate+ , "allow_squash_merge" .= allowSquashMerge+ , "allow_merge_commit" .= allowMergeCommit+ , "allow_rebase_merge" .= allowRebaseMerge ] instance ToJSON EditRepo where- toJSON (EditRepo { editName = name- , editDescription = description- , editHomepage = homepage- , editPublic = public- , editHasIssues = hasIssues- , editHasWiki = hasWiki- , editHasDownloads = hasDownloads+ toJSON (EditRepo { editName = name+ , editDescription = description+ , editHomepage = homepage+ , editPrivate = private+ , editHasIssues = hasIssues+ , editHasProjects = hasProjects+ , editHasWiki = hasWiki+ , editDefaultBranch = defaultBranch+ , editAllowSquashMerge = allowSquashMerge+ , editAllowMergeCommit = allowMergeCommit+ , editAllowRebaseMerge = allowRebaseMerge+ , editArchived = archived }) = object- [ "name" .= name- , "description" .= description- , "homepage" .= homepage- , "public" .= public- , "has_issues" .= hasIssues- , "has_wiki" .= hasWiki- , "has_downloads" .= hasDownloads+ [ "name" .= name+ , "description" .= description+ , "homepage" .= homepage+ , "private" .= private+ , "has_issues" .= hasIssues+ , "has_projects" .= hasProjects+ , "has_wiki" .= hasWiki+ , "default_branch" .= defaultBranch+ , "allow_squash_merge" .= allowSquashMerge+ , "allow_merge_commit" .= allowMergeCommit+ , "allow_rebase_merge" .= allowRebaseMerge+ , "archived" .= archived ] instance FromJSON RepoRef where
src/GitHub/Endpoints/Activity/Notifications.hs view
@@ -6,26 +6,21 @@ -- The repo watching API as described on -- <https://developer.github.com/v3/activity/notifications/>. -module GitHub.Endpoints.Activity.Notifications where+module GitHub.Endpoints.Activity.Notifications (+ getNotificationsR,+ markNotificationAsReadR,+ markAllNotificationsAsReadR,+ ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () -getNotifications :: Auth -> IO (Either Error (Vector Notification))-getNotifications auth =- executeRequest auth $ getNotificationsR FetchAll- -- | List your notifications. -- See <https://developer.github.com/v3/activity/notifications/#list-your-notifications> getNotificationsR :: FetchCount -> Request 'RA (Vector Notification) getNotificationsR = pagedQuery ["notifications"] [] -markNotificationAsRead :: Auth -> Id Notification -> IO (Either Error ())-markNotificationAsRead auth nid =- executeRequest auth $ markNotificationAsReadR nid- -- | Mark a thread as read. -- See <https://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read> markNotificationAsReadR :: Id Notification -> GenRequest 'MtUnit 'RW ()@@ -33,10 +28,6 @@ Patch ["notifications", "threads", toPathPart nid] (encode ())--markNotificationsAsRead :: Auth -> IO (Either Error ())-markNotificationsAsRead auth =- executeRequest auth markAllNotificationsAsReadR -- | Mark as read. -- See <https://developer.github.com/v3/activity/notifications/#mark-as-read>
src/GitHub/Endpoints/Activity/Starring.hs view
@@ -6,17 +6,11 @@ -- The repo starring API as described on -- <https://developer.github.com/v3/activity/starring/>. module GitHub.Endpoints.Activity.Starring (- stargazersFor, stargazersForR,- reposStarredBy, reposStarredByR,- myStarred, myStarredR,- myStarredAcceptStar, myStarredAcceptStarR,- starRepo, starRepoR,- unstarRepo, unstarRepoR, module GitHub.Data, ) where@@ -24,29 +18,14 @@ import GitHub.Auth import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | The list of users that have starred the specified Github repo.------ > userInfoFor' Nothing "mike-burns"-stargazersFor :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))-stargazersFor auth user repo =- executeRequestMaybe auth $ stargazersForR user repo FetchAll- -- | List Stargazers. -- See <https://developer.github.com/v3/activity/starring/#list-stargazers> stargazersForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector SimpleUser) stargazersForR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "stargazers"] [] --- | All the public repos starred by the specified user.------ > reposStarredBy Nothing "croaky"-reposStarredBy :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Repo))-reposStarredBy auth user =- executeRequestMaybe auth $ reposStarredByR user FetchAll- -- | List repositories being starred. -- See <https://developer.github.com/v3/activity/starring/#list-repositories-being-starred> reposStarredByR :: Name Owner -> FetchCount -> Request k (Vector Repo)@@ -54,40 +33,21 @@ pagedQuery ["users", toPathPart user, "starred"] [] -- | All the repos starred by the authenticated user.-myStarred :: Auth -> IO (Either Error (Vector Repo))-myStarred auth =- executeRequest auth $ myStarredR FetchAll---- | All the repos starred by the authenticated user. -- See <https://developer.github.com/v3/activity/starring/#list-repositories-being-starred> myStarredR :: FetchCount -> Request 'RA (Vector Repo) myStarredR = pagedQuery ["user", "starred"] [] - -- | All the repos starred by the authenticated user.-myStarredAcceptStar :: Auth -> IO (Either Error (Vector RepoStarred))-myStarredAcceptStar auth =- executeRequest auth $ myStarredAcceptStarR FetchAll---- | All the repos starred by the authenticated user. -- See <https://developer.github.com/v3/activity/starring/#alternative-response-with-star-creation-timestamps-1> myStarredAcceptStarR :: FetchCount -> GenRequest 'MtStar 'RA (Vector RepoStarred) myStarredAcceptStarR = PagedQuery ["user", "starred"] [] -- | Star a repo by the authenticated user.-starRepo :: Auth -> Name Owner -> Name Repo -> IO (Either Error ())-starRepo auth user repo = executeRequest auth $ starRepoR user repo---- | Star a repo by the authenticated user. -- See <https://developer.github.com/v3/activity/starring/#star-a-repository> starRepoR :: Name Owner -> Name Repo -> GenRequest 'MtUnit 'RW () starRepoR user repo = Command Put paths mempty where paths = ["user", "starred", toPathPart user, toPathPart repo]---- | Unstar a repo by the authenticated user.-unstarRepo :: Auth -> Name Owner -> Name Repo -> IO (Either Error ())-unstarRepo auth user repo = executeRequest auth $ unstarRepoR user repo -- | Unstar a repo by the authenticated user. -- See <https://developer.github.com/v3/activity/starring/#unstar-a-repository>
src/GitHub/Endpoints/Activity/Watching.hs view
@@ -6,11 +6,7 @@ -- The repo watching API as described on -- <https://developer.github.com/v3/activity/watching/>. module GitHub.Endpoints.Activity.Watching (- watchersFor,- watchersFor', watchersForR,- reposWatchedBy,- reposWatchedBy', reposWatchedByR, module GitHub.Data, ) where@@ -18,42 +14,13 @@ import GitHub.Auth import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | The list of users that are watching the specified Github repo.------ > watchersFor "thoughtbot" "paperclip"-watchersFor :: Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))-watchersFor = watchersFor' Nothing---- | The list of users that are watching the specified Github repo.--- With authentication------ > watchersFor' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"-watchersFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))-watchersFor' auth user repo =- executeRequestMaybe auth $ watchersForR user repo FetchAll- -- | List watchers. -- See <https://developer.github.com/v3/activity/watching/#list-watchers> watchersForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector SimpleUser) watchersForR user repo limit = pagedQuery ["repos", toPathPart user, toPathPart repo, "watchers"] [] limit---- | All the public repos watched by the specified user.------ > reposWatchedBy "croaky"-reposWatchedBy :: Name Owner -> IO (Either Error (Vector Repo))-reposWatchedBy = reposWatchedBy' Nothing---- | All the public repos watched by the specified user.--- With authentication------ > reposWatchedBy' (Just $ BasicAuth "github-username" "github-password") "croaky"-reposWatchedBy' :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Repo))-reposWatchedBy' auth user =- executeRequestMaybe auth $ reposWatchedByR user FetchAll -- | List repositories being watched. -- See <https://developer.github.com/v3/activity/watching/#list-repositories-being-watched>
src/GitHub/Endpoints/Gists.hs view
@@ -5,57 +5,23 @@ -- -- The gists API as described at <http://developer.github.com/v3/gists/>. module GitHub.Endpoints.Gists (- gists,- gists', gistsR,- gist,- gist', gistR,- starGist, starGistR,- unstarGist, unstarGistR,- deleteGist, deleteGistR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | The list of all gists created by the user------ > gists' (Just $ BasicAuth "github-username" "github-password") "mike-burns"-gists' :: Maybe Auth -> Name Owner -> IO (Either Error (Vector Gist))-gists' auth user =- executeRequestMaybe auth $ gistsR user FetchAll---- | The list of all public gists created by the user.------ > gists "mike-burns"-gists :: Name Owner -> IO (Either Error (Vector Gist))-gists = gists' Nothing- -- | List gists. -- See <https://developer.github.com/v3/gists/#list-gists> gistsR :: Name Owner -> FetchCount -> Request k (Vector Gist) gistsR user = pagedQuery ["users", toPathPart user, "gists"] [] --- | A specific gist, given its id, with authentication credentials------ > gist' (Just $ BasicAuth "github-username" "github-password") "225074"-gist' :: Maybe Auth -> Name Gist -> IO (Either Error Gist)-gist' auth gid =- executeRequestMaybe auth $ gistR gid---- | A specific gist, given its id.------ > gist "225074"-gist :: Name Gist -> IO (Either Error Gist)-gist = gist' Nothing- -- | Query a single gist. -- See <https://developer.github.com/v3/gists/#get-a-single-gist> gistR :: Name Gist -> Request k Gist@@ -63,32 +29,14 @@ query ["gists", toPathPart gid] [] -- | Star a gist by the authenticated user.------ > starGist (BasicAuth "github-username" "github-password") "225074"-starGist :: Auth -> Name Gist -> IO (Either Error ())-starGist auth gid = executeRequest auth $ starGistR gid---- | Star a gist by the authenticated user. -- See <https://developer.github.com/v3/gists/#star-a-gist> starGistR :: Name Gist -> GenRequest 'MtUnit 'RW () starGistR gid = Command Put ["gists", toPathPart gid, "star"] mempty -- | Unstar a gist by the authenticated user.------ > unstarGist (BasicAuth "github-username" "github-password") "225074"-unstarGist :: Auth -> Name Gist -> IO (Either Error ())-unstarGist auth gid = executeRequest auth $ unstarGistR gid---- | Unstar a gist by the authenticated user. -- See <https://developer.github.com/v3/gists/#unstar-a-gist> unstarGistR :: Name Gist -> GenRequest 'MtUnit 'RW () unstarGistR gid = Command Delete ["gists", toPathPart gid, "star"] mempty---- | Delete a gist by the authenticated user.------ > deleteGist (BasicAuth "github-username" "github-password") "225074"-deleteGist :: Auth -> Name Gist -> IO (Either Error ())-deleteGist auth gid = executeRequest auth $ deleteGistR gid -- | Delete a gist by the authenticated user. -- See <https://developer.github.com/v3/gists/#delete-a-gist>
src/GitHub/Endpoints/Gists/Comments.hs view
@@ -6,37 +6,20 @@ -- The loving comments people have left on Gists, described on -- <http://developer.github.com/v3/gists/comments/>. module GitHub.Endpoints.Gists.Comments (- commentsOn, commentsOnR,- comment, gistCommentR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | All the comments on a Gist, given the Gist ID.------ > commentsOn "1174060"-commentsOn :: Name Gist -> IO (Either Error (Vector GistComment))-commentsOn gid =- executeRequest' $ commentsOnR gid FetchAll- -- | List comments on a gist. -- See <https://developer.github.com/v3/gists/comments/#list-comments-on-a-gist> commentsOnR :: Name Gist -> FetchCount -> Request k (Vector GistComment) commentsOnR gid = pagedQuery ["gists", toPathPart gid, "comments"] []---- | A specific comment, by the comment ID.------ > comment (Id 62449)-comment :: Id GistComment -> IO (Either Error GistComment)-comment cid =- executeRequest' $ gistCommentR cid -- | Query a single comment. -- See <https://developer.github.com/v3/gists/comments/#get-a-single-comment>
src/GitHub/Endpoints/GitData/Blobs.hs view
@@ -6,29 +6,12 @@ -- The API for dealing with git blobs from Github repos, as described in -- <http://developer.github.com/v3/git/blobs/>. module GitHub.Endpoints.GitData.Blobs (- blob,- blob', blobR, module GitHub.Data, ) where import GitHub.Data-import GitHub.Internal.Prelude-import GitHub.Request import Prelude ()---- | Query a blob by SHA1.------ > blob' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "bc5c51d1ece1ee45f94b056a0f5a1674d7e8cba9"-blob' :: Maybe Auth -> Name Owner -> Name Repo -> Name Blob -> IO (Either Error Blob)-blob' auth user repo sha =- executeRequestMaybe auth $ blobR user repo sha---- | Query a blob by SHA1.------ > blob "thoughtbot" "paperclip" "bc5c51d1ece1ee45f94b056a0f5a1674d7e8cba9"-blob :: Name Owner -> Name Repo -> Name Blob -> IO (Either Error Blob)-blob = blob' Nothing -- | Query a blob. -- See <https://developer.github.com/v3/git/blobs/#get-a-blob>
src/GitHub/Endpoints/GitData/Commits.hs view
@@ -6,22 +6,12 @@ -- The API for underlying git commits of a Github repo, as described on -- <http://developer.github.com/v3/git/commits/>. module GitHub.Endpoints.GitData.Commits (- commit, gitCommitR, module GitHub.Data, ) where import GitHub.Data-import GitHub.Internal.Prelude-import GitHub.Request import Prelude ()---- | A single commit, by SHA1.------ > commit "thoughtbot" "paperclip" "bc5c51d1ece1ee45f94b056a0f5a1674d7e8cba9"-commit :: Name Owner -> Name Repo -> Name GitCommit -> IO (Either Error GitCommit)-commit user repo sha =- executeRequest' $ gitCommitR user repo sha -- | Query a commit. -- See <https://developer.github.com/v3/git/commits/#get-a-commit>
src/GitHub/Endpoints/GitData/References.hs view
@@ -7,55 +7,23 @@ -- see. The git internals documentation will also prove handy for understanding -- these. API documentation at <http://developer.github.com/v3/git/refs/>. module GitHub.Endpoints.GitData.References (- reference,- reference', referenceR,- references,- references', referencesR,- createReference, createReferenceR,- namespacedReferences,+ namespacedReferencesR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | A single reference by the ref name.------ > reference' (Just $ BasicAuth "github-username" "github-password") "mike-burns" "github" "heads/master"-reference' :: Maybe Auth -> Name Owner -> Name Repo -> Name GitReference -> IO (Either Error GitReference)-reference' auth user repo ref =- executeRequestMaybe auth $ referenceR user repo ref---- | A single reference by the ref name.------ > reference "mike-burns" "github" "heads/master"-reference :: Name Owner -> Name Repo -> Name GitReference -> IO (Either Error GitReference)-reference = reference' Nothing---- | Query a reference.+-- | A single reference -- | Query a reference. -- See <https://developer.github.com/v3/git/refs/#get-a-reference> referenceR :: Name Owner -> Name Repo -> Name GitReference -> Request k GitReference referenceR user repo ref = query ["repos", toPathPart user, toPathPart repo, "git", "refs", toPathPart ref] [] --- | The history of references for a repo.------ > references "mike-burns" "github"-references' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector GitReference))-references' auth user repo =- executeRequestMaybe auth $ referencesR user repo FetchAll---- | The history of references for a repo.------ > references "mike-burns" "github"-references :: Name Owner -> Name Repo -> IO (Either Error (Vector GitReference))-references = references' Nothing- -- | Query all References. -- See <https://developer.github.com/v3/git/refs/#get-all-references> referencesR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector GitReference)@@ -63,22 +31,10 @@ pagedQuery ["repos", toPathPart user, toPathPart repo, "git", "refs"] [] -- | Create a reference.-createReference :: Auth -> Name Owner -> Name Repo -> NewGitReference -> IO (Either Error GitReference)-createReference auth user repo newRef =- executeRequest auth $ createReferenceR user repo newRef---- | Create a reference. -- See <https://developer.github.com/v3/git/refs/#create-a-reference> createReferenceR :: Name Owner -> Name Repo -> NewGitReference -> Request 'RW GitReference createReferenceR user repo newRef = command Post ["repos", toPathPart user, toPathPart repo , "git", "refs"] (encode newRef)---- | Limited references by a namespace.------ > namespacedReferences "thoughtbot" "paperclip" "tags"-namespacedReferences :: Name Owner -> Name Repo -> Text -> IO (Either Error [GitReference])-namespacedReferences user repo namespace =- executeRequest' $ namespacedReferencesR user repo namespace -- | Query namespaced references. -- See <https://developer.github.com/v3/git/refs/#get-all-references>
src/GitHub/Endpoints/GitData/Trees.hs view
@@ -6,51 +6,20 @@ -- The underlying tree of SHA1s and files that make up a git repo. The API is -- described on <http://developer.github.com/v3/git/trees/>. module GitHub.Endpoints.GitData.Trees (- tree,- tree', treeR,- nestedTree,- nestedTree', nestedTreeR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | A tree for a SHA1.------ > tree (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "fe114451f7d066d367a1646ca7ac10e689b46844"-tree' :: Maybe Auth -> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)-tree' auth user repo sha =- executeRequestMaybe auth $ treeR user repo sha---- | A tree for a SHA1.------ > tree "thoughtbot" "paperclip" "fe114451f7d066d367a1646ca7ac10e689b46844"-tree :: Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)-tree = tree' Nothing- -- | Query a Tree. -- See <https://developer.github.com/v3/git/trees/#get-a-tree> treeR :: Name Owner -> Name Repo -> Name Tree -> Request k Tree treeR user repo sha = query ["repos", toPathPart user, toPathPart repo, "git", "trees", toPathPart sha] []---- | A recursively-nested tree for a SHA1.------ > nestedTree' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "fe114451f7d066d367a1646ca7ac10e689b46844"-nestedTree' :: Maybe Auth -> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)-nestedTree' auth user repo sha =- executeRequestMaybe auth $ nestedTreeR user repo sha---- | A recursively-nested tree for a SHA1.------ > nestedTree "thoughtbot" "paperclip" "fe114451f7d066d367a1646ca7ac10e689b46844"-nestedTree :: Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)-nestedTree = nestedTree' Nothing -- | Query a Tree Recursively. -- See <https://developer.github.com/v3/git/trees/#get-a-tree-recursively>
src/GitHub/Endpoints/Issues.hs view
@@ -8,16 +8,10 @@ module GitHub.Endpoints.Issues ( currentUserIssuesR, organizationIssuesR,- issue,- issue', issueR,- issuesForRepo,- issuesForRepo', issuesForRepoR,- createIssue, createIssueR, newIssue,- editIssue, editIssueR, editOfIssue, module GitHub.Data,@@ -25,7 +19,6 @@ import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () -- | See <https://developer.github.com/v3/issues/#list-issues>.@@ -38,42 +31,12 @@ organizationIssuesR org opts = pagedQuery ["orgs", toPathPart org, "issues"] (issueModToQueryString opts) --- | Details on a specific issue, given the repo owner and name, and the issue--- number.'------ > issue' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "462"-issue' :: Maybe Auth -> Name Owner -> Name Repo -> Id Issue -> IO (Either Error Issue)-issue' auth user reqRepoName reqIssueNumber =- executeRequestMaybe auth $ issueR user reqRepoName reqIssueNumber---- | Details on a specific issue, given the repo owner and name, and the issue--- number.------ > issue "thoughtbot" "paperclip" (Id "462")-issue :: Name Owner -> Name Repo -> Id Issue -> IO (Either Error Issue)-issue = issue' Nothing- -- | Query a single issue. -- See <https://developer.github.com/v3/issues/#get-a-single-issue> issueR :: Name Owner -> Name Repo -> Id Issue -> Request k Issue issueR user reqRepoName reqIssueNumber = query ["repos", toPathPart user, toPathPart reqRepoName, "issues", toPathPart reqIssueNumber] [] --- | All issues for a repo (given the repo owner and name), with optional--- restrictions as described in the 'IssueRepoMod' data type.------ > issuesForRepo' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" [NoMilestone, OnlyClosed, Mentions "jyurek", Ascending]-issuesForRepo' :: Maybe Auth -> Name Owner -> Name Repo -> IssueRepoMod -> IO (Either Error (Vector Issue))-issuesForRepo' auth user reqRepoName opts =- executeRequestMaybe auth $ issuesForRepoR user reqRepoName opts FetchAll---- | All issues for a repo (given the repo owner and name), with optional--- restrictions as described in the 'IssueRepoMod' data type.------ > issuesForRepo "thoughtbot" "paperclip" [NoMilestone, OnlyClosed, Mentions "jyurek", Ascending]-issuesForRepo :: Name Owner -> Name Repo -> IssueRepoMod -> IO (Either Error (Vector Issue))-issuesForRepo = issuesForRepo' Nothing- -- | List issues for a repository. -- See <https://developer.github.com/v3/issues/#list-issues-for-a-repository> issuesForRepoR :: Name Owner -> Name Repo -> IssueRepoMod -> FetchCount -> Request k (Vector Issue)@@ -87,16 +50,6 @@ newIssue :: Text -> NewIssue newIssue title = NewIssue title Nothing mempty Nothing Nothing ---- | Create a new issue.------ > createIssue (BasicAuth "github-username" "github-password") user repo--- > (newIssue "some_repo") {...}-createIssue :: Auth -> Name Owner -> Name Repo -> NewIssue- -> IO (Either Error Issue)-createIssue auth user repo ni =- executeRequest auth $ createIssueR user repo ni- -- | Create an issue. -- See <https://developer.github.com/v3/issues/#create-an-issue> createIssueR :: Name Owner -> Name Repo -> NewIssue -> Request 'RW Issue@@ -107,15 +60,6 @@ editOfIssue :: EditIssue editOfIssue = EditIssue Nothing Nothing Nothing Nothing Nothing Nothing---- | Edit an issue.------ > editIssue (BasicAuth "github-username" "github-password") user repo issue--- > editOfIssue {...}-editIssue :: Auth -> Name Owner -> Name Repo -> Id Issue -> EditIssue- -> IO (Either Error Issue)-editIssue auth user repo iss edit =- executeRequest auth $ editIssueR user repo iss edit -- | Edit an issue. -- See <https://developer.github.com/v3/issues/#edit-an-issue>
src/GitHub/Endpoints/Issues/Comments.hs view
@@ -6,66 +6,30 @@ -- The Github issue comments API from -- <http://developer.github.com/v3/issues/comments/>. module GitHub.Endpoints.Issues.Comments (- comment, commentR,- comments, commentsR,- comments',- createComment, createCommentR,- deleteComment, deleteCommentR,- editComment, editCommentR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | A specific comment, by ID.------ > comment "thoughtbot" "paperclip" 1468184-comment :: Name Owner -> Name Repo -> Id Comment -> IO (Either Error IssueComment)-comment user repo cid =- executeRequest' $ commentR user repo cid- -- | Query a single comment. -- See <https://developer.github.com/v3/issues/comments/#get-a-single-comment> commentR :: Name Owner -> Name Repo -> Id Comment -> Request k IssueComment commentR user repo cid = query ["repos", toPathPart user, toPathPart repo, "issues", "comments", toPathPart cid] [] --- | All comments on an issue, by the issue's number.------ > comments "thoughtbot" "paperclip" 635-comments :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector IssueComment))-comments = comments' Nothing---- | All comments on an issue, by the issue's number, using authentication.------ > comments' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" 635-comments' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector IssueComment))-comments' auth user repo iid =- executeRequestMaybe auth $ commentsR user repo iid FetchAll- -- | List comments on an issue. -- See <https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue> commentsR :: Name Owner -> Name Repo -> IssueNumber -> FetchCount -> Request k (Vector IssueComment) commentsR user repo iid = pagedQuery ["repos", toPathPart user, toPathPart repo, "issues", toPathPart iid, "comments"] [] --- | Create a new comment.------ > createComment (BasicAuth "github-username" "github-password") user repo issue--- > "some words"-createComment :: Auth -> Name Owner -> Name Repo -> IssueNumber -> Text- -> IO (Either Error Comment)-createComment auth user repo iss body =- executeRequest auth $ createCommentR user repo iss body- -- | Create a comment. -- See <https://developer.github.com/v3/issues/comments/#create-a-comment> createCommentR :: Name Owner -> Name Repo -> IssueNumber -> Text -> Request 'RW Comment@@ -75,29 +39,12 @@ parts = ["repos", toPathPart user, toPathPart repo, "issues", toPathPart iss, "comments"] -- | Edit a comment.------ > editComment (BasicAuth "github-username" "github-password") user repo commentid--- > "new words"-editComment :: Auth -> Name Owner -> Name Repo -> Id Comment -> Text- -> IO (Either Error Comment)-editComment auth user repo commid body =- executeRequest auth $ editCommentR user repo commid body---- | Edit a comment. -- See <https://developer.github.com/v3/issues/comments/#edit-a-comment> editCommentR :: Name Owner -> Name Repo -> Id Comment -> Text -> Request 'RW Comment editCommentR user repo commid body = command Patch parts (encode $ EditComment body) where parts = ["repos", toPathPart user, toPathPart repo, "issues", "comments", toPathPart commid]---- | Delete a comment.------ > deleteComment (BasicAuth "github-username" "github-password") user repo commentid-deleteComment :: Auth -> Name Owner -> Name Repo -> Id Comment- -> IO (Either Error ())-deleteComment auth user repo commid =- executeRequest auth $ deleteCommentR user repo commid -- | Delete a comment. -- See <https://developer.github.com/v3/issues/comments/#delete-a-comment>
src/GitHub/Endpoints/Issues/Events.hs view
@@ -6,73 +6,27 @@ -- The Github issue events API, which is described on -- <http://developer.github.com/v3/issues/events/> module GitHub.Endpoints.Issues.Events (- eventsForIssue,- eventsForIssue', eventsForIssueR,- eventsForRepo,- eventsForRepo', eventsForRepoR,- event,- event', eventR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | All events that have happened on an issue.------ > eventsForIssue "thoughtbot" "paperclip" 49-eventsForIssue :: Name Owner -> Name Repo -> Id Issue -> IO (Either Error (Vector IssueEvent))-eventsForIssue = eventsForIssue' Nothing---- | All events that have happened on an issue, using authentication.------ > eventsForIssue' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" 49-eventsForIssue' :: Maybe Auth -> Name Owner -> Name Repo -> Id Issue -> IO (Either Error (Vector IssueEvent))-eventsForIssue' auth user repo iid =- executeRequestMaybe auth $ eventsForIssueR user repo iid FetchAll- -- | List events for an issue. -- See <https://developer.github.com/v3/issues/events/#list-events-for-an-issue> eventsForIssueR :: Name Owner -> Name Repo -> Id Issue -> FetchCount -> Request k (Vector IssueEvent) eventsForIssueR user repo iid = pagedQuery ["repos", toPathPart user, toPathPart repo, "issues", toPathPart iid, "events"] [] --- | All the events for all issues in a repo.------ > eventsForRepo "thoughtbot" "paperclip"-eventsForRepo :: Name Owner -> Name Repo -> IO (Either Error (Vector IssueEvent))-eventsForRepo = eventsForRepo' Nothing---- | All the events for all issues in a repo, using authentication.------ > eventsForRepo' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"-eventsForRepo' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector IssueEvent))-eventsForRepo' auth user repo =- executeRequestMaybe auth $ eventsForRepoR user repo FetchAll- -- | List events for a repository. -- See <https://developer.github.com/v3/issues/events/#list-events-for-a-repository> eventsForRepoR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector IssueEvent) eventsForRepoR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "issues", "events"] []---- | Details on a specific event, by the event's ID.------ > event "thoughtbot" "paperclip" 5335772-event :: Name Owner -> Name Repo -> Id IssueEvent -> IO (Either Error IssueEvent)-event = event' Nothing---- | Details on a specific event, by the event's ID, using authentication.------ > event' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" 5335772-event' :: Maybe Auth -> Name Owner -> Name Repo -> Id IssueEvent -> IO (Either Error IssueEvent)-event' auth user repo eid =- executeRequestMaybe auth $ eventR user repo eid -- | Query a single event. -- See <https://developer.github.com/v3/issues/events/#get-a-single-event>
src/GitHub/Endpoints/Issues/Labels.hs view
@@ -6,85 +6,36 @@ -- The API for dealing with labels on Github issues as described on -- <http://developer.github.com/v3/issues/labels/>. module GitHub.Endpoints.Issues.Labels (- labelsOnRepo,- labelsOnRepo', labelsOnRepoR,- label,- label', labelR,- createLabel, createLabelR,- updateLabel, updateLabelR,- deleteLabel, deleteLabelR,- labelsOnIssue,- labelsOnIssue', labelsOnIssueR,- addLabelsToIssue, addLabelsToIssueR,- removeLabelFromIssue, removeLabelFromIssueR,- replaceAllLabelsForIssue, replaceAllLabelsForIssueR,- removeAllLabelsFromIssue, removeAllLabelsFromIssueR,- labelsOnMilestone,- labelsOnMilestone', labelsOnMilestoneR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | All the labels available to use on any issue in the repo.------ > labelsOnRepo "thoughtbot" "paperclip"-labelsOnRepo :: Name Owner -> Name Repo -> IO (Either Error (Vector IssueLabel))-labelsOnRepo = labelsOnRepo' Nothing---- | All the labels available to use on any issue in the repo using authentication.------ > labelsOnRepo' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"-labelsOnRepo' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector IssueLabel))-labelsOnRepo' auth user repo =- executeRequestMaybe auth $ labelsOnRepoR user repo FetchAll- -- | List all labels for this repository. -- See <https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository> labelsOnRepoR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector IssueLabel) labelsOnRepoR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "labels"] [] --- | A label by name.------ > label "thoughtbot" "paperclip" "bug"-label :: Name Owner -> Name Repo -> Name IssueLabel -> IO (Either Error IssueLabel)-label = label' Nothing---- | A label by name using authentication.------ > label' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "bug"-label' :: Maybe Auth -> Name Owner -> Name Repo -> Name IssueLabel -> IO (Either Error IssueLabel)-label' auth user repo lbl =- executeRequestMaybe auth $ labelR user repo lbl- -- | Query a single label. -- See <https://developer.github.com/v3/issues/labels/#get-a-single-label> labelR :: Name Owner -> Name Repo -> Name IssueLabel -> Request k IssueLabel labelR user repo lbl = query ["repos", toPathPart user, toPathPart repo, "labels", toPathPart lbl] [] --- | Create a label------ > createLabel (BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "bug" "f29513"-createLabel :: Auth -> Name Owner -> Name Repo -> Name IssueLabel -> String -> IO (Either Error IssueLabel)-createLabel auth user repo lbl color =- executeRequest auth $ createLabelR user repo lbl color- -- | Create a label. -- See <https://developer.github.com/v3/issues/labels/#create-a-label> createLabelR :: Name Owner -> Name Repo -> Name IssueLabel -> String -> Request 'RW IssueLabel@@ -94,19 +45,6 @@ paths = ["repos", toPathPart user, toPathPart repo, "labels"] body = object ["name" .= untagName lbl, "color" .= color] --- | Update a label------ > updateLabel (BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "bug" "new-bug" "ff1111"-updateLabel :: Auth- -> Name Owner- -> Name Repo- -> Name IssueLabel -- ^ old label name- -> Name IssueLabel -- ^ new label name- -> String -- ^ new color- -> IO (Either Error IssueLabel)-updateLabel auth user repo oldLbl newLbl color =- executeRequest auth $ updateLabelR user repo oldLbl newLbl color- -- | Update a label. -- See <https://developer.github.com/v3/issues/labels/#update-a-label> updateLabelR :: Name Owner@@ -121,51 +59,18 @@ paths = ["repos", toPathPart user, toPathPart repo, "labels", toPathPart oldLbl] body = object ["name" .= untagName newLbl, "color" .= color] --- | Delete a label------ > deleteLabel (BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "bug"-deleteLabel :: Auth -> Name Owner -> Name Repo -> Name IssueLabel -> IO (Either Error ())-deleteLabel auth user repo lbl =- executeRequest auth $ deleteLabelR user repo lbl- -- | Delete a label. -- See <https://developer.github.com/v3/issues/labels/#delete-a-label> deleteLabelR :: Name Owner -> Name Repo -> Name IssueLabel -> GenRequest 'MtUnit 'RW () deleteLabelR user repo lbl = Command Delete ["repos", toPathPart user, toPathPart repo, "labels", toPathPart lbl] mempty --- | The labels on an issue in a repo.------ > labelsOnIssue "thoughtbot" "paperclip" 585-labelsOnIssue :: Name Owner -> Name Repo -> Id Issue -> IO (Either Error (Vector IssueLabel))-labelsOnIssue = labelsOnIssue' Nothing---- | The labels on an issue in a repo using authentication.------ > labelsOnIssue' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" (Id 585)-labelsOnIssue' :: Maybe Auth -> Name Owner -> Name Repo -> Id Issue -> IO (Either Error (Vector IssueLabel))-labelsOnIssue' auth user repo iid =- executeRequestMaybe auth $ labelsOnIssueR user repo iid FetchAll- -- | List labels on an issue. -- See <https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue> labelsOnIssueR :: Name Owner -> Name Repo -> Id Issue -> FetchCount -> Request k (Vector IssueLabel) labelsOnIssueR user repo iid = pagedQuery ["repos", toPathPart user, toPathPart repo, "issues", toPathPart iid, "labels"] [] --- | Add labels to an issue.------ > addLabelsToIssue (BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" (Id 585) ["Label1" "Label2"]-addLabelsToIssue :: Foldable f- => Auth- -> Name Owner- -> Name Repo- -> Id Issue- -> f (Name IssueLabel)- -> IO (Either Error (Vector IssueLabel))-addLabelsToIssue auth user repo iid lbls =- executeRequest auth $ addLabelsToIssueR user repo iid lbls- -- | Add lables to an issue. -- See <https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue> addLabelsToIssueR :: Foldable f@@ -180,31 +85,11 @@ paths = ["repos", toPathPart user, toPathPart repo, "issues", toPathPart iid, "labels"] -- | Remove a label from an issue.------ > removeLabelFromIssue (BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" (Id 585) "bug"-removeLabelFromIssue :: Auth -> Name Owner -> Name Repo -> Id Issue -> Name IssueLabel -> IO (Either Error ())-removeLabelFromIssue auth user repo iid lbl =- executeRequest auth $ removeLabelFromIssueR user repo iid lbl---- | Remove a label from an issue. -- See <https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue> removeLabelFromIssueR :: Name Owner -> Name Repo -> Id Issue -> Name IssueLabel -> GenRequest 'MtUnit 'RW () removeLabelFromIssueR user repo iid lbl = Command Delete ["repos", toPathPart user, toPathPart repo, "issues", toPathPart iid, "labels", toPathPart lbl] mempty --- | Replace all labels on an issue. Sending an empty list will remove all labels from the issue.------ > replaceAllLabelsForIssue (BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" (Id 585) ["Label1" "Label2"]-replaceAllLabelsForIssue :: Foldable f- => Auth- -> Name Owner- -> Name Repo- -> Id Issue- -> f (Name IssueLabel)- -> IO (Either Error (Vector IssueLabel))-replaceAllLabelsForIssue auth user repo iid lbls =- executeRequest auth $ replaceAllLabelsForIssueR user repo iid lbls- -- | Replace all labels on an issue. -- See <https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue> --@@ -221,30 +106,10 @@ paths = ["repos", toPathPart user, toPathPart repo, "issues", toPathPart iid, "labels"] -- | Remove all labels from an issue.------ > removeAllLabelsFromIssue (BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" (Id 585)-removeAllLabelsFromIssue :: Auth -> Name Owner -> Name Repo -> Id Issue -> IO (Either Error ())-removeAllLabelsFromIssue auth user repo iid =- executeRequest auth $ removeAllLabelsFromIssueR user repo iid---- | Remove all labels from an issue. -- See <https://developer.github.com/v3/issues/labels/#remove-all-labels-from-an-issue> removeAllLabelsFromIssueR :: Name Owner -> Name Repo -> Id Issue -> GenRequest 'MtUnit 'RW () removeAllLabelsFromIssueR user repo iid = Command Delete ["repos", toPathPart user, toPathPart repo, "issues", toPathPart iid, "labels"] mempty---- | All the labels on a repo's milestone given the milestone ID.------ > labelsOnMilestone "thoughtbot" "paperclip" (Id 2)-labelsOnMilestone :: Name Owner -> Name Repo -> Id Milestone -> IO (Either Error (Vector IssueLabel))-labelsOnMilestone = labelsOnMilestone' Nothing---- | All the labels on a repo's milestone given the milestone ID using authentication.------ > labelsOnMilestone' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" (Id 2)-labelsOnMilestone' :: Maybe Auth -> Name Owner -> Name Repo -> Id Milestone -> IO (Either Error (Vector IssueLabel))-labelsOnMilestone' auth user repo mid =- executeRequestMaybe auth $ labelsOnMilestoneR user repo mid FetchAll -- | Query labels for every issue in a milestone. -- See <https://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone>
src/GitHub/Endpoints/Issues/Milestones.hs view
@@ -6,77 +6,41 @@ -- The milestones API as described on -- <http://developer.github.com/v3/issues/milestones/>. module GitHub.Endpoints.Issues.Milestones (- milestones,- milestones', milestonesR,- milestone, milestoneR,- createMilestone, createMilestoneR,- updateMilestone, updateMilestoneR,- deleteMilestone, deleteMilestoneR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | All milestones in the repo.------ > milestones "thoughtbot" "paperclip"-milestones :: Name Owner -> Name Repo -> IO (Either Error (Vector Milestone))-milestones = milestones' Nothing---- | All milestones in the repo, using authentication.------ > milestones' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"-milestones' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Milestone))-milestones' auth user repo =- executeRequestMaybe auth $ milestonesR user repo FetchAll- -- | List milestones for a repository. -- See <https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository> milestonesR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Milestone) milestonesR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "milestones"] [] --- | Details on a specific milestone, given it's milestone number.------ > milestone "thoughtbot" "paperclip" (Id 2)-milestone :: Name Owner -> Name Repo -> Id Milestone -> IO (Either Error Milestone)-milestone user repo mid =- executeRequest' $ milestoneR user repo mid- -- | Query a single milestone. -- See <https://developer.github.com/v3/issues/milestones/#get-a-single-milestone> milestoneR :: Name Owner -> Name Repo -> Id Milestone -> Request k Milestone milestoneR user repo mid = query ["repos", toPathPart user, toPathPart repo, "milestones", toPathPart mid] [] -createMilestone :: Auth -> Name Owner -> Name Repo -> NewMilestone -> IO (Either Error Milestone)-createMilestone auth user repo mlstn = executeRequest auth $ createMilestoneR user repo mlstn- -- | Create a milestone. -- See <https://developer.github.com/v3/issues/milestones/#create-a-milestone> createMilestoneR :: Name Owner -> Name Repo -> NewMilestone -> Request 'RW Milestone createMilestoneR user repo = command Post ["repos", toPathPart user, toPathPart repo, "milestones"] . encode -updateMilestone :: Auth -> Name Owner -> Name Repo -> Id Milestone -> UpdateMilestone -> IO (Either Error Milestone)-updateMilestone auth user repo mid mlstn = executeRequest auth $ updateMilestoneR user repo mid mlstn- -- | Update a milestone. -- See <https://developer.github.com/v3/issues/milestones/#update-a-milestone> updateMilestoneR :: Name Owner -> Name Repo -> Id Milestone -> UpdateMilestone -> Request 'RW Milestone updateMilestoneR user repo mid = command Patch ["repos", toPathPart user, toPathPart repo, "milestones", toPathPart mid ] . encode--deleteMilestone :: Auth -> Name Owner -> Name Repo -> Id Milestone -> IO (Either Error ())-deleteMilestone auth user repo mid = executeRequest auth $ deleteMilestoneR user repo mid -- | Delete a milestone. -- See <https://developer.github.com/v3/issues/milestones/#delete-a-milestone>
src/GitHub/Endpoints/Organizations.hs view
@@ -5,11 +5,7 @@ -- -- The orgs API as described on <http://developer.github.com/v3/orgs/>. module GitHub.Endpoints.Organizations (- publicOrganizationsFor,- publicOrganizationsFor', publicOrganizationsForR,- publicOrganization,- publicOrganization', publicOrganizationR, organizationsR, module GitHub.Data,@@ -17,22 +13,8 @@ import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | The public organizations for a user, given the user's login, with authorization------ > publicOrganizationsFor' (Just $ BasicAuth "github-username" "github-password") "mike-burns"-publicOrganizationsFor' :: Maybe Auth -> Name User -> IO (Either Error (Vector SimpleOrganization))-publicOrganizationsFor' auth org =- executeRequestMaybe auth $ publicOrganizationsForR org FetchAll---- | List user organizations. The public organizations for a user, given the user's login.------ > publicOrganizationsFor "mike-burns"-publicOrganizationsFor :: Name User -> IO (Either Error (Vector SimpleOrganization))-publicOrganizationsFor = publicOrganizationsFor' Nothing- -- | List all user organizations. -- See <https://developer.github.com/v3/orgs/#list-your-organizations> organizationsR :: FetchCount -> Request k (Vector SimpleOrganization)@@ -42,18 +24,6 @@ -- See <https://developer.github.com/v3/orgs/#list-user-organizations> publicOrganizationsForR :: Name User -> FetchCount -> Request k (Vector SimpleOrganization) publicOrganizationsForR user = pagedQuery ["users", toPathPart user, "orgs"] []---- | Details on a public organization. Takes the organization's login.------ > publicOrganization' (Just $ BasicAuth "github-username" "github-password") "thoughtbot"-publicOrganization' :: Maybe Auth -> Name Organization -> IO (Either Error Organization)-publicOrganization' auth = executeRequestMaybe auth . publicOrganizationR---- | Query an organization. Details on a public organization. Takes the organization's login.------ > publicOrganization "thoughtbot"-publicOrganization :: Name Organization -> IO (Either Error Organization)-publicOrganization = publicOrganization' Nothing -- | Query an organization. -- See <https://developer.github.com/v3/orgs/#get-an-organization>
src/GitHub/Endpoints/Organizations/Members.hs view
@@ -6,12 +6,8 @@ -- The organization members API as described on -- <http://developer.github.com/v3/orgs/members/>. module GitHub.Endpoints.Organizations.Members (- membersOf,- membersOf', membersOfR, membersOfWithR,- isMemberOf,- isMemberOf', isMemberOfR, orgInvitationsR, module GitHub.Data,@@ -19,24 +15,8 @@ import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | All the users who are members of the specified organization,--- | with or without authentication.------ > membersOf' (Just $ OAuth "token") "thoughtbot"-membersOf' :: Maybe Auth -> Name Organization -> IO (Either Error (Vector SimpleUser))-membersOf' auth org =- executeRequestMaybe auth $ membersOfR org FetchAll---- | All the users who are members of the specified organization,--- | without authentication.------ > membersOf "thoughtbot"-membersOf :: Name Organization -> IO (Either Error (Vector SimpleUser))-membersOf = membersOf' Nothing- -- | All the users who are members of the specified organization. -- -- See <https://developer.github.com/v3/orgs/members/#members-list>@@ -58,21 +38,6 @@ OrgMemberRoleAll -> "all" OrgMemberRoleAdmin -> "admin" OrgMemberRoleMember -> "member"---- | Check if a user is a member of an organization,--- | with or without authentication.------ > isMemberOf' (Just $ OAuth "token") "phadej" "haskell-infra"-isMemberOf' :: Maybe Auth -> Name User -> Name Organization -> IO (Either Error Bool)-isMemberOf' auth user org =- executeRequestMaybe auth $ isMemberOfR user org---- | Check if a user is a member of an organization,--- | without authentication.------ > isMemberOf "phadej" "haskell-infra"-isMemberOf :: Name User -> Name Organization -> IO (Either Error Bool)-isMemberOf = isMemberOf' Nothing -- | Check if a user is a member of an organization. --
src/GitHub/Endpoints/Organizations/Teams.hs view
@@ -6,123 +6,50 @@ -- The Owner teams API as described on -- <http://developer.github.com/v3/orgs/teams/>. module GitHub.Endpoints.Organizations.Teams (- teamsOf,- teamsOf', teamsOfR,- teamInfoFor,- teamInfoFor', teamInfoForR,- createTeamFor', createTeamForR,- editTeam', editTeamR,- deleteTeam', deleteTeamR, listTeamMembersR,- listTeamRepos,- listTeamRepos', listTeamReposR,- addOrUpdateTeamRepo', addOrUpdateTeamRepoR,- teamMembershipInfoFor,- teamMembershipInfoFor', teamMembershipInfoForR,- addTeamMembershipFor', addTeamMembershipForR,- deleteTeamMembershipFor', deleteTeamMembershipForR,- listTeamsCurrent', listTeamsCurrentR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | List teams. List the teams of an Owner.--- When authenticated, lists private teams visible to the authenticated user.--- When unauthenticated, lists only public teams for an Owner.------ > teamsOf' (Just $ OAuth "token") "thoughtbot"-teamsOf' :: Maybe Auth -> Name Organization -> IO (Either Error (Vector SimpleTeam))-teamsOf' auth org =- executeRequestMaybe auth $ teamsOfR org FetchAll---- | List the public teams of an Owner.------ > teamsOf "thoughtbot"-teamsOf :: Name Organization -> IO (Either Error (Vector SimpleTeam))-teamsOf = teamsOf' Nothing- -- | List teams. -- See <https://developer.github.com/v3/orgs/teams/#list-teams> teamsOfR :: Name Organization -> FetchCount -> Request k (Vector SimpleTeam) teamsOfR org = pagedQuery ["orgs", toPathPart org, "teams"] [] --- | The information for a single team, by team id.--- With authentication------ > teamInfoFor' (Just $ OAuth "token") 1010101-teamInfoFor' :: Maybe Auth -> Id Team -> IO (Either Error Team)-teamInfoFor' auth tid =- executeRequestMaybe auth $ teamInfoForR tid---- | The information for a single team, by team id.------ > teamInfoFor' (Just $ OAuth "token") 1010101-teamInfoFor :: Id Team -> IO (Either Error Team)-teamInfoFor = teamInfoFor' Nothing- -- | Query team. -- See <https://developer.github.com/v3/orgs/teams/#get-team> teamInfoForR :: Id Team -> Request k Team teamInfoForR tid = query ["teams", toPathPart tid] [] --- | Create a team under an Owner------ > createTeamFor' (OAuth "token") "Owner" (CreateTeam "newteamname" "some description" [] PermssionPull)-createTeamFor' :: Auth- -> Name Organization- -> CreateTeam- -> IO (Either Error Team)-createTeamFor' auth org cteam =- executeRequest auth $ createTeamForR org cteam- -- | Create team. -- See <https://developer.github.com/v3/orgs/teams/#create-team> createTeamForR :: Name Organization -> CreateTeam -> Request 'RW Team createTeamForR org cteam = command Post ["orgs", toPathPart org, "teams"] (encode cteam) --- | Edit a team, by id.------ > editTeamFor'-editTeam' :: Auth- -> Id Team- -> EditTeam- -> IO (Either Error Team)-editTeam' auth tid eteam =- executeRequest auth $ editTeamR tid eteam- -- | Edit team. -- See <https://developer.github.com/v3/orgs/teams/#edit-team> editTeamR :: Id Team -> EditTeam -> Request 'RW Team editTeamR tid eteam = command Patch ["teams", toPathPart tid] (encode eteam) --- | Delete a team, by id. ----- > deleteTeam' (OAuth "token") 1010101-deleteTeam' :: Auth -> Id Team -> IO (Either Error ())-deleteTeam' auth tid =- executeRequest auth $ deleteTeamR tid---- | Delete team.--- -- See <https://developer.github.com/v3/orgs/teams/#delete-team> deleteTeamR :: Id Team -> GenRequest 'MtUnit 'RW () deleteTeamR tid =@@ -140,89 +67,35 @@ TeamMemberRoleMaintainer -> "maintainer" TeamMemberRoleMember -> "member" --- | The repositories of a single team, by team id.--- With authentication------ > listTeamRepos' (Just $ GitHub.OAuth token) (GitHub.mkTeamId team_id)-listTeamRepos' :: Maybe Auth -> Id Team -> IO (Either Error (Vector Repo))-listTeamRepos' auth tid = executeRequestMaybe auth $ listTeamReposR tid FetchAll- -- | Query team repositories. -- See <https://developer.github.com/v3/orgs/teams/#list-team-repos> listTeamReposR :: Id Team -> FetchCount -> Request k (Vector Repo) listTeamReposR tid = pagedQuery ["teams", toPathPart tid, "repos"] [] --- | Retrieve repositories for a team.------ > listTeamRepos (GitHub.mkTeamId team_id)-listTeamRepos :: Id Team -> IO (Either Error (Vector Repo))-listTeamRepos = listTeamRepos' Nothing---- | Add a repository to a team or update the permission on the repository.------ > addOrUpdateTeamRepo' (OAuth "token") 1010101 "mburns" (Just PermissionPull)-addOrUpdateTeamRepo' :: Auth -> Id Team -> Name Organization -> Name Repo -> Permission -> IO (Either Error ())-addOrUpdateTeamRepo' auth tid org repo permission =- executeRequest auth $ addOrUpdateTeamRepoR tid org repo permission- -- | Add or update a team repository. -- See <https://developer.github.com/v3/orgs/teams/#add-or-update-team-repository> addOrUpdateTeamRepoR :: Id Team -> Name Organization -> Name Repo -> Permission -> GenRequest 'MtUnit 'RW () addOrUpdateTeamRepoR tid org repo permission = Command Put ["teams", toPathPart tid, "repos", toPathPart org, toPathPart repo] (encode $ AddTeamRepoPermission permission) --- | Retrieve team mebership information for a user.--- With authentication------ > teamMembershipInfoFor' (Just $ OAuth "token") 1010101 "mburns"-teamMembershipInfoFor' :: Maybe Auth -> Id Team -> Name Owner -> IO (Either Error TeamMembership)-teamMembershipInfoFor' auth tid user =- executeRequestMaybe auth $ teamMembershipInfoForR tid user- -- | Query team membership. -- See <https://developer.github.com/v3/orgs/teams/#get-team-membership teamMembershipInfoForR :: Id Team -> Name Owner -> Request k TeamMembership teamMembershipInfoForR tid user = query ["teams", toPathPart tid, "memberships", toPathPart user] [] --- | Retrieve team mebership information for a user.------ > teamMembershipInfoFor 1010101 "mburns"-teamMembershipInfoFor :: Id Team -> Name Owner -> IO (Either Error TeamMembership)-teamMembershipInfoFor = teamMembershipInfoFor' Nothing---- | Add (or invite) a member to a team.------ > addTeamMembershipFor' (OAuth "token") 1010101 "mburns" RoleMember-addTeamMembershipFor' :: Auth -> Id Team -> Name Owner -> Role -> IO (Either Error TeamMembership)-addTeamMembershipFor' auth tid user role =- executeRequest auth $ addTeamMembershipForR tid user role- -- | Add team membership. -- See <https://developer.github.com/v3/orgs/teams/#add-team-membership> addTeamMembershipForR :: Id Team -> Name Owner -> Role -> Request 'RW TeamMembership addTeamMembershipForR tid user role = command Put ["teams", toPathPart tid, "memberships", toPathPart user] (encode $ CreateTeamMembership role) --- | Delete a member of a team.------ > deleteTeamMembershipFor' (OAuth "token") 1010101 "mburns"-deleteTeamMembershipFor' :: Auth -> Id Team -> Name Owner -> IO (Either Error ())-deleteTeamMembershipFor' auth tid user =- executeRequest auth $ deleteTeamMembershipForR tid user- -- | Remove team membership. -- See <https://developer.github.com/v3/orgs/teams/#remove-team-membership> deleteTeamMembershipForR :: Id Team -> Name Owner -> GenRequest 'MtUnit 'RW () deleteTeamMembershipForR tid user = Command Delete ["teams", toPathPart tid, "memberships", toPathPart user] mempty---- | List teams for current authenticated user------ > listTeamsCurrent' (OAuth "token")-listTeamsCurrent' :: Auth -> IO (Either Error (Vector Team))-listTeamsCurrent' auth = executeRequest auth $ listTeamsCurrentR FetchAll -- | List user teams. -- See <https://developer.github.com/v3/orgs/teams/#list-user-teams>
src/GitHub/Endpoints/PullRequests.hs view
@@ -6,55 +6,24 @@ -- The pull requests API as documented at -- <http://developer.github.com/v3/pulls/>. module GitHub.Endpoints.PullRequests (- pullRequestsFor,- pullRequestsFor', pullRequestsForR,- pullRequest',- pullRequest, pullRequestR,- pullRequestDiff',- pullRequestDiff, pullRequestDiffR,- pullRequestPatch',- pullRequestPatch, pullRequestPatchR,- createPullRequest, createPullRequestR,- updatePullRequest, updatePullRequestR,- pullRequestCommits',- pullRequestCommitsIO, pullRequestCommitsR,- pullRequestFiles',- pullRequestFiles, pullRequestFilesR,- isPullRequestMerged, isPullRequestMergedR,- mergePullRequest, mergePullRequestR, module GitHub.Data ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () import Data.ByteString.Lazy (ByteString) --- | All open pull requests for the repo, by owner and repo name.------ > pullRequestsFor "rails" "rails"-pullRequestsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector SimplePullRequest))-pullRequestsFor user repo =- executeRequest' $ pullRequestsForR user repo mempty FetchAll---- | All open pull requests for the repo, by owner and repo name.------ > pullRequestsFor "rails" "rails"-pullRequestsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimplePullRequest))-pullRequestsFor' auth user repo =- executeRequestMaybe auth $ pullRequestsForR user repo mempty FetchAll- -- | List pull requests. -- See <https://developer.github.com/v3/pulls/#list-pull-requests> pullRequestsForR@@ -67,71 +36,24 @@ ["repos", toPathPart user, toPathPart repo, "pulls"] (prModToQueryString opts) --- | Obtain the diff of a pull request--- See <https://developer.github.com/v3/pulls/#get-a-single-pull-request>-pullRequestDiff' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error ByteString)-pullRequestDiff' auth user repo prid =- executeRequestMaybe auth $ pullRequestDiffR user repo prid---- | Obtain the diff of a pull request--- See <https://developer.github.com/v3/pulls/#get-a-single-pull-request>-pullRequestDiff :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error ByteString)-pullRequestDiff = pullRequestDiff' Nothing- -- | Query a single pull request to obtain the diff -- See <https://developer.github.com/v3/pulls/#get-a-single-pull-request> pullRequestDiffR :: Name Owner -> Name Repo -> IssueNumber -> GenRequest 'MtDiff rw ByteString pullRequestDiffR user repo prid = Query ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart prid] [] --- | Obtain the patch of a pull request------ See <https://developer.github.com/v3/pulls/#get-a-single-pull-request>-pullRequestPatch' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error ByteString)-pullRequestPatch' auth user repo prid =- executeRequestMaybe auth $ pullRequestPatchR user repo prid---- | Obtain the patch of a pull request--- See <https://developer.github.com/v3/pulls/#get-a-single-pull-request>-pullRequestPatch :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error ByteString)-pullRequestPatch = pullRequestPatch' Nothing- -- | Query a single pull request to obtain the patch -- See <https://developer.github.com/v3/pulls/#get-a-single-pull-request> pullRequestPatchR :: Name Owner -> Name Repo -> IssueNumber -> GenRequest 'MtPatch rw ByteString pullRequestPatchR user repo prid = Query ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart prid] [] --- | A detailed pull request, which has much more information. This takes the--- repo owner and name along with the number assigned to the pull request.--- With authentification.------ > pullRequest' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" 562-pullRequest' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error PullRequest)-pullRequest' auth user repo prid =- executeRequestMaybe auth $ pullRequestR user repo prid---- | A detailed pull request, which has much more information. This takes the--- repo owner and name along with the number assigned to the pull request.------ > pullRequest "thoughtbot" "paperclip" 562-pullRequest :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error PullRequest)-pullRequest = pullRequest' Nothing- -- | Query a single pull request. -- See <https://developer.github.com/v3/pulls/#get-a-single-pull-request> pullRequestR :: Name Owner -> Name Repo -> IssueNumber -> Request k PullRequest pullRequestR user repo prid = query ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart prid] [] -createPullRequest :: Auth- -> Name Owner- -> Name Repo- -> CreatePullRequest- -> IO (Either Error PullRequest)-createPullRequest auth user repo cpr =- executeRequest auth $ createPullRequestR user repo cpr- -- | Create a pull request. -- See <https://developer.github.com/v3/pulls/#create-a-pull-request> createPullRequestR :: Name Owner@@ -141,11 +63,6 @@ createPullRequestR user repo cpr = command Post ["repos", toPathPart user, toPathPart repo, "pulls"] (encode cpr) --- | Update a pull request-updatePullRequest :: Auth -> Name Owner -> Name Repo -> IssueNumber -> EditPullRequest -> IO (Either Error PullRequest)-updatePullRequest auth user repo prid epr =- executeRequest auth $ updatePullRequestR user repo prid epr- -- | Update a pull request. -- See <https://developer.github.com/v3/pulls/#update-a-pull-request> updatePullRequestR :: Name Owner@@ -156,65 +73,23 @@ updatePullRequestR user repo prid epr = command Patch ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart prid] (encode epr) --- | All the commits on a pull request, given the repo owner, repo name, and--- the number of the pull request.--- With authentification.------ > pullRequestCommits' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" 688-pullRequestCommits' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector Commit))-pullRequestCommits' auth user repo prid =- executeRequestMaybe auth $ pullRequestCommitsR user repo prid FetchAll---- | All the commits on a pull request, given the repo owner, repo name, and--- the number of the pull request.------ > pullRequestCommits "thoughtbot" "paperclip" 688-pullRequestCommitsIO :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector Commit))-pullRequestCommitsIO = pullRequestCommits' Nothing- -- | List commits on a pull request. -- See <https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request> pullRequestCommitsR :: Name Owner -> Name Repo -> IssueNumber -> FetchCount -> Request k (Vector Commit) pullRequestCommitsR user repo prid = pagedQuery ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart prid, "commits"] [] --- | The individual files that a pull request patches. Takes the repo owner and--- name, plus the number assigned to the pull request.--- With authentification.------ > pullRequestFiles' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" 688-pullRequestFiles' :: Maybe Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector File))-pullRequestFiles' auth user repo prid =- executeRequestMaybe auth $ pullRequestFilesR user repo prid FetchAll---- | The individual files that a pull request patches. Takes the repo owner and--- name, plus the number assigned to the pull request.------ > pullRequestFiles "thoughtbot" "paperclip" 688-pullRequestFiles :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector File))-pullRequestFiles = pullRequestFiles' Nothing- -- | List pull requests files. -- See <https://developer.github.com/v3/pulls/#list-pull-requests-files> pullRequestFilesR :: Name Owner -> Name Repo -> IssueNumber -> FetchCount -> Request k (Vector File) pullRequestFilesR user repo prid = pagedQuery ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart prid, "files"] [] --- | Check if pull request has been merged.-isPullRequestMerged :: Auth -> Name Owner -> Name Repo -> IssueNumber -> IO (Either Error Bool)-isPullRequestMerged auth user repo prid =- executeRequest auth $ isPullRequestMergedR user repo prid- -- | Query if a pull request has been merged. -- See <https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged> isPullRequestMergedR :: Name Owner -> Name Repo -> IssueNumber -> GenRequest 'MtStatus rw Bool isPullRequestMergedR user repo prid = Query ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart prid, "merge"] []---- | Merge a pull request.-mergePullRequest :: Auth -> Name Owner -> Name Repo -> IssueNumber -> Maybe Text -> IO (Either Error MergeResult)-mergePullRequest auth user repo prid commitMessage =- executeRequest auth $ mergePullRequestR user repo prid commitMessage -- | Merge a pull request (Merge Button). -- https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button
src/GitHub/Endpoints/PullRequests/Comments.hs view
@@ -6,54 +6,27 @@ -- The pull request review comments API as described at -- <http://developer.github.com/v3/pulls/comments/>. module GitHub.Endpoints.PullRequests.Comments (- pullRequestCommentsIO, pullRequestCommentsR,- pullRequestComment, pullRequestCommentR,- createPullComment, createPullCommentR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | All the comments on a pull request with the given ID.------ > pullRequestComments "thoughtbot" "factory_girl" (Id 256)-pullRequestCommentsIO :: Name Owner -> Name Repo -> IssueNumber -> IO (Either Error (Vector Comment))-pullRequestCommentsIO user repo prid =- executeRequest' $ pullRequestCommentsR user repo prid FetchAll- -- | List comments on a pull request. -- See <https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request> pullRequestCommentsR :: Name Owner -> Name Repo -> IssueNumber -> FetchCount -> Request k (Vector Comment) pullRequestCommentsR user repo prid = pagedQuery ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart prid, "comments"] [] --- | One comment on a pull request, by the comment's ID.------ > pullRequestComment "thoughtbot" "factory_girl" (Id 301819)-pullRequestComment :: Name Owner -> Name Repo -> Id Comment -> IO (Either Error Comment)-pullRequestComment user repo cid =- executeRequest' $ pullRequestCommentR user repo cid- -- | Query a single comment. -- See <https://developer.github.com/v3/pulls/comments/#get-a-single-comment> pullRequestCommentR :: Name Owner -> Name Repo -> Id Comment -> Request k Comment pullRequestCommentR user repo cid = query ["repos", toPathPart user, toPathPart repo, "pulls", "comments", toPathPart cid] []---- | Create a new comment.------ > createPullComment (BasicAuth "github-username" "github-password") user repo issue commit path position--- > "some words"-createPullComment :: Auth -> Name Owner -> Name Repo -> IssueNumber -> Text -> Text -> Int -> Text- -> IO (Either Error Comment)-createPullComment auth user repo iss commit path position body =- executeRequest auth $ createPullCommentR user repo iss commit path position body -- | Create a comment. --
src/GitHub/Endpoints/PullRequests/Reviews.hs view
@@ -6,22 +6,14 @@ -- The reviews API as described on <http://developer.github.com/v3/pulls/reviews/>. module GitHub.Endpoints.PullRequests.Reviews ( pullRequestReviewsR- , pullRequestReviews- , pullRequestReviews' , pullRequestReviewR- , pullRequestReview- , pullRequestReview' , pullRequestReviewCommentsR- , pullRequestReviewCommentsIO- , pullRequestReviewCommentsIO' , module GitHub.Data ) where import GitHub.Data import GitHub.Data.Id (Id) import GitHub.Internal.Prelude-import GitHub.Request- (Request, executeRequest', executeRequestMaybe) import Prelude () -- | List reviews for a pull request.@@ -29,7 +21,7 @@ pullRequestReviewsR :: Name Owner -> Name Repo- -> Id PullRequest+ -> IssueNumber -> FetchCount -> Request k (Vector Review) pullRequestReviewsR owner repo prid =@@ -43,37 +35,12 @@ ] [] --- | All reviews for a pull request given the repo owner, repo name and the pull--- request id.------ > pullRequestReviews "thoughtbot" "paperclip" (Id 101)-pullRequestReviews- :: Name Owner- -> Name Repo- -> Id PullRequest- -> IO (Either Error (Vector Review))-pullRequestReviews owner repo prid =- executeRequest' $ pullRequestReviewsR owner repo prid FetchAll---- | All reviews for a pull request given the repo owner, repo name and the pull--- request id. With authentication.------ > pullRequestReviews' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" (Id 101)-pullRequestReviews'- :: Maybe Auth- -> Name Owner- -> Name Repo- -> Id PullRequest- -> IO (Either Error (Vector Review))-pullRequestReviews' auth owner repo pr =- executeRequestMaybe auth $ pullRequestReviewsR owner repo pr FetchAll- -- | Query a single pull request review. -- see <https://developer.github.com/v3/pulls/reviews/#get-a-single-review> pullRequestReviewR :: Name Owner -> Name Repo- -> Id PullRequest+ -> IssueNumber -> Id Review -> Request k Review pullRequestReviewR owner repo prid rid =@@ -88,40 +55,12 @@ ] [] --- | A detailed review on a pull request given the repo owner, repo name, pull--- request id and review id.------ > pullRequestReview "thoughtbot" "factory_girl" (Id 301819) (Id 332)-pullRequestReview- :: Name Owner- -> Name Repo- -> Id PullRequest- -> Id Review- -> IO (Either Error Review)-pullRequestReview owner repo prid rid =- executeRequest' $ pullRequestReviewR owner repo prid rid---- | A detailed review on a pull request given the repo owner, repo name, pull--- request id and review id. With authentication.------ > pullRequestReview' (Just $ BasicAuth "github-username" "github-password")--- > "thoughtbot" "factory_girl" (Id 301819) (Id 332)-pullRequestReview'- :: Maybe Auth- -> Name Owner- -> Name Repo- -> Id PullRequest- -> Id Review- -> IO (Either Error Review)-pullRequestReview' auth owner repo prid rid =- executeRequestMaybe auth $ pullRequestReviewR owner repo prid rid- -- | Query the comments for a single pull request review. -- see <https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review> pullRequestReviewCommentsR :: Name Owner -> Name Repo- -> Id PullRequest+ -> IssueNumber -> Id Review -> Request k [ReviewComment] pullRequestReviewCommentsR owner repo prid rid =@@ -136,30 +75,3 @@ , "comments" ] []---- | All comments for a review on a pull request given the repo owner, repo--- name, pull request id and review id.------ > pullRequestReviewComments "thoughtbot" "factory_girl" (Id 301819) (Id 332)-pullRequestReviewCommentsIO- :: Name Owner- -> Name Repo- -> Id PullRequest- -> Id Review- -> IO (Either Error [ReviewComment])-pullRequestReviewCommentsIO owner repo prid rid =- executeRequest' $ pullRequestReviewCommentsR owner repo prid rid---- | All comments for a review on a pull request given the repo owner, repo--- name, pull request id and review id. With authentication.------ > pullRequestReviewComments' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "factory_girl" (Id 301819) (Id 332)-pullRequestReviewCommentsIO'- :: Maybe Auth- -> Name Owner- -> Name Repo- -> Id PullRequest- -> Id Review- -> IO (Either Error [ReviewComment])-pullRequestReviewCommentsIO' auth owner repo prid rid =- executeRequestMaybe auth $ pullRequestReviewCommentsR owner repo prid rid
src/GitHub/Endpoints/RateLimit.hs view
@@ -7,25 +7,11 @@ -- <http://developer.github.com/v3/rate_limit/>. module GitHub.Endpoints.RateLimit ( rateLimitR,- rateLimit,- rateLimit', module GitHub.Data, ) where import GitHub.Data-import GitHub.Internal.Prelude-import GitHub.Request import Prelude ()---- | Get your current rate limit status (Note: Accessing this endpoint does not count against your rate limit.)--- With authentication.-rateLimit' :: Maybe Auth -> IO (Either Error RateLimit)-rateLimit' auth = executeRequestMaybe auth rateLimitR---- | Get your current rate limit status (Note: Accessing this endpoint does not count against your rate limit.)--- Without authentication.-rateLimit :: IO (Either Error RateLimit)-rateLimit = rateLimit' Nothing -- | Get your current rate limit status. -- <https://developer.github.com/v3/rate_limit/#get-your-current-rate-limit-status>
src/GitHub/Endpoints/Repos.hs view
@@ -7,46 +7,24 @@ -- <http://developer.github.com/v3/repos/> module GitHub.Endpoints.Repos ( -- * Querying repositories- currentUserRepos, currentUserReposR,- userRepos,- userRepos', userReposR,- organizationRepos,- organizationRepos', organizationReposR,- repository,- repository', repositoryR,- contributors,- contributors', contributorsR,- contributorsWithAnonymous,- contributorsWithAnonymous',- languagesFor,- languagesFor', languagesForR,- tagsFor,- tagsFor', tagsForR,- branchesFor,- branchesFor', branchesForR, -- ** Create- createRepo', createRepoR,- createOrganizationRepo', createOrganizationRepoR,- forkExistingRepo', forkExistingRepoR, -- ** Edit- editRepo, editRepoR, -- ** Delete- deleteRepo, deleteRepoR, -- * Data@@ -55,7 +33,6 @@ import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () repoPublicityQueryString :: RepoPublicity -> QueryString@@ -66,11 +43,6 @@ repoPublicityQueryString RepoPublicityPrivate = [("type", Just "private")] -- | List your repositories.-currentUserRepos :: Auth -> RepoPublicity -> IO (Either Error (Vector Repo))-currentUserRepos auth publicity =- executeRequest auth $ currentUserReposR publicity FetchAll---- | List your repositories. -- See <https://developer.github.com/v3/repos/#list-your-repositories> currentUserReposR :: RepoPublicity -> FetchCount -> Request k (Vector Repo) currentUserReposR publicity =@@ -78,25 +50,6 @@ where qs = repoPublicityQueryString publicity --- | The repos for a user, by their login. Can be restricted to just repos they--- own, are a member of, or publicize. Private repos will return empty list.------ > userRepos "mike-burns" All-userRepos :: Name Owner -> RepoPublicity -> IO (Either Error (Vector Repo))-userRepos = userRepos' Nothing---- | The repos for a user, by their login.--- With authentication.------ > userRepos' (Just $ BasicAuth "github-username" "github-password") "mike-burns" All-userRepos'- :: Maybe Auth- -> Name Owner- -> RepoPublicity- -> IO (Either Error (Vector Repo))-userRepos' auth user publicity =- executeRequestMaybe auth $ userReposR user publicity FetchAll- -- | List user repositories. -- See <https://developer.github.com/v3/repos/#list-user-repositories> userReposR :: Name Owner -> RepoPublicity -> FetchCount -> Request k(Vector Repo)@@ -105,24 +58,6 @@ where qs = repoPublicityQueryString publicity --- | The repos for an organization, by the organization name.------ > organizationRepos "thoughtbot"-organizationRepos :: Name Organization -> IO (Either Error (Vector Repo))-organizationRepos org = organizationRepos' Nothing org RepoPublicityAll---- | The repos for an organization, by the organization name.--- With authentication.------ > organizationRepos (Just $ BasicAuth "github-username" "github-password") "thoughtbot" All-organizationRepos'- :: Maybe Auth- -> Name Organization- -> RepoPublicity- -> IO (Either Error (Vector Repo))-organizationRepos' auth org publicity =- executeRequestMaybe auth $ organizationReposR org publicity FetchAll- -- | List organization repositories. -- See <https://developer.github.com/v3/repos/#list-organization-repositories> organizationReposR@@ -135,20 +70,6 @@ where qs = repoPublicityQueryString publicity --- | Details on a specific repo, given the owner and repo name.------ > repository "mike-burns" "github"-repository :: Name Owner -> Name Repo -> IO (Either Error Repo)-repository = repository' Nothing---- | Details on a specific repo, given the owner and repo name.--- With authentication.------ > repository' (Just $ BasicAuth "github-username" "github-password") "mike-burns" "github"-repository' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Repo)-repository' auth user repo =- executeRequestMaybe auth $ repositoryR user repo- -- | Query single repository. -- See <https://developer.github.com/v3/repos/#get> repositoryR :: Name Owner -> Name Repo -> Request k Repo@@ -156,24 +77,12 @@ query ["repos", toPathPart user, toPathPart repo] [] -- | Create a new repository.------ > createRepo' (BasicAuth (user, password)) (newRepo "some_repo") {newRepoHasIssues = Just False}-createRepo' :: Auth -> NewRepo -> IO (Either Error Repo)-createRepo' auth nrepo =- executeRequest auth $ createRepoR nrepo---- | Create a new repository. -- See <https://developer.github.com/v3/repos/#create> createRepoR :: NewRepo -> Request 'RW Repo createRepoR nrepo = command Post ["user", "repos"] (encode nrepo) -- | Fork an existing repository.-forkExistingRepo' :: Auth -> Name Owner -> Name Repo -> Maybe (Name Owner) -> IO (Either Error Repo)-forkExistingRepo' auth owner repo morg =- executeRequest auth $ forkExistingRepoR owner repo morg---- | Fork an existing repository. -- See <https://developer.github.com/v3/repos/forks/#create-a-fork> -- TODO: The third paramater (an optional Organisation) is not used yet. forkExistingRepoR :: Name Owner -> Name Repo -> Maybe (Name Owner) -> Request 'RW Repo@@ -181,32 +90,12 @@ command Post ["repos", toPathPart owner, toPathPart repo, "forks" ] mempty -- | Create a new repository for an organization.------ > createOrganizationRepo (BasicAuth (user, password)) "thoughtbot" (newRepo "some_repo") {newRepoHasIssues = Just False}-createOrganizationRepo' :: Auth -> Name Organization -> NewRepo -> IO (Either Error Repo)-createOrganizationRepo' auth org nrepo =- executeRequest auth $ createOrganizationRepoR org nrepo---- | Create a new repository for an organization. -- See <https://developer.github.com/v3/repos/#create> createOrganizationRepoR :: Name Organization -> NewRepo -> Request 'RW Repo createOrganizationRepoR org nrepo = command Post ["orgs", toPathPart org, "repos"] (encode nrepo) -- | Edit an existing repository.------ > editRepo (BasicAuth (user, password)) "some_user" "some_repo" def {editDescription = Just "some description"}-editRepo- :: Auth- -> Name Owner -- ^ owner- -> Name Repo -- ^ repository name- -> EditRepo- -> IO (Either Error Repo)-editRepo auth user repo body =- executeRequest auth $ editRepoR user repo body----- | Edit an existing repository. -- See <https://developer.github.com/v3/repos/#edit> editRepoR :: Name Owner -> Name Repo -> EditRepo -> Request 'RW Repo editRepoR user repo body =@@ -215,20 +104,6 @@ -- if no name is given, use curent name b = body {editName = editName body <|> Just repo} --- | The contributors to a repo, given the owner and repo name.------ > contributors "thoughtbot" "paperclip"-contributors :: Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))-contributors = contributors' Nothing---- | The contributors to a repo, given the owner and repo name.--- With authentication.------ > contributors' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"-contributors' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))-contributors' auth user repo =- executeRequestMaybe auth $ contributorsR user repo False FetchAll- -- | List contributors. -- See <https://developer.github.com/v3/repos/#list-contributors> contributorsR@@ -243,92 +118,23 @@ qs | anon = [("anon", Just "true")] | otherwise = [] --- | The contributors to a repo, including anonymous contributors (such as--- deleted users or git commits with unknown email addresses), given the owner--- and repo name.------ > contributorsWithAnonymous "thoughtbot" "paperclip"-contributorsWithAnonymous :: Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))-contributorsWithAnonymous = contributorsWithAnonymous' Nothing---- | The contributors to a repo, including anonymous contributors (such as--- deleted users or git commits with unknown email addresses), given the owner--- and repo name.--- With authentication.------ > contributorsWithAnonymous' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"-contributorsWithAnonymous' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Contributor))-contributorsWithAnonymous' auth user repo =- executeRequestMaybe auth $ contributorsR user repo True FetchAll---- | The programming languages used in a repo along with the number of--- characters written in that language. Takes the repo owner and name.------ > languagesFor "mike-burns" "ohlaunch"-languagesFor :: Name Owner -> Name Repo -> IO (Either Error Languages)-languagesFor = languagesFor' Nothing---- | The programming languages used in a repo along with the number of--- characters written in that language. Takes the repo owner and name.--- With authentication.------ > languagesFor' (Just $ BasicAuth "github-username" "github-password") "mike-burns" "ohlaunch"-languagesFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Languages)-languagesFor' auth user repo =- executeRequestMaybe auth $ languagesForR user repo- -- | List languages. -- See <https://developer.github.com/v3/repos/#list-languages> languagesForR :: Name Owner -> Name Repo -> Request k Languages languagesForR user repo = query ["repos", toPathPart user, toPathPart repo, "languages"] [] --- | The git tags on a repo, given the repo owner and name.------ > tagsFor "thoughtbot" "paperclip"-tagsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Tag))-tagsFor = tagsFor' Nothing---- | The git tags on a repo, given the repo owner and name.--- With authentication.------ > tagsFor' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"-tagsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Tag))-tagsFor' auth user repo =- executeRequestMaybe auth $ tagsForR user repo FetchAll- -- | List tags. -- See <https://developer.github.com/v3/repos/#list-tags> tagsForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Tag) tagsForR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "tags"] [] --- | The git branches on a repo, given the repo owner and name.------ > branchesFor "thoughtbot" "paperclip"-branchesFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Branch))-branchesFor = branchesFor' Nothing---- | The git branches on a repo, given the repo owner and name.--- With authentication.------ > branchesFor' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"-branchesFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Branch))-branchesFor' auth user repo =- executeRequestMaybe auth $ branchesForR user repo FetchAll- -- | List branches. -- See <https://developer.github.com/v3/repos/#list-branches> branchesForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Branch) branchesForR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "branches"] []---- | Delete an existing repository.------ > deleteRepo (BasicAuth (user, password)) "thoughtbot" "some_repo"-deleteRepo :: Auth -> Name Owner -> Name Repo -> IO (Either Error ())-deleteRepo auth user repo =- executeRequest auth $ deleteRepoR user repo -- | Delete a repository,. -- See <https://developer.github.com/v3/repos/#delete-a-repository>
src/GitHub/Endpoints/Repos/Collaborators.hs view
@@ -6,53 +6,22 @@ -- The repo collaborators API as described on -- <http://developer.github.com/v3/repos/collaborators/>. 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 () --- | All the users who have collaborated on a repo.------ > collaboratorsOn "thoughtbot" "paperclip"-collaboratorsOn :: Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))-collaboratorsOn = collaboratorsOn' Nothing---- | All the users who have collaborated on a repo.--- With authentication.-collaboratorsOn' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector SimpleUser))-collaboratorsOn' auth user repo =- executeRequestMaybe auth $ collaboratorsOnR user repo FetchAll- -- | List collaborators. -- See <https://developer.github.com/v3/repos/collaborators/#list-collaborators> collaboratorsOnR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector SimpleUser) collaboratorsOnR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "collaborators"] [] --- | Whether the user is collaborating on a repo. Takes the user in question,--- the user who owns the repo, and the repo name.------ > isCollaboratorOn Nothing "mike-burns" "thoughtbot" "paperclip"--- > isCollaboratorOn Nothing "johnson" "thoughtbot" "paperclip"-isCollaboratorOn- :: Maybe Auth- -> Name Owner -- ^ Repository owner- -> Name Repo -- ^ Repository name- -> Name User -- ^ Collaborator?- -> IO (Either Error Bool)-isCollaboratorOn auth user repo coll =- executeRequestMaybe auth $ isCollaboratorOnR user repo coll- -- | Check if a user is a collaborator. -- See <https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator> isCollaboratorOnR@@ -62,15 +31,6 @@ -> GenRequest 'MtStatus rw Bool isCollaboratorOnR user repo coll = Query ["repos", toPathPart user, toPathPart repo, "collaborators", toPathPart coll] []--addCollaborator- :: Auth- -> Name Owner -- ^ Repository owner- -> Name Repo -- ^ Repository name- -> Name User -- ^ Collaborator to add- -> IO (Either Error (Maybe RepoInvitation))-addCollaborator auth owner repo coll =- executeRequest auth $ addCollaboratorR owner repo coll -- | Invite a user as a collaborator. -- See <https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator>
src/GitHub/Endpoints/Repos/Comments.hs view
@@ -7,75 +7,27 @@ -- The repo commits API as described on -- <http://developer.github.com/v3/repos/comments/>. module GitHub.Endpoints.Repos.Comments (- commentsFor,- commentsFor', commentsForR,- commitCommentsFor,- commitCommentsFor', commitCommentsForR,- commitCommentFor,- commitCommentFor', commitCommentForR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | All the comments on a Github repo.------ > commentsFor "thoughtbot" "paperclip"-commentsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Comment))-commentsFor = commentsFor' Nothing---- | All the comments on a Github repo.--- With authentication.------ > commentsFor "thoughtbot" "paperclip"-commentsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Comment))-commentsFor' auth user repo =- executeRequestMaybe auth $ commentsForR user repo FetchAll- -- | List commit comments for a repository. -- See <https://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository> commentsForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Comment) commentsForR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "comments"] [] --- | Just the comments on a specific SHA for a given Github repo.------ > commitCommentsFor "thoughtbot" "paperclip" "41f685f6e01396936bb8cd98e7cca517e2c7d96b"-commitCommentsFor :: Name Owner -> Name Repo -> Name Commit -> IO (Either Error (Vector Comment))-commitCommentsFor = commitCommentsFor' Nothing---- | Just the comments on a specific SHA for a given Github repo.--- With authentication.------ > commitCommentsFor "thoughtbot" "paperclip" "41f685f6e01396936bb8cd98e7cca517e2c7d96b"-commitCommentsFor' :: Maybe Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error (Vector Comment))-commitCommentsFor' auth user repo sha =- executeRequestMaybe auth $ commitCommentsForR user repo sha FetchAll- -- | List comments for a single commit. -- See <https://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit> commitCommentsForR :: Name Owner -> Name Repo -> Name Commit -> FetchCount -> Request k (Vector Comment) commitCommentsForR user repo sha = pagedQuery ["repos", toPathPart user, toPathPart repo, "commits", toPathPart sha, "comments"] []---- | A comment, by its ID, relative to the Github repo.------ > commitCommentFor "thoughtbot" "paperclip" "669575"-commitCommentFor :: Name Owner -> Name Repo -> Id Comment -> IO (Either Error Comment)-commitCommentFor = commitCommentFor' Nothing---- | A comment, by its ID, relative to the Github repo.------ > commitCommentFor "thoughtbot" "paperclip" "669575"-commitCommentFor' :: Maybe Auth -> Name Owner -> Name Repo -> Id Comment -> IO (Either Error Comment)-commitCommentFor' auth user repo cid =- executeRequestMaybe auth $ commitCommentForR user repo cid -- | Query a single commit comment. -- See <https://developer.github.com/v3/repos/comments/#get-a-single-commit-comment>
src/GitHub/Endpoints/Repos/Commits.hs view
@@ -8,24 +8,15 @@ -- <http://developer.github.com/v3/repos/commits/>. module GitHub.Endpoints.Repos.Commits ( CommitQueryOption(..),- commitsFor,- commitsFor', commitsForR,- commitsWithOptionsFor,- commitsWithOptionsFor', commitsWithOptionsForR,- commit,- commit', commitR,- diff,- diff', diffR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () import qualified Data.ByteString as BS@@ -39,37 +30,11 @@ renderCommitQueryOption (CommitQuerySince date) = ("since", Just $ TE.encodeUtf8 . T.pack $ formatISO8601 date) renderCommitQueryOption (CommitQueryUntil date) = ("until", Just $ TE.encodeUtf8 . T.pack $ formatISO8601 date) --- | The commit history for a repo.------ > commitsFor "mike-burns" "github"-commitsFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Commit))-commitsFor = commitsFor' Nothing---- | The commit history for a repo.--- With authentication.------ > commitsFor' (Just $ BasicAuth "github-username" "github-password") "mike-burns" "github"-commitsFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Commit))-commitsFor' auth user repo =- commitsWithOptionsFor' auth user repo []- -- | List commits on a repository. -- See <https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository> commitsForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Commit) commitsForR user repo limit = commitsWithOptionsForR user repo limit [] -commitsWithOptionsFor :: Name Owner -> Name Repo -> [CommitQueryOption] -> IO (Either Error (Vector Commit))-commitsWithOptionsFor = commitsWithOptionsFor' Nothing---- | The commit history for a repo, with commits filtered to satisfy a list of--- query options.--- With authentication.------ > commitsWithOptionsFor' (Just $ BasicAuth "github-username" "github-password") "mike-burns" "github" [CommitQueryAuthor "djeik"]-commitsWithOptionsFor' :: Maybe Auth -> Name Owner -> Name Repo -> [CommitQueryOption] -> IO (Either Error (Vector Commit))-commitsWithOptionsFor' auth user repo opts =- executeRequestMaybe auth $ commitsWithOptionsForR user repo FetchAll opts- -- | List commits on a repository. -- See <https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository> commitsWithOptionsForR :: Name Owner -> Name Repo -> FetchCount -> [CommitQueryOption] -> Request k (Vector Commit)@@ -78,39 +43,11 @@ where qs = map renderCommitQueryOption opts ---- | Details on a specific SHA1 for a repo.------ > commit "mike-burns" "github" "9d1a9a361266c3c890b1108ad2fdf52f824b1b81"-commit :: Name Owner -> Name Repo -> Name Commit -> IO (Either Error Commit)-commit = commit' Nothing---- | Details on a specific SHA1 for a repo.--- With authentication.------ > commit (Just $ BasicAuth "github-username" "github-password") "mike-burns" "github" "9d1a9a361266c3c890b1108ad2fdf52f824b1b81"-commit' :: Maybe Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error Commit)-commit' auth user repo sha =- executeRequestMaybe auth $ commitR user repo sha- -- | Query a single commit. -- See <https://developer.github.com/v3/repos/commits/#get-a-single-commit> commitR :: Name Owner -> Name Repo -> Name Commit -> Request k Commit commitR user repo sha = query ["repos", toPathPart user, toPathPart repo, "commits", toPathPart sha] []---- | The diff between two treeishes on a repo.------ > diff "thoughtbot" "paperclip" "41f685f6e01396936bb8cd98e7cca517e2c7d96b" "HEAD"-diff :: Name Owner -> Name Repo -> Name Commit -> Name Commit -> IO (Either Error Diff)-diff = diff' Nothing---- | The diff between two treeishes on a repo.------ > diff "thoughtbot" "paperclip" "41f685f6e01396936bb8cd98e7cca517e2c7d96b" "HEAD"-diff' :: Maybe Auth -> Name Owner -> Name Repo -> Name Commit -> Name Commit -> IO (Either Error Diff)-diff' auth user repo base headref =- executeRequestMaybe auth $ diffR user repo base headref -- | Compare two commits. -- See <https://developer.github.com/v3/repos/commits/#compare-two-commits>
src/GitHub/Endpoints/Repos/Contents.hs view
@@ -7,26 +7,17 @@ -- <https://developer.github.com/v3/repos/contents/> module GitHub.Endpoints.Repos.Contents ( -- * Querying contents- contentsFor,- contentsFor', contentsForR,- readmeFor,- readmeFor', readmeForR,- archiveFor,- archiveFor', archiveForR, -- ** Create- createFile, createFileR, -- ** Update- updateFile, updateFileR, -- ** Delete- deleteFile, deleteFileR, module GitHub.Data@@ -34,27 +25,12 @@ import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () import Data.Maybe (maybeToList) import qualified Data.Text.Encoding as TE import Network.URI (URI) --- | The contents of a file or directory in a repo, given the repo owner, name, and path to the file------ > contentsFor "thoughtbot" "paperclip" "README.md"-contentsFor :: Name Owner -> Name Repo -> Text -> Maybe Text -> IO (Either Error Content)-contentsFor = contentsFor' Nothing---- | The contents of a file or directory in a repo, given the repo owner, name, and path to the file--- With Authentication------ > contentsFor' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" "README.md" Nothing-contentsFor' :: Maybe Auth -> Name Owner -> Name Repo -> Text -> Maybe Text -> IO (Either Error Content)-contentsFor' auth user repo path ref =- executeRequestMaybe auth $ contentsForR user repo path ref- contentsForR :: Name Owner -> Name Repo@@ -66,38 +42,10 @@ where qs = maybe [] (\r -> [("ref", Just . TE.encodeUtf8 $ r)]) ref --- | The contents of a README file in a repo, given the repo owner and name------ > readmeFor "thoughtbot" "paperclip"-readmeFor :: Name Owner -> Name Repo -> IO (Either Error Content)-readmeFor = readmeFor' Nothing---- | The contents of a README file in a repo, given the repo owner and name--- With Authentication------ > readmeFor' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"-readmeFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Content)-readmeFor' auth user repo =- executeRequestMaybe auth $ readmeForR user repo- readmeForR :: Name Owner -> Name Repo -> Request k Content readmeForR user repo = query ["repos", toPathPart user, toPathPart repo, "readme"] [] --- | The archive of a repo, given the repo owner, name, and archive type------ > archiveFor "thoughtbot" "paperclip" ArchiveFormatTarball Nothing-archiveFor :: Name Owner -> Name Repo -> ArchiveFormat -> Maybe Text -> IO (Either Error URI)-archiveFor = archiveFor' Nothing---- | The archive of a repo, given the repo owner, name, and archive type--- With Authentication------ > archiveFor' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip" ArchiveFormatTarball Nothing-archiveFor' :: Maybe Auth -> Name Owner -> Name Repo -> ArchiveFormat -> Maybe Text -> IO (Either Error URI)-archiveFor' auth user repo path ref =- executeRequestMaybe auth $ archiveForR user repo path ref- -- | Get archive link. -- See <https://developer.github.com/v3/repos/contents/#get-archive-link> archiveForR@@ -111,16 +59,6 @@ path = ["repos", toPathPart user, toPathPart repo, toPathPart format] <> maybeToList ref -- | Create a file.-createFile- :: Auth- -> Name Owner -- ^ owner- -> Name Repo -- ^ repository name- -> CreateFile- -> IO (Either Error ContentResult)-createFile auth user repo body =- executeRequest auth $ createFileR user repo body---- | Create a file. -- See <https://developer.github.com/v3/repos/contents/#create-a-file> createFileR :: Name Owner@@ -131,16 +69,6 @@ command Put ["repos", toPathPart user, toPathPart repo, "contents", createFilePath body] (encode body) -- | Update a file.-updateFile- :: Auth- -> Name Owner -- ^ owner- -> Name Repo -- ^ repository name- -> UpdateFile- -> IO (Either Error ContentResult)-updateFile auth user repo body =- executeRequest auth $ updateFileR user repo body---- | Update a file. -- See <https://developer.github.com/v3/repos/contents/#update-a-file> updateFileR :: Name Owner@@ -149,16 +77,6 @@ -> Request 'RW ContentResult updateFileR user repo body = command Put ["repos", toPathPart user, toPathPart repo, "contents", updateFilePath body] (encode body)---- | Delete a file.-deleteFile- :: Auth- -> Name Owner -- ^ owner- -> Name Repo -- ^ repository name- -> DeleteFile- -> IO (Either Error ())-deleteFile auth user repo body =- executeRequest auth $ deleteFileR user repo body -- | Delete a file. -- See <https://developer.github.com/v3/repos/contents/#delete-a-file>
src/GitHub/Endpoints/Repos/DeployKeys.hs view
@@ -7,61 +7,37 @@ -- <https://developer.github.com/v3/repos/keys> module GitHub.Endpoints.Repos.DeployKeys ( -- * Querying deploy keys- deployKeysFor', deployKeysForR,- deployKeyFor', deployKeyForR, -- ** Create- createRepoDeployKey', createRepoDeployKeyR, -- ** Delete- deleteRepoDeployKey', deleteRepoDeployKeyR, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () -- | Querying deploy keys.-deployKeysFor' :: Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector RepoDeployKey))-deployKeysFor' auth user repo =- executeRequest auth $ deployKeysForR user repo FetchAll---- | Querying deploy keys. -- See <https://developer.github.com/v3/repos/keys/#list-deploy-keys> deployKeysForR :: Name Owner -> Name Repo -> FetchCount -> Request 'RA (Vector RepoDeployKey) deployKeysForR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "keys"] [] --- | Querying a deploy key-deployKeyFor' :: Auth -> Name Owner -> Name Repo -> Id RepoDeployKey -> IO (Either Error RepoDeployKey)-deployKeyFor' auth user repo keyId =- executeRequest auth $ deployKeyForR user repo keyId- -- | Querying a deploy key. -- See <https://developer.github.com/v3/repos/keys/#get-a-deploy-key> deployKeyForR :: Name Owner -> Name Repo -> Id RepoDeployKey -> Request 'RA RepoDeployKey deployKeyForR user repo keyId = query ["repos", toPathPart user, toPathPart repo, "keys", toPathPart keyId] [] --- | Create a deploy key-createRepoDeployKey' :: Auth -> Name Owner -> Name Repo -> NewRepoDeployKey -> IO (Either Error RepoDeployKey)-createRepoDeployKey' auth user repo key =- executeRequest auth $ createRepoDeployKeyR user repo key- -- | Create a deploy key. -- See <https://developer.github.com/v3/repos/keys/#add-a-new-deploy-key>. createRepoDeployKeyR :: Name Owner -> Name Repo -> NewRepoDeployKey -> Request 'RW RepoDeployKey createRepoDeployKeyR user repo key = command Post ["repos", toPathPart user, toPathPart repo, "keys"] (encode key)--deleteRepoDeployKey' :: Auth -> Name Owner -> Name Repo -> Id RepoDeployKey -> IO (Either Error ())-deleteRepoDeployKey' auth user repo keyId =- executeRequest auth $ deleteRepoDeployKeyR user repo keyId -- | Delete a deploy key. -- See <https://developer.github.com/v3/repos/keys/#remove-a-deploy-key>
src/GitHub/Endpoints/Repos/Forks.hs view
@@ -6,30 +6,13 @@ -- Hot forking action, as described at -- <http://developer.github.com/v3/repos/forks/>. module GitHub.Endpoints.Repos.Forks (- forksFor,- forksFor', forksForR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude ()---- | All the repos that are forked off the given repo.------ > forksFor "thoughtbot" "paperclip"-forksFor :: Name Owner -> Name Repo -> IO (Either Error (Vector Repo))-forksFor = forksFor' Nothing---- | All the repos that are forked off the given repo.--- | With authentication------ > forksFor' (Just $ BasicAuth "github-username" "github-password") "thoughtbot" "paperclip"-forksFor' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Repo))-forksFor' auth user repo =- executeRequestMaybe auth $ forksForR user repo FetchAll -- | List forks. -- See <https://developer.github.com/v3/repos/forks/#list-forks>
src/GitHub/Endpoints/Repos/Releases.hs view
@@ -1,95 +1,34 @@ -- The Release API, as described at -- <https://developer.github.com/v3/repos/releases/>. module GitHub.Endpoints.Repos.Releases (- releases,- releases', releasesR,- release,- release', releaseR,- latestRelease,- latestRelease', latestReleaseR,- releaseByTagName,- releaseByTagName', releaseByTagNameR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | All releases for the given repo.------ > releases "calleerlandsson" "pick"-releases :: Name Owner -> Name Repo -> IO (Either Error (Vector Release))-releases = releases' Nothing---- | All releases for the given repo with authentication.------ > releases' (Just $ BasicAuth "github-username" "github-password") "calleerlandsson" "pick"-releases' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector Release))-releases' auth user repo =- executeRequestMaybe auth $ releasesR user repo FetchAll- -- | List releases for a repository. -- See <https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository> releasesR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector Release) releasesR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "releases"] [] --- | Query a single release.------ > release "calleerlandsson" "pick"-release :: Name Owner -> Name Repo -> Id Release -> IO (Either Error Release)-release = release' Nothing---- | Query a single release with authentication.------ > release' (Just $ BasicAuth "github-username" "github-password") "calleerlandsson" "pick"-release' :: Maybe Auth -> Name Owner -> Name Repo -> Id Release -> IO (Either Error Release)-release' auth user repo reqReleaseId =- executeRequestMaybe auth $ releaseR user repo reqReleaseId- -- | Get a single release. -- See <https://developer.github.com/v3/repos/releases/#get-a-single-release> releaseR :: Name Owner -> Name Repo -> Id Release -> Request k Release releaseR user repo reqReleaseId = query ["repos", toPathPart user, toPathPart repo, "releases", toPathPart reqReleaseId ] [] --- | Query latest release.------ > latestRelease "calleerlandsson" "pick"-latestRelease :: Name Owner -> Name Repo -> IO (Either Error Release)-latestRelease = latestRelease' Nothing---- | Query latest release with authentication.------ > latestRelease' (Just $ BasicAuth "github-username" "github-password") "calleerlandsson" "pick"-latestRelease' :: Maybe Auth -> Name Owner -> Name Repo -> IO (Either Error Release)-latestRelease' auth user repo =- executeRequestMaybe auth $ latestReleaseR user repo- -- | Get the latest release. -- See <https://developer.github.com/v3/repos/releases/#get-the-latest-release> latestReleaseR :: Name Owner -> Name Repo -> Request k Release latestReleaseR user repo = query ["repos", toPathPart user, toPathPart repo, "releases", "latest" ] []---- | Query release by tag name.------ > releaseByTagName "calleerlandsson" "pick"-releaseByTagName :: Name Owner -> Name Repo -> Text -> IO (Either Error Release)-releaseByTagName = releaseByTagName' Nothing---- | Query release by tag name with authentication.------ > releaseByTagName' (Just $ BasicAuth "github-username" "github-password") "calleerlandsson" "pick"-releaseByTagName' :: Maybe Auth -> Name Owner -> Name Repo -> Text -> IO (Either Error Release)-releaseByTagName' auth user repo reqTagName =- executeRequestMaybe auth $ releaseByTagNameR user repo reqTagName -- | Get a release by tag name -- See <https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name>
src/GitHub/Endpoints/Repos/Statuses.hs view
@@ -6,30 +6,17 @@ -- The repo statuses API as described on -- <https://developer.github.com/v3/repos/statuses/>. module GitHub.Endpoints.Repos.Statuses (- createStatus, createStatusR,- statusesFor, statusesForR,- statusFor, statusForR, module GitHub.Data ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () -- | Create a new status------ > createStatus (BasicAuth user password) "thoughtbot" "paperclip"--- > "41f685f6e01396936bb8cd98e7cca517e2c7d96b"--- > (NewStatus StatusSuccess Nothing "Looks good!" Nothing)-createStatus :: Auth -> Name Owner -> Name Repo -> Name Commit -> NewStatus -> IO (Either Error Status)-createStatus auth owner repo sha ns =- executeRequest auth $ createStatusR owner repo sha ns---- | Create a new status -- See <https://developer.github.com/v3/repos/statuses/#create-a-status> createStatusR :: Name Owner -> Name Repo -> Name Commit -> NewStatus -> Request 'RW Status createStatusR owner repo sha =@@ -38,26 +25,10 @@ parts = ["repos", toPathPart owner, toPathPart repo, "statuses", toPathPart sha] -- | All statuses for a commit------ > statusesFor (BasicAuth user password) "thoughtbot" "paperclip"--- > "41f685f6e01396936bb8cd98e7cca517e2c7d96b"-statusesFor :: Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error (Vector Status))-statusesFor auth user repo sha =- executeRequest auth $ statusesForR user repo sha FetchAll---- | All statuses for a commit -- See <https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref> statusesForR :: Name Owner -> Name Repo -> Name Commit -> FetchCount -> Request 'RW (Vector Status) statusesForR user repo sha = pagedQuery ["repos", toPathPart user, toPathPart repo, "commits", toPathPart sha, "statuses"] []---- | The combined status for a specific commit------ > statusFor (BasicAuth user password) "thoughtbot" "paperclip"--- > "41f685f6e01396936bb8cd98e7cca517e2c7d96b"-statusFor :: Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error CombinedStatus)-statusFor auth user repo sha =- executeRequest auth $ statusForR user repo sha -- | The combined status for a specific commit -- See <https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref>
src/GitHub/Endpoints/Repos/Webhooks.hs view
@@ -8,98 +8,60 @@ -- <https://developer.github.com/webhooks> module GitHub.Endpoints.Repos.Webhooks ( -- * Querying repositories- webhooksFor', webhooksForR,- webhookFor', webhookForR, -- ** Create- createRepoWebhook', createRepoWebhookR, -- ** Edit- editRepoWebhook', editRepoWebhookR, -- ** Test- testPushRepoWebhook', testPushRepoWebhookR,- pingRepoWebhook', pingRepoWebhookR, -- ** Delete- deleteRepoWebhook', deleteRepoWebhookR, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () -webhooksFor' :: Auth -> Name Owner -> Name Repo -> IO (Either Error (Vector RepoWebhook))-webhooksFor' auth user repo =- executeRequest auth $ webhooksForR user repo FetchAll- -- | List hooks. -- See <https://developer.github.com/v3/repos/hooks/#list-hooks> webhooksForR :: Name Owner -> Name Repo -> FetchCount -> Request k (Vector RepoWebhook) webhooksForR user repo = pagedQuery ["repos", toPathPart user, toPathPart repo, "hooks"] []--webhookFor' :: Auth -> Name Owner -> Name Repo -> Id RepoWebhook -> IO (Either Error RepoWebhook)-webhookFor' auth user repo hookId =- executeRequest auth $ webhookForR user repo hookId---- | Query single hook. -- See <https://developer.github.com/v3/repos/hooks/#get-single-hook> webhookForR :: Name Owner -> Name Repo -> Id RepoWebhook -> Request k RepoWebhook webhookForR user repo hookId = query ["repos", toPathPart user, toPathPart repo, "hooks", toPathPart hookId] [] -createRepoWebhook' :: Auth -> Name Owner -> Name Repo -> NewRepoWebhook -> IO (Either Error RepoWebhook)-createRepoWebhook' auth user repo hook =- executeRequest auth $ createRepoWebhookR user repo hook- -- | Create a hook. -- See <https://developer.github.com/v3/repos/hooks/#create-a-hook> createRepoWebhookR :: Name Owner -> Name Repo -> NewRepoWebhook -> Request 'RW RepoWebhook createRepoWebhookR user repo hook = command Post ["repos", toPathPart user, toPathPart repo, "hooks"] (encode hook) -editRepoWebhook' :: Auth -> Name Owner -> Name Repo -> Id RepoWebhook -> EditRepoWebhook -> IO (Either Error RepoWebhook)-editRepoWebhook' auth user repo hookId hookEdit =- executeRequest auth $ editRepoWebhookR user repo hookId hookEdit- -- | Edit a hook. -- See <https://developer.github.com/v3/repos/hooks/#edit-a-hook> editRepoWebhookR :: Name Owner -> Name Repo -> Id RepoWebhook -> EditRepoWebhook -> Request 'RW RepoWebhook editRepoWebhookR user repo hookId hookEdit = command Patch ["repos", toPathPart user, toPathPart repo, "hooks", toPathPart hookId] (encode hookEdit) -testPushRepoWebhook' :: Auth -> Name Owner -> Name Repo -> Id RepoWebhook -> IO (Either Error Bool)-testPushRepoWebhook' auth user repo hookId =- executeRequest auth $ testPushRepoWebhookR user repo hookId- -- | Test a push hook. -- See <https://developer.github.com/v3/repos/hooks/#test-a-push-hook> testPushRepoWebhookR :: Name Owner -> Name Repo -> Id RepoWebhook -> GenRequest 'MtStatus 'RW Bool testPushRepoWebhookR user repo hookId = Command Post (createWebhookOpPath user repo hookId $ Just "tests") (encode ()) -pingRepoWebhook' :: Auth -> Name Owner -> Name Repo -> Id RepoWebhook -> IO (Either Error Bool)-pingRepoWebhook' auth user repo hookId =- executeRequest auth $ pingRepoWebhookR user repo hookId- -- | Ping a hook. -- See <https://developer.github.com/v3/repos/hooks/#ping-a-hook> pingRepoWebhookR :: Name Owner -> Name Repo -> Id RepoWebhook -> GenRequest 'MtStatus 'RW Bool pingRepoWebhookR user repo hookId = Command Post (createWebhookOpPath user repo hookId $ Just "pings") (encode ())--deleteRepoWebhook' :: Auth -> Name Owner -> Name Repo -> Id RepoWebhook -> IO (Either Error ())-deleteRepoWebhook' auth user repo hookId =- executeRequest auth $ deleteRepoWebhookR user repo hookId -- | Delete a hook. -- See <https://developer.github.com/v3/repos/hooks/#delete-a-hook>
src/GitHub/Endpoints/Search.hs view
@@ -6,78 +6,29 @@ -- The Github Search API, as described at -- <http://developer.github.com/v3/search/>. module GitHub.Endpoints.Search(- searchRepos',- searchRepos, searchReposR,- searchCode',- searchCode, searchCodeR,- searchIssues',- searchIssues, searchIssuesR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () import qualified Data.Text.Encoding as TE --- | Perform a repository search.--- With authentication.------ > searchRepos' (Just $ BasicAuth "github-username" "github-password') "a in%3Aname language%3Ahaskell created%3A>2013-10-01&per_page=100"-searchRepos' :: Maybe Auth -> Text -> IO (Either Error (SearchResult Repo))-searchRepos' auth = executeRequestMaybe auth . searchReposR---- | Perform a repository search.--- Without authentication.------ > searchRepos "q=a in%3Aname language%3Ahaskell created%3A>2013-10-01&per_page=100"-searchRepos :: Text -> IO (Either Error (SearchResult Repo))-searchRepos = searchRepos' Nothing- -- | Search repositories. -- See <https://developer.github.com/v3/search/#search-repositories> searchReposR :: Text -> Request k (SearchResult Repo) searchReposR searchString = query ["search", "repositories"] [("q", Just $ TE.encodeUtf8 searchString)] --- | Perform a code search.--- With authentication.------ > searchCode' (Just $ BasicAuth "github-username" "github-password') "a in%3Aname language%3Ahaskell created%3A>2013-10-01&per_page=100"-searchCode' :: Maybe Auth -> Text -> IO (Either Error (SearchResult Code))-searchCode' auth = executeRequestMaybe auth . searchCodeR---- | Perform a code search.--- Without authentication.------ > searchCode "q=addClass+in:file+language:js+repo:jquery/jquery"-searchCode :: Text -> IO (Either Error (SearchResult Code))-searchCode = searchCode' Nothing- -- | Search code. -- See <https://developer.github.com/v3/search/#search-code> searchCodeR :: Text -> Request k (SearchResult Code) searchCodeR searchString = query ["search", "code"] [("q", Just $ TE.encodeUtf8 searchString)]---- | Perform an issue search.--- With authentication.------ > searchIssues' (Just $ BasicAuth "github-username" "github-password') "a repo%3Aphadej%2Fgithub&per_page=100"-searchIssues' :: Maybe Auth -> Text -> IO (Either Error (SearchResult Issue))-searchIssues' auth = executeRequestMaybe auth . searchIssuesR---- | Perform an issue search.--- Without authentication.------ > searchIssues "q=a repo%3Aphadej%2Fgithub&per_page=100"-searchIssues :: Text -> IO (Either Error (SearchResult Issue))-searchIssues = searchIssues' Nothing -- | Search issues. -- See <https://developer.github.com/v3/search/#search-issues>
src/GitHub/Endpoints/Users.hs view
@@ -6,35 +6,24 @@ -- The Github Users API, as described at -- <http://developer.github.com/v3/users/>. module GitHub.Endpoints.Users (- userInfoFor,- userInfoFor', userInfoForR, ownerInfoForR,- userInfoCurrent', userInfoCurrentR, module GitHub.Data, ) where import GitHub.Data-import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | The information for a single user, by login name.--- With authentification------ > userInfoFor' (Just $ BasicAuth "github-username" "github-password") "mike-burns"-userInfoFor' :: Maybe Auth -> Name User -> IO (Either Error User)-userInfoFor' auth = executeRequestMaybe auth . userInfoForR---- | The information for a single user, by login name.------ > userInfoFor "mike-burns"-userInfoFor :: Name User -> IO (Either Error User)-userInfoFor = executeRequest' . userInfoForR- -- | Query a single user. -- See <https://developer.github.com/v3/users/#get-a-single-user>+--+-- >>> github' userInfoForR "mike-burns"+--+-- or+--+-- >>> github userInfoForR (OAuth "github-token") "mike-burns"+-- userInfoForR :: Name User -> Request k User userInfoForR user = query ["users", toPathPart user] [] @@ -42,13 +31,6 @@ -- See <https://developer.github.com/v3/users/#get-a-single-user> ownerInfoForR :: Name Owner -> Request k Owner ownerInfoForR owner = query ["users", toPathPart owner] []---- | Retrieve information about the user associated with the supplied authentication.------ > userInfoCurrent' (OAuth "...")-userInfoCurrent' :: Auth -> IO (Either Error User)-userInfoCurrent' auth =- executeRequest auth $ userInfoCurrentR -- | Query the authenticated user. -- See <https://developer.github.com/v3/users/#get-the-authenticated-user>
src/GitHub/Endpoints/Users/Emails.hs view
@@ -6,37 +6,20 @@ -- The user emails API as described on -- <http://developer.github.com/v3/users/emails/>. module GitHub.Endpoints.Users.Emails (- currentUserEmails', currentUserEmailsR,- currentUserPublicEmails', currentUserPublicEmailsR, module GitHub.Data, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | List email addresses for the authenticated user.------ > currentUserEmails' (OAuth "token")-currentUserEmails' :: Auth -> IO (Either Error (Vector Email))-currentUserEmails' auth =- executeRequest auth $ currentUserEmailsR FetchAll- -- | List email addresses. -- See <https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user> currentUserEmailsR :: FetchCount -> Request 'RA (Vector Email) currentUserEmailsR = pagedQuery ["user", "emails"] []---- | List public email addresses for the authenticated user.------ > currentUserPublicEmails' (OAuth "token")-currentUserPublicEmails' :: Auth -> IO (Either Error (Vector Email))-currentUserPublicEmails' auth =- executeRequest auth $ currentUserPublicEmailsR FetchAll -- | List public email addresses. -- See <https://developer.github.com/v3/users/emails/#list-public-email-addresses-for-a-user>
src/GitHub/Endpoints/Users/Followers.hs view
@@ -6,8 +6,6 @@ -- The user followers API as described on -- <http://developer.github.com/v3/users/followers/>. module GitHub.Endpoints.Users.Followers (- usersFollowing,- usersFollowedBy, usersFollowingR, usersFollowedByR, module GitHub.Data,@@ -15,28 +13,13 @@ import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () --- | All the users following the given user.------ > usersFollowing "mike-burns"-usersFollowing :: Name User -> IO (Either Error (Vector SimpleUser))-usersFollowing user =- executeRequest' $ usersFollowingR user FetchAll- -- | List followers of a user. -- See <https://developer.github.com/v3/users/followers/#list-followers-of-a-user> usersFollowingR :: Name User -> FetchCount -> Request k (Vector SimpleUser) usersFollowingR user = pagedQuery ["users", toPathPart user, "followers"] []---- | All the users that the given user follows.------ > usersFollowedBy "mike-burns"-usersFollowedBy :: Name User -> IO (Either Error (Vector SimpleUser))-usersFollowedBy user =- executeRequest' $ usersFollowedByR user FetchAll -- | List users followed by another user. -- See <https://developer.github.com/v3/users/followers/#list-users-followed-by-another-user>
src/GitHub/Endpoints/Users/PublicSSHKeys.hs view
@@ -7,74 +7,44 @@ -- <https://developer.github.com/v3/users/keys/> module GitHub.Endpoints.Users.PublicSSHKeys ( -- * Querying public SSH keys- publicSSHKeys', publicSSHKeysR,- publicSSHKeysFor', publicSSHKeysForR,- publicSSHKey', publicSSHKeyR, -- ** Create- createUserPublicSSHKey', createUserPublicSSHKeyR, -- ** Delete- deleteUserPublicSSHKey', deleteUserPublicSSHKeyR, ) where import GitHub.Data import GitHub.Internal.Prelude-import GitHub.Request import Prelude () -- | Querying public SSH keys.-publicSSHKeysFor' :: Name Owner -> IO (Either Error (Vector PublicSSHKeyBasic))-publicSSHKeysFor' user =- executeRequest' $ publicSSHKeysForR user FetchAll---- | Querying public SSH keys. -- See <https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user> publicSSHKeysForR :: Name Owner -> FetchCount -> Request 'RO (Vector PublicSSHKeyBasic) publicSSHKeysForR user = pagedQuery ["users", toPathPart user, "keys"] [] -- | Querying the authenticated users' public SSH keys-publicSSHKeys' :: Auth -> IO (Either Error (Vector PublicSSHKey))-publicSSHKeys' auth =- executeRequest auth publicSSHKeysR---- | Querying the authenticated users' public SSH keys -- See <https://developer.github.com/v3/users/keys/#list-your-public-keys> publicSSHKeysR :: Request 'RA (Vector PublicSSHKey) publicSSHKeysR = query ["user", "keys"] [] --- | Querying a public SSH key-publicSSHKey' :: Auth -> Id PublicSSHKey -> IO (Either Error PublicSSHKey)-publicSSHKey' auth keyId =- executeRequest auth $ publicSSHKeyR keyId- -- | Querying a public SSH key. -- See <https://developer.github.com/v3/users/keys/#get-a-single-public-key> publicSSHKeyR :: Id PublicSSHKey -> Request 'RA PublicSSHKey publicSSHKeyR keyId = query ["user", "keys", toPathPart keyId] [] --- | Create a public SSH key-createUserPublicSSHKey' :: Auth -> NewPublicSSHKey -> IO (Either Error PublicSSHKey)-createUserPublicSSHKey' auth key =- executeRequest auth $ createUserPublicSSHKeyR key- -- | Create a public SSH key. -- See <https://developer.github.com/v3/users/keys/#create-a-public-key>. createUserPublicSSHKeyR :: NewPublicSSHKey -> Request 'RW PublicSSHKey createUserPublicSSHKeyR key = command Post ["user", "keys"] (encode key)--deleteUserPublicSSHKey' :: Auth -> Id PublicSSHKey -> IO (Either Error ())-deleteUserPublicSSHKey' auth keyId =- executeRequest auth $ deleteUserPublicSSHKeyR keyId -- | Delete a public SSH key. -- See <https://developer.github.com/v3/users/keys/#delete-a-public-key>
src/GitHub/Request.hs view
@@ -1,9 +1,11 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE GADTs #-}-{-# LANGUAGE KindSignatures #-}-{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE FunctionalDependencies #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE KindSignatures #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE UndecidableInstances #-} ----------------------------------------------------------------------------- -- | -- License : BSD-3-Clause@@ -29,6 +31,11 @@ -- > githubRequest :: GH.Request 'False a -> GithubMonad a -- > githubRequest = singleton module GitHub.Request (+ -- * A convinient execution of requests+ github,+ github',+ GitHubRW,+ GitHubRO, -- * Types Request, GenRequest (..),@@ -107,6 +114,63 @@ import Paths_github (version) +-------------------------------------------------------------------------------+-- Convinience+-------------------------------------------------------------------------------++-- | A convinience function to turn functions returning @'Request' rw x@,+-- into functions returning @IO (Either 'Error' x)@.+--+-- >>> :t \auth -> github auth userInfoForR+-- \auth -> github auth userInfoForR+-- :: AuthMethod am => am -> Name User -> IO (Either Error User)+--+-- >>> :t github pullRequestsForR+-- \auth -> github auth pullRequestsForR+-- :: AuthMethod am =>+-- am+-- -> Name Owner+-- -> Name Repo+-- -> PullRequestMod+-- -> FetchCount+-- -> IO (Either Error (Data.Vector.Vector SimplePullRequest))+--+github :: (AuthMethod am, GitHubRW req res) => am -> req -> res+github = githubImpl++-- | Like 'github'' but for 'RO' i.e. read-only requests.+-- Note that GitHub has low request limit for non-authenticated requests.+--+-- >>> :t github' userInfoForR+-- github' userInfoForR :: Name User -> IO (Either Error User)+--+github' :: GitHubRO req res => req -> res+github' = githubImpl'++-- | A type-class implementing 'github'.+class GitHubRW req res | req -> res where+ githubImpl :: AuthMethod am => am -> req -> res++-- | A type-class implementing 'github''.+class GitHubRO req res | req -> res where+ githubImpl' :: req -> res++instance (ParseResponse mt req, res ~ Either Error req) => GitHubRW (GenRequest mt rw req) (IO res) where+ githubImpl = executeRequest++instance (ParseResponse mt req, res ~ Either Error req, rw ~ 'RO) => GitHubRO (GenRequest mt rw req) (IO res) where+ githubImpl' = executeRequest'++instance GitHubRW req res => GitHubRW (a -> req) (a -> res) where+ githubImpl am req x = githubImpl am (req x)++instance GitHubRO req res => GitHubRO (a -> req) (a -> res) where+ githubImpl' req x = githubImpl' (req x)++-------------------------------------------------------------------------------+-- Execution+-------------------------------------------------------------------------------+ #ifdef MIN_VERSION_http_client_tls withOpenSSL :: IO a -> IO a withOpenSSL = id@@ -129,7 +193,7 @@ => am -> GenRequest mt rw a -> IO (Either Error a)-executeRequest auth req = withOpenSSL $ withOpenSSL $ do+executeRequest auth req = withOpenSSL $ do manager <- newManager tlsManagerSettings executeRequestWithMgr manager auth req