packages feed

github 0.17.0 → 0.18

raw patch · 14 files changed

+1035/−63 lines, 14 filesdep ~bytestringdep ~http-typesPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: bytestring, http-types

API changes (from Hackage documentation)

+ GitHub: createStatusR :: Name Owner -> Name Repo -> Name Commit -> NewStatus -> Request RW Status
+ GitHub: deleteCommentR :: Name Owner -> Name Repo -> Id Comment -> Request RW ()
+ GitHub: deleteGistR :: Name Gist -> Request RW ()
+ GitHub: starGistR :: Name Gist -> Request RW ()
+ GitHub: statusForR :: Name Owner -> Name Repo -> Name Commit -> Request RW CombinedStatus
+ GitHub: statusesForR :: Name Owner -> Name Repo -> Name Commit -> FetchCount -> Request RW (Vector Status)
+ GitHub: unstarGistR :: Name Gist -> Request RW ()
+ GitHub.Data: mkCommitName :: Text -> Name Commit
+ GitHub.Data.PullRequests: [pullRequestRequestedReviewers] :: PullRequest -> (Vector SimpleUser)
+ GitHub.Data.PullRequests: [simplePullRequestRequestedReviewers] :: SimplePullRequest -> (Vector SimpleUser)
+ GitHub.Data.Repos: [repoArchived] :: Repo -> !Bool
+ GitHub.Data.Statuses: CombinedStatus :: !StatusState -> !(Name Commit) -> !Int -> !(Vector Status) -> !RepoRef -> !URL -> !URL -> CombinedStatus
+ GitHub.Data.Statuses: NewStatus :: !StatusState -> !(Maybe URL) -> !(Maybe Text) -> !(Maybe Text) -> NewStatus
+ GitHub.Data.Statuses: Status :: !UTCTime -> !UTCTime -> !StatusState -> !(Maybe URL) -> !(Maybe Text) -> !(Id Status) -> !URL -> !(Maybe Text) -> !(Maybe SimpleUser) -> Status
+ GitHub.Data.Statuses: StatusError :: StatusState
+ GitHub.Data.Statuses: StatusFailure :: StatusState
+ GitHub.Data.Statuses: StatusPending :: StatusState
+ GitHub.Data.Statuses: StatusSuccess :: StatusState
+ GitHub.Data.Statuses: [combinedStatusCommitUrl] :: CombinedStatus -> !URL
+ GitHub.Data.Statuses: [combinedStatusRepository] :: CombinedStatus -> !RepoRef
+ GitHub.Data.Statuses: [combinedStatusSha] :: CombinedStatus -> !(Name Commit)
+ GitHub.Data.Statuses: [combinedStatusState] :: CombinedStatus -> !StatusState
+ GitHub.Data.Statuses: [combinedStatusStatuses] :: CombinedStatus -> !(Vector Status)
+ GitHub.Data.Statuses: [combinedStatusTotalCount] :: CombinedStatus -> !Int
+ GitHub.Data.Statuses: [combinedStatusUrl] :: CombinedStatus -> !URL
+ GitHub.Data.Statuses: [newStatusContext] :: NewStatus -> !(Maybe Text)
+ GitHub.Data.Statuses: [newStatusDescription] :: NewStatus -> !(Maybe Text)
+ GitHub.Data.Statuses: [newStatusState] :: NewStatus -> !StatusState
+ GitHub.Data.Statuses: [newStatusTargetUrl] :: NewStatus -> !(Maybe URL)
+ GitHub.Data.Statuses: [statusContext] :: Status -> !(Maybe Text)
+ GitHub.Data.Statuses: [statusCreatedAt] :: Status -> !UTCTime
+ GitHub.Data.Statuses: [statusCreator] :: Status -> !(Maybe SimpleUser)
+ GitHub.Data.Statuses: [statusDescription] :: Status -> !(Maybe Text)
+ GitHub.Data.Statuses: [statusId] :: Status -> !(Id Status)
+ GitHub.Data.Statuses: [statusState] :: Status -> !StatusState
+ GitHub.Data.Statuses: [statusTargetUrl] :: Status -> !(Maybe URL)
+ GitHub.Data.Statuses: [statusUpdatedAt] :: Status -> !UTCTime
+ GitHub.Data.Statuses: [statusUrl] :: Status -> !URL
+ GitHub.Data.Statuses: data CombinedStatus
+ GitHub.Data.Statuses: data NewStatus
+ GitHub.Data.Statuses: data Status
+ GitHub.Data.Statuses: data StatusState
+ GitHub.Data.Statuses: instance Control.DeepSeq.NFData GitHub.Data.Statuses.NewStatus
+ GitHub.Data.Statuses: instance Control.DeepSeq.NFData GitHub.Data.Statuses.StatusState
+ GitHub.Data.Statuses: instance Data.Aeson.Types.FromJSON.FromJSON GitHub.Data.Statuses.CombinedStatus
+ GitHub.Data.Statuses: instance Data.Aeson.Types.FromJSON.FromJSON GitHub.Data.Statuses.Status
+ GitHub.Data.Statuses: instance Data.Aeson.Types.FromJSON.FromJSON GitHub.Data.Statuses.StatusState
+ GitHub.Data.Statuses: instance Data.Aeson.Types.ToJSON.ToJSON GitHub.Data.Statuses.NewStatus
+ GitHub.Data.Statuses: instance Data.Aeson.Types.ToJSON.ToJSON GitHub.Data.Statuses.StatusState
+ GitHub.Data.Statuses: instance Data.Binary.Class.Binary GitHub.Data.Statuses.NewStatus
+ GitHub.Data.Statuses: instance Data.Binary.Class.Binary GitHub.Data.Statuses.StatusState
+ GitHub.Data.Statuses: instance Data.Data.Data GitHub.Data.Statuses.CombinedStatus
+ GitHub.Data.Statuses: instance Data.Data.Data GitHub.Data.Statuses.NewStatus
+ GitHub.Data.Statuses: instance Data.Data.Data GitHub.Data.Statuses.Status
+ GitHub.Data.Statuses: instance Data.Data.Data GitHub.Data.Statuses.StatusState
+ GitHub.Data.Statuses: instance GHC.Classes.Eq GitHub.Data.Statuses.CombinedStatus
+ GitHub.Data.Statuses: instance GHC.Classes.Eq GitHub.Data.Statuses.NewStatus
+ GitHub.Data.Statuses: instance GHC.Classes.Eq GitHub.Data.Statuses.Status
+ GitHub.Data.Statuses: instance GHC.Classes.Eq GitHub.Data.Statuses.StatusState
+ GitHub.Data.Statuses: instance GHC.Classes.Ord GitHub.Data.Statuses.CombinedStatus
+ GitHub.Data.Statuses: instance GHC.Classes.Ord GitHub.Data.Statuses.NewStatus
+ GitHub.Data.Statuses: instance GHC.Classes.Ord GitHub.Data.Statuses.Status
+ GitHub.Data.Statuses: instance GHC.Classes.Ord GitHub.Data.Statuses.StatusState
+ GitHub.Data.Statuses: instance GHC.Enum.Bounded GitHub.Data.Statuses.StatusState
+ GitHub.Data.Statuses: instance GHC.Enum.Enum GitHub.Data.Statuses.StatusState
+ GitHub.Data.Statuses: instance GHC.Generics.Generic GitHub.Data.Statuses.CombinedStatus
+ GitHub.Data.Statuses: instance GHC.Generics.Generic GitHub.Data.Statuses.NewStatus
+ GitHub.Data.Statuses: instance GHC.Generics.Generic GitHub.Data.Statuses.Status
+ GitHub.Data.Statuses: instance GHC.Generics.Generic GitHub.Data.Statuses.StatusState
+ GitHub.Data.Statuses: instance GHC.Show.Show GitHub.Data.Statuses.CombinedStatus
+ GitHub.Data.Statuses: instance GHC.Show.Show GitHub.Data.Statuses.NewStatus
+ GitHub.Data.Statuses: instance GHC.Show.Show GitHub.Data.Statuses.Status
+ GitHub.Data.Statuses: instance GHC.Show.Show GitHub.Data.Statuses.StatusState
+ GitHub.Endpoints.Gists: deleteGist :: Auth -> Name Gist -> IO (Either Error ())
+ GitHub.Endpoints.Gists: deleteGistR :: Name Gist -> Request RW ()
+ GitHub.Endpoints.Gists: starGist :: Auth -> Name Gist -> IO (Either Error ())
+ GitHub.Endpoints.Gists: starGistR :: Name Gist -> Request RW ()
+ GitHub.Endpoints.Gists: unstarGist :: Auth -> Name Gist -> IO (Either Error ())
+ GitHub.Endpoints.Gists: unstarGistR :: Name Gist -> Request RW ()
+ GitHub.Endpoints.Issues.Comments: deleteComment :: Auth -> Name Owner -> Name Repo -> Id Comment -> IO (Either Error ())
+ GitHub.Endpoints.Issues.Comments: deleteCommentR :: Name Owner -> Name Repo -> Id Comment -> Request RW ()
+ GitHub.Endpoints.Repos.Statuses: createStatus :: Auth -> Name Owner -> Name Repo -> Name Commit -> NewStatus -> IO (Either Error Status)
+ GitHub.Endpoints.Repos.Statuses: createStatusR :: Name Owner -> Name Repo -> Name Commit -> NewStatus -> Request RW Status
+ GitHub.Endpoints.Repos.Statuses: statusFor :: Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error CombinedStatus)
+ GitHub.Endpoints.Repos.Statuses: statusForR :: Name Owner -> Name Repo -> Name Commit -> Request RW CombinedStatus
+ GitHub.Endpoints.Repos.Statuses: statusesFor :: Auth -> Name Owner -> Name Repo -> Name Commit -> IO (Either Error (Vector Status))
+ GitHub.Endpoints.Repos.Statuses: statusesForR :: Name Owner -> Name Repo -> Name Commit -> FetchCount -> Request RW (Vector Status)
- GitHub.Data.PullRequests: PullRequest :: !(Maybe UTCTime) -> !UTCTime -> !SimpleUser -> !URL -> !IssueState -> !Int -> !URL -> !UTCTime -> !(Maybe Text) -> (Vector SimpleUser) -> !URL -> !URL -> !URL -> !PullRequestLinks -> !(Maybe UTCTime) -> !Text -> !(Id PullRequest) -> !(Maybe SimpleUser) -> !Int -> !PullRequestCommit -> !Count -> !Count -> !Count -> !Count -> !PullRequestCommit -> !Count -> !Bool -> !(Maybe Bool) -> !MergeableState -> PullRequest
+ GitHub.Data.PullRequests: PullRequest :: !(Maybe UTCTime) -> !UTCTime -> !SimpleUser -> !URL -> !IssueState -> !Int -> !URL -> !UTCTime -> !(Maybe Text) -> (Vector SimpleUser) -> (Vector SimpleUser) -> !URL -> !URL -> !URL -> !PullRequestLinks -> !(Maybe UTCTime) -> !Text -> !(Id PullRequest) -> !(Maybe SimpleUser) -> !Int -> !PullRequestCommit -> !Count -> !Count -> !Count -> !Count -> !PullRequestCommit -> !Count -> !Bool -> !(Maybe Bool) -> !MergeableState -> PullRequest
- GitHub.Data.PullRequests: SimplePullRequest :: !(Maybe UTCTime) -> !UTCTime -> !SimpleUser -> !URL -> !IssueState -> !Int -> !URL -> !UTCTime -> !(Maybe Text) -> (Vector SimpleUser) -> !URL -> !URL -> !URL -> !PullRequestLinks -> !(Maybe UTCTime) -> !Text -> !(Id PullRequest) -> SimplePullRequest
+ GitHub.Data.PullRequests: SimplePullRequest :: !(Maybe UTCTime) -> !UTCTime -> !SimpleUser -> !URL -> !IssueState -> !Int -> !URL -> !UTCTime -> !(Maybe Text) -> (Vector SimpleUser) -> (Vector SimpleUser) -> !URL -> !URL -> !URL -> !PullRequestLinks -> !(Maybe UTCTime) -> !Text -> !(Id PullRequest) -> SimplePullRequest
- GitHub.Data.Repos: Repo :: !(Maybe URL) -> !(Maybe Text) -> !(Maybe UTCTime) -> !URL -> !(Maybe URL) -> !(Maybe Int) -> !(Maybe Text) -> !(Maybe Bool) -> !(Maybe URL) -> !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 :: !(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

Files

CHANGELOG.md view
@@ -1,3 +1,17 @@+Changes for 0.18+- 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)+- Add `archived` field to `Repo`.+  [#298](https://github.com/phadej/github/pull/298)+- Update dependencies.+  [#295](https://github.com/phadej/github/pull/295)+- Add Statuses endpoints.+  [#268](https://github.com/phadej/github/pull/268)+- Add requested reviewers field to pull request records.+  [#292](https://github.com/phadej/github/pull/292)+ Changes for 0.17.0 - Add `Ord Request` instance - Repository contents
+ fixtures/pull-request-opened.json view
@@ -0,0 +1,311 @@+{+  "url": "https://api.github.com/repos/phadej/github/pulls/9",+  "id": 144079630,+  "html_url": "https://github.com/phadej/github/pull/9",+  "diff_url": "https://github.com/phadej/github/pull/9.diff",+  "patch_url": "https://github.com/phadej/github/pull/9.patch",+  "issue_url": "https://api.github.com/repos/phadej/github/issues/9",+  "number": 9,+  "state": "open",+  "locked": false,+  "title": "Fetch my pull requests",+  "user": {+    "login": "phadej",+    "id": 123898390,+    "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+    "gravatar_id": "",+    "url": "https://api.github.com/users/phadej",+    "html_url": "https://github.com/phadej",+    "followers_url": "https://api.github.com/users/phadej/followers",+    "following_url": "https://api.github.com/users/phadej/following{/other_user}",+    "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+    "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+    "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+    "organizations_url": "https://api.github.com/users/phadej/orgs",+    "repos_url": "https://api.github.com/users/phadej/repos",+    "events_url": "https://api.github.com/users/phadej/events{/privacy}",+    "received_events_url": "https://api.github.com/users/phadej/received_events",+    "type": "User",+    "site_admin": false+  },+  "body": "",+  "created_at": "2017-10-01T17:22:12Z",+  "updated_at": "2017-10-01T17:22:12Z",+  "closed_at": null,+  "merged_at": null,+  "merge_commit_sha": null,+  "assignee": null,+  "assignees": [+  ],+  "milestone": null,+  "commits_url": "https://api.github.com/repos/phadej/github/pulls/9/commits",+  "review_comments_url": "https://api.github.com/repos/phadej/github/pulls/9/comments",+  "review_comment_url": "https://api.github.com/repos/phadej/github/pulls/comments{/number}",+  "comments_url": "https://api.github.com/repos/phadej/github/issues/9/comments",+  "statuses_url": "https://api.github.com/repos/phadej/github/statuses/20218048bb9529de09f1fdaa9126f60ffeb07ce5",+  "head": {+    "label": "phadej:fetch-my-pull-requests",+    "ref": "fetch-my-pull-requests",+    "sha": "20218048bb9529de09f1fdaa9126f60ffeb07ce5",+    "user": {+      "login": "phadej",+      "id": 123898390,+      "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+      "gravatar_id": "",+      "url": "https://api.github.com/users/phadej",+      "html_url": "https://github.com/phadej",+      "followers_url": "https://api.github.com/users/phadej/followers",+      "following_url": "https://api.github.com/users/phadej/following{/other_user}",+      "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+      "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+      "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+      "organizations_url": "https://api.github.com/users/phadej/orgs",+      "repos_url": "https://api.github.com/users/phadej/repos",+      "events_url": "https://api.github.com/users/phadej/events{/privacy}",+      "received_events_url": "https://api.github.com/users/phadej/received_events",+      "type": "User",+      "site_admin": false+    },+    "repo": {+      "id": 102602684,+      "name": "github",+      "full_name": "phadej/github",+      "owner": {+        "login": "phadej",+        "id": 123898390,+        "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+        "gravatar_id": "",+        "url": "https://api.github.com/users/phadej",+        "html_url": "https://github.com/phadej",+        "followers_url": "https://api.github.com/users/phadej/followers",+        "following_url": "https://api.github.com/users/phadej/following{/other_user}",+        "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+        "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+        "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+        "organizations_url": "https://api.github.com/users/phadej/orgs",+        "repos_url": "https://api.github.com/users/phadej/repos",+        "events_url": "https://api.github.com/users/phadej/events{/privacy}",+        "received_events_url": "https://api.github.com/users/phadej/received_events",+        "type": "User",+        "site_admin": false+      },+      "private": true,+      "html_url": "https://github.com/phadej/github",+      "description": null,+      "fork": false,+      "url": "https://api.github.com/repos/phadej/github",+      "forks_url": "https://api.github.com/repos/phadej/github/forks",+      "keys_url": "https://api.github.com/repos/phadej/github/keys{/key_id}",+      "collaborators_url": "https://api.github.com/repos/phadej/github/collaborators{/collaborator}",+      "teams_url": "https://api.github.com/repos/phadej/github/teams",+      "hooks_url": "https://api.github.com/repos/phadej/github/hooks",+      "issue_events_url": "https://api.github.com/repos/phadej/github/issues/events{/number}",+      "events_url": "https://api.github.com/repos/phadej/github/events",+      "assignees_url": "https://api.github.com/repos/phadej/github/assignees{/user}",+      "branches_url": "https://api.github.com/repos/phadej/github/branches{/branch}",+      "tags_url": "https://api.github.com/repos/phadej/github/tags",+      "blobs_url": "https://api.github.com/repos/phadej/github/git/blobs{/sha}",+      "git_tags_url": "https://api.github.com/repos/phadej/github/git/tags{/sha}",+      "git_refs_url": "https://api.github.com/repos/phadej/github/git/refs{/sha}",+      "trees_url": "https://api.github.com/repos/phadej/github/git/trees{/sha}",+      "statuses_url": "https://api.github.com/repos/phadej/github/statuses/{sha}",+      "languages_url": "https://api.github.com/repos/phadej/github/languages",+      "stargazers_url": "https://api.github.com/repos/phadej/github/stargazers",+      "contributors_url": "https://api.github.com/repos/phadej/github/contributors",+      "subscribers_url": "https://api.github.com/repos/phadej/github/subscribers",+      "subscription_url": "https://api.github.com/repos/phadej/github/subscription",+      "commits_url": "https://api.github.com/repos/phadej/github/commits{/sha}",+      "git_commits_url": "https://api.github.com/repos/phadej/github/git/commits{/sha}",+      "comments_url": "https://api.github.com/repos/phadej/github/comments{/number}",+      "issue_comment_url": "https://api.github.com/repos/phadej/github/issues/comments{/number}",+      "contents_url": "https://api.github.com/repos/phadej/github/contents/{+path}",+      "compare_url": "https://api.github.com/repos/phadej/github/compare/{base}...{head}",+      "merges_url": "https://api.github.com/repos/phadej/github/merges",+      "archive_url": "https://api.github.com/repos/phadej/github/{archive_format}{/ref}",+      "downloads_url": "https://api.github.com/repos/phadej/github/downloads",+      "issues_url": "https://api.github.com/repos/phadej/github/issues{/number}",+      "pulls_url": "https://api.github.com/repos/phadej/github/pulls{/number}",+      "milestones_url": "https://api.github.com/repos/phadej/github/milestones{/number}",+      "notifications_url": "https://api.github.com/repos/phadej/github/notifications{?since,all,participating}",+      "labels_url": "https://api.github.com/repos/phadej/github/labels{/name}",+      "releases_url": "https://api.github.com/repos/phadej/github/releases{/id}",+      "deployments_url": "https://api.github.com/repos/phadej/github/deployments",+      "created_at": "2017-09-06T11:54:37Z",+      "updated_at": "2017-09-06T11:55:42Z",+      "pushed_at": "2017-10-01T16:58:54Z",+      "git_url": "git://github.com/phadej/github.git",+      "ssh_url": "git@github.com:phadej/github.git",+      "clone_url": "https://github.com/phadej/github.git",+      "svn_url": "https://github.com/phadej/github",+      "homepage": null,+      "size": 335,+      "stargazers_count": 0,+      "watchers_count": 0,+      "language": "Haskell",+      "has_issues": true,+      "has_projects": true,+      "has_downloads": true,+      "has_wiki": true,+      "has_pages": false,+      "forks_count": 0,+      "mirror_url": null,+      "open_issues_count": 1,+      "forks": 0,+      "open_issues": 1,+      "watchers": 0,+      "default_branch": "master"+    }+  },+  "base": {+    "label": "phadej:master",+    "ref": "master",+    "sha": "cb686149c0d88af16de61488a1ba70a6c71a2b65",+    "user": {+      "login": "phadej",+      "id": 123898390,+      "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+      "gravatar_id": "",+      "url": "https://api.github.com/users/phadej",+      "html_url": "https://github.com/phadej",+      "followers_url": "https://api.github.com/users/phadej/followers",+      "following_url": "https://api.github.com/users/phadej/following{/other_user}",+      "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+      "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+      "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+      "organizations_url": "https://api.github.com/users/phadej/orgs",+      "repos_url": "https://api.github.com/users/phadej/repos",+      "events_url": "https://api.github.com/users/phadej/events{/privacy}",+      "received_events_url": "https://api.github.com/users/phadej/received_events",+      "type": "User",+      "site_admin": false+    },+    "repo": {+      "id": 102602684,+      "name": "github",+      "full_name": "phadej/github",+      "owner": {+        "login": "phadej",+        "id": 123898390,+        "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+        "gravatar_id": "",+        "url": "https://api.github.com/users/phadej",+        "html_url": "https://github.com/phadej",+        "followers_url": "https://api.github.com/users/phadej/followers",+        "following_url": "https://api.github.com/users/phadej/following{/other_user}",+        "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+        "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+        "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+        "organizations_url": "https://api.github.com/users/phadej/orgs",+        "repos_url": "https://api.github.com/users/phadej/repos",+        "events_url": "https://api.github.com/users/phadej/events{/privacy}",+        "received_events_url": "https://api.github.com/users/phadej/received_events",+        "type": "User",+        "site_admin": false+      },+      "private": true,+      "html_url": "https://github.com/phadej/github",+      "description": null,+      "fork": false,+      "url": "https://api.github.com/repos/phadej/github",+      "forks_url": "https://api.github.com/repos/phadej/github/forks",+      "keys_url": "https://api.github.com/repos/phadej/github/keys{/key_id}",+      "collaborators_url": "https://api.github.com/repos/phadej/github/collaborators{/collaborator}",+      "teams_url": "https://api.github.com/repos/phadej/github/teams",+      "hooks_url": "https://api.github.com/repos/phadej/github/hooks",+      "issue_events_url": "https://api.github.com/repos/phadej/github/issues/events{/number}",+      "events_url": "https://api.github.com/repos/phadej/github/events",+      "assignees_url": "https://api.github.com/repos/phadej/github/assignees{/user}",+      "branches_url": "https://api.github.com/repos/phadej/github/branches{/branch}",+      "tags_url": "https://api.github.com/repos/phadej/github/tags",+      "blobs_url": "https://api.github.com/repos/phadej/github/git/blobs{/sha}",+      "git_tags_url": "https://api.github.com/repos/phadej/github/git/tags{/sha}",+      "git_refs_url": "https://api.github.com/repos/phadej/github/git/refs{/sha}",+      "trees_url": "https://api.github.com/repos/phadej/github/git/trees{/sha}",+      "statuses_url": "https://api.github.com/repos/phadej/github/statuses/{sha}",+      "languages_url": "https://api.github.com/repos/phadej/github/languages",+      "stargazers_url": "https://api.github.com/repos/phadej/github/stargazers",+      "contributors_url": "https://api.github.com/repos/phadej/github/contributors",+      "subscribers_url": "https://api.github.com/repos/phadej/github/subscribers",+      "subscription_url": "https://api.github.com/repos/phadej/github/subscription",+      "commits_url": "https://api.github.com/repos/phadej/github/commits{/sha}",+      "git_commits_url": "https://api.github.com/repos/phadej/github/git/commits{/sha}",+      "comments_url": "https://api.github.com/repos/phadej/github/comments{/number}",+      "issue_comment_url": "https://api.github.com/repos/phadej/github/issues/comments{/number}",+      "contents_url": "https://api.github.com/repos/phadej/github/contents/{+path}",+      "compare_url": "https://api.github.com/repos/phadej/github/compare/{base}...{head}",+      "merges_url": "https://api.github.com/repos/phadej/github/merges",+      "archive_url": "https://api.github.com/repos/phadej/github/{archive_format}{/ref}",+      "downloads_url": "https://api.github.com/repos/phadej/github/downloads",+      "issues_url": "https://api.github.com/repos/phadej/github/issues{/number}",+      "pulls_url": "https://api.github.com/repos/phadej/github/pulls{/number}",+      "milestones_url": "https://api.github.com/repos/phadej/github/milestones{/number}",+      "notifications_url": "https://api.github.com/repos/phadej/github/notifications{?since,all,participating}",+      "labels_url": "https://api.github.com/repos/phadej/github/labels{/name}",+      "releases_url": "https://api.github.com/repos/phadej/github/releases{/id}",+      "deployments_url": "https://api.github.com/repos/phadej/github/deployments",+      "created_at": "2017-09-06T11:54:37Z",+      "updated_at": "2017-09-06T11:55:42Z",+      "pushed_at": "2017-10-01T16:58:54Z",+      "git_url": "git://github.com/phadej/github.git",+      "ssh_url": "git@github.com:phadej/github.git",+      "clone_url": "https://github.com/phadej/github.git",+      "svn_url": "https://github.com/phadej/github",+      "homepage": null,+      "size": 335,+      "stargazers_count": 0,+      "watchers_count": 0,+      "language": "Haskell",+      "has_issues": true,+      "has_projects": true,+      "has_downloads": true,+      "has_wiki": true,+      "has_pages": false,+      "forks_count": 0,+      "mirror_url": null,+      "open_issues_count": 1,+      "forks": 0,+      "open_issues": 1,+      "watchers": 0,+      "default_branch": "master"+    }+  },+  "_links": {+    "self": {+      "href": "https://api.github.com/repos/phadej/github/pulls/9"+    },+    "html": {+      "href": "https://github.com/phadej/github/pull/9"+    },+    "issue": {+      "href": "https://api.github.com/repos/phadej/github/issues/9"+    },+    "comments": {+      "href": "https://api.github.com/repos/phadej/github/issues/9/comments"+    },+    "review_comments": {+      "href": "https://api.github.com/repos/phadej/github/pulls/9/comments"+    },+    "review_comment": {+      "href": "https://api.github.com/repos/phadej/github/pulls/comments{/number}"+    },+    "commits": {+      "href": "https://api.github.com/repos/phadej/github/pulls/9/commits"+    },+    "statuses": {+      "href": "https://api.github.com/repos/phadej/github/statuses/20218048bb9529de09f1fdaa9126f60ffeb07ce5"+    }+  },+  "author_association": "OWNER",+  "merged": false,+  "mergeable": null,+  "rebaseable": null,+  "mergeable_state": "unknown",+  "merged_by": null,+  "comments": 0,+  "review_comments": 0,+  "maintainer_can_modify": false,+  "commits": 6,+  "additions": 363,+  "deletions": 48,+  "changed_files": 19+}
+ fixtures/pull-request-review-requested.json view
@@ -0,0 +1,351 @@+{+  "url": "https://api.github.com/repos/phadej/github/pulls/9",+  "id": 144079630,+  "html_url": "https://github.com/phadej/github/pull/9",+  "diff_url": "https://github.com/phadej/github/pull/9.diff",+  "patch_url": "https://github.com/phadej/github/pull/9.patch",+  "issue_url": "https://api.github.com/repos/phadej/github/issues/9",+  "number": 9,+  "state": "open",+  "locked": false,+  "title": "Fetch my pull requests",+  "user": {+    "login": "phadej",+    "id": 123898390,+    "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+    "gravatar_id": "",+    "url": "https://api.github.com/users/phadej",+    "html_url": "https://github.com/phadej",+    "followers_url": "https://api.github.com/users/phadej/followers",+    "following_url": "https://api.github.com/users/phadej/following{/other_user}",+    "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+    "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+    "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+    "organizations_url": "https://api.github.com/users/phadej/orgs",+    "repos_url": "https://api.github.com/users/phadej/repos",+    "events_url": "https://api.github.com/users/phadej/events{/privacy}",+    "received_events_url": "https://api.github.com/users/phadej/received_events",+    "type": "User",+    "site_admin": false+  },+  "body": "",+  "created_at": "2017-10-01T17:22:12Z",+  "updated_at": "2017-10-01T17:22:12Z",+  "closed_at": null,+  "merged_at": null,+  "merge_commit_sha": null,+  "assignee": null,+  "assignees": [+    {+      "login": "phadej",+      "id": 123898390,+      "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+      "gravatar_id": "",+      "url": "https://api.github.com/users/phadej",+      "html_url": "https://github.com/phadej",+      "followers_url": "https://api.github.com/users/phadej/followers",+      "following_url": "https://api.github.com/users/phadej/following{/other_user}",+      "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+      "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+      "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+      "organizations_url": "https://api.github.com/users/phadej/orgs",+      "repos_url": "https://api.github.com/users/phadej/repos",+      "events_url": "https://api.github.com/users/phadej/events{/privacy}",+      "received_events_url": "https://api.github.com/users/phadej/received_events",+      "type": "User",+      "site_admin": false+    }+  ],+  "requested_reviewers": [+    {+      "login": "phadej",+      "id": 123898390,+      "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+      "gravatar_id": "",+      "url": "https://api.github.com/users/phadej",+      "html_url": "https://github.com/phadej",+      "followers_url": "https://api.github.com/users/phadej/followers",+      "following_url": "https://api.github.com/users/phadej/following{/other_user}",+      "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+      "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+      "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+      "organizations_url": "https://api.github.com/users/phadej/orgs",+      "repos_url": "https://api.github.com/users/phadej/repos",+      "events_url": "https://api.github.com/users/phadej/events{/privacy}",+      "received_events_url": "https://api.github.com/users/phadej/received_events",+      "type": "User",+      "site_admin": false+    }+  ],+  "milestone": null,+  "commits_url": "https://api.github.com/repos/phadej/github/pulls/9/commits",+  "review_comments_url": "https://api.github.com/repos/phadej/github/pulls/9/comments",+  "review_comment_url": "https://api.github.com/repos/phadej/github/pulls/comments{/number}",+  "comments_url": "https://api.github.com/repos/phadej/github/issues/9/comments",+  "statuses_url": "https://api.github.com/repos/phadej/github/statuses/20218048bb9529de09f1fdaa9126f60ffeb07ce5",+  "head": {+    "label": "phadej:fetch-my-pull-requests",+    "ref": "fetch-my-pull-requests",+    "sha": "20218048bb9529de09f1fdaa9126f60ffeb07ce5",+    "user": {+      "login": "phadej",+      "id": 123898390,+      "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+      "gravatar_id": "",+      "url": "https://api.github.com/users/phadej",+      "html_url": "https://github.com/phadej",+      "followers_url": "https://api.github.com/users/phadej/followers",+      "following_url": "https://api.github.com/users/phadej/following{/other_user}",+      "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+      "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+      "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+      "organizations_url": "https://api.github.com/users/phadej/orgs",+      "repos_url": "https://api.github.com/users/phadej/repos",+      "events_url": "https://api.github.com/users/phadej/events{/privacy}",+      "received_events_url": "https://api.github.com/users/phadej/received_events",+      "type": "User",+      "site_admin": false+    },+    "repo": {+      "id": 102602684,+      "name": "github",+      "full_name": "phadej/github",+      "owner": {+        "login": "phadej",+        "id": 123898390,+        "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+        "gravatar_id": "",+        "url": "https://api.github.com/users/phadej",+        "html_url": "https://github.com/phadej",+        "followers_url": "https://api.github.com/users/phadej/followers",+        "following_url": "https://api.github.com/users/phadej/following{/other_user}",+        "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+        "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+        "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+        "organizations_url": "https://api.github.com/users/phadej/orgs",+        "repos_url": "https://api.github.com/users/phadej/repos",+        "events_url": "https://api.github.com/users/phadej/events{/privacy}",+        "received_events_url": "https://api.github.com/users/phadej/received_events",+        "type": "User",+        "site_admin": false+      },+      "private": true,+      "html_url": "https://github.com/phadej/github",+      "description": null,+      "fork": false,+      "url": "https://api.github.com/repos/phadej/github",+      "forks_url": "https://api.github.com/repos/phadej/github/forks",+      "keys_url": "https://api.github.com/repos/phadej/github/keys{/key_id}",+      "collaborators_url": "https://api.github.com/repos/phadej/github/collaborators{/collaborator}",+      "teams_url": "https://api.github.com/repos/phadej/github/teams",+      "hooks_url": "https://api.github.com/repos/phadej/github/hooks",+      "issue_events_url": "https://api.github.com/repos/phadej/github/issues/events{/number}",+      "events_url": "https://api.github.com/repos/phadej/github/events",+      "assignees_url": "https://api.github.com/repos/phadej/github/assignees{/user}",+      "branches_url": "https://api.github.com/repos/phadej/github/branches{/branch}",+      "tags_url": "https://api.github.com/repos/phadej/github/tags",+      "blobs_url": "https://api.github.com/repos/phadej/github/git/blobs{/sha}",+      "git_tags_url": "https://api.github.com/repos/phadej/github/git/tags{/sha}",+      "git_refs_url": "https://api.github.com/repos/phadej/github/git/refs{/sha}",+      "trees_url": "https://api.github.com/repos/phadej/github/git/trees{/sha}",+      "statuses_url": "https://api.github.com/repos/phadej/github/statuses/{sha}",+      "languages_url": "https://api.github.com/repos/phadej/github/languages",+      "stargazers_url": "https://api.github.com/repos/phadej/github/stargazers",+      "contributors_url": "https://api.github.com/repos/phadej/github/contributors",+      "subscribers_url": "https://api.github.com/repos/phadej/github/subscribers",+      "subscription_url": "https://api.github.com/repos/phadej/github/subscription",+      "commits_url": "https://api.github.com/repos/phadej/github/commits{/sha}",+      "git_commits_url": "https://api.github.com/repos/phadej/github/git/commits{/sha}",+      "comments_url": "https://api.github.com/repos/phadej/github/comments{/number}",+      "issue_comment_url": "https://api.github.com/repos/phadej/github/issues/comments{/number}",+      "contents_url": "https://api.github.com/repos/phadej/github/contents/{+path}",+      "compare_url": "https://api.github.com/repos/phadej/github/compare/{base}...{head}",+      "merges_url": "https://api.github.com/repos/phadej/github/merges",+      "archive_url": "https://api.github.com/repos/phadej/github/{archive_format}{/ref}",+      "downloads_url": "https://api.github.com/repos/phadej/github/downloads",+      "issues_url": "https://api.github.com/repos/phadej/github/issues{/number}",+      "pulls_url": "https://api.github.com/repos/phadej/github/pulls{/number}",+      "milestones_url": "https://api.github.com/repos/phadej/github/milestones{/number}",+      "notifications_url": "https://api.github.com/repos/phadej/github/notifications{?since,all,participating}",+      "labels_url": "https://api.github.com/repos/phadej/github/labels{/name}",+      "releases_url": "https://api.github.com/repos/phadej/github/releases{/id}",+      "deployments_url": "https://api.github.com/repos/phadej/github/deployments",+      "created_at": "2017-09-06T11:54:37Z",+      "updated_at": "2017-09-06T11:55:42Z",+      "pushed_at": "2017-10-01T16:58:54Z",+      "git_url": "git://github.com/phadej/github.git",+      "ssh_url": "git@github.com:phadej/github.git",+      "clone_url": "https://github.com/phadej/github.git",+      "svn_url": "https://github.com/phadej/github",+      "homepage": null,+      "size": 335,+      "stargazers_count": 0,+      "watchers_count": 0,+      "language": "Haskell",+      "has_issues": true,+      "has_projects": true,+      "has_downloads": true,+      "has_wiki": true,+      "has_pages": false,+      "forks_count": 0,+      "mirror_url": null,+      "open_issues_count": 1,+      "forks": 0,+      "open_issues": 1,+      "watchers": 0,+      "default_branch": "master"+    }+  },+  "base": {+    "label": "phadej:master",+    "ref": "master",+    "sha": "cb686149c0d88af16de61488a1ba70a6c71a2b65",+    "user": {+      "login": "phadej",+      "id": 123898390,+      "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+      "gravatar_id": "",+      "url": "https://api.github.com/users/phadej",+      "html_url": "https://github.com/phadej",+      "followers_url": "https://api.github.com/users/phadej/followers",+      "following_url": "https://api.github.com/users/phadej/following{/other_user}",+      "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+      "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+      "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+      "organizations_url": "https://api.github.com/users/phadej/orgs",+      "repos_url": "https://api.github.com/users/phadej/repos",+      "events_url": "https://api.github.com/users/phadej/events{/privacy}",+      "received_events_url": "https://api.github.com/users/phadej/received_events",+      "type": "User",+      "site_admin": false+    },+    "repo": {+      "id": 102602684,+      "name": "github",+      "full_name": "phadej/github",+      "owner": {+        "login": "phadej",+        "id": 123898390,+        "avatar_url": "https://avatars3.githubusercontent.com/u/123898390?v=4",+        "gravatar_id": "",+        "url": "https://api.github.com/users/phadej",+        "html_url": "https://github.com/phadej",+        "followers_url": "https://api.github.com/users/phadej/followers",+        "following_url": "https://api.github.com/users/phadej/following{/other_user}",+        "gists_url": "https://api.github.com/users/phadej/gists{/gist_id}",+        "starred_url": "https://api.github.com/users/phadej/starred{/owner}{/repo}",+        "subscriptions_url": "https://api.github.com/users/phadej/subscriptions",+        "organizations_url": "https://api.github.com/users/phadej/orgs",+        "repos_url": "https://api.github.com/users/phadej/repos",+        "events_url": "https://api.github.com/users/phadej/events{/privacy}",+        "received_events_url": "https://api.github.com/users/phadej/received_events",+        "type": "User",+        "site_admin": false+      },+      "private": true,+      "html_url": "https://github.com/phadej/github",+      "description": null,+      "fork": false,+      "url": "https://api.github.com/repos/phadej/github",+      "forks_url": "https://api.github.com/repos/phadej/github/forks",+      "keys_url": "https://api.github.com/repos/phadej/github/keys{/key_id}",+      "collaborators_url": "https://api.github.com/repos/phadej/github/collaborators{/collaborator}",+      "teams_url": "https://api.github.com/repos/phadej/github/teams",+      "hooks_url": "https://api.github.com/repos/phadej/github/hooks",+      "issue_events_url": "https://api.github.com/repos/phadej/github/issues/events{/number}",+      "events_url": "https://api.github.com/repos/phadej/github/events",+      "assignees_url": "https://api.github.com/repos/phadej/github/assignees{/user}",+      "branches_url": "https://api.github.com/repos/phadej/github/branches{/branch}",+      "tags_url": "https://api.github.com/repos/phadej/github/tags",+      "blobs_url": "https://api.github.com/repos/phadej/github/git/blobs{/sha}",+      "git_tags_url": "https://api.github.com/repos/phadej/github/git/tags{/sha}",+      "git_refs_url": "https://api.github.com/repos/phadej/github/git/refs{/sha}",+      "trees_url": "https://api.github.com/repos/phadej/github/git/trees{/sha}",+      "statuses_url": "https://api.github.com/repos/phadej/github/statuses/{sha}",+      "languages_url": "https://api.github.com/repos/phadej/github/languages",+      "stargazers_url": "https://api.github.com/repos/phadej/github/stargazers",+      "contributors_url": "https://api.github.com/repos/phadej/github/contributors",+      "subscribers_url": "https://api.github.com/repos/phadej/github/subscribers",+      "subscription_url": "https://api.github.com/repos/phadej/github/subscription",+      "commits_url": "https://api.github.com/repos/phadej/github/commits{/sha}",+      "git_commits_url": "https://api.github.com/repos/phadej/github/git/commits{/sha}",+      "comments_url": "https://api.github.com/repos/phadej/github/comments{/number}",+      "issue_comment_url": "https://api.github.com/repos/phadej/github/issues/comments{/number}",+      "contents_url": "https://api.github.com/repos/phadej/github/contents/{+path}",+      "compare_url": "https://api.github.com/repos/phadej/github/compare/{base}...{head}",+      "merges_url": "https://api.github.com/repos/phadej/github/merges",+      "archive_url": "https://api.github.com/repos/phadej/github/{archive_format}{/ref}",+      "downloads_url": "https://api.github.com/repos/phadej/github/downloads",+      "issues_url": "https://api.github.com/repos/phadej/github/issues{/number}",+      "pulls_url": "https://api.github.com/repos/phadej/github/pulls{/number}",+      "milestones_url": "https://api.github.com/repos/phadej/github/milestones{/number}",+      "notifications_url": "https://api.github.com/repos/phadej/github/notifications{?since,all,participating}",+      "labels_url": "https://api.github.com/repos/phadej/github/labels{/name}",+      "releases_url": "https://api.github.com/repos/phadej/github/releases{/id}",+      "deployments_url": "https://api.github.com/repos/phadej/github/deployments",+      "created_at": "2017-09-06T11:54:37Z",+      "updated_at": "2017-09-06T11:55:42Z",+      "pushed_at": "2017-10-01T16:58:54Z",+      "git_url": "git://github.com/phadej/github.git",+      "ssh_url": "git@github.com:phadej/github.git",+      "clone_url": "https://github.com/phadej/github.git",+      "svn_url": "https://github.com/phadej/github",+      "homepage": null,+      "size": 335,+      "stargazers_count": 0,+      "watchers_count": 0,+      "language": "Haskell",+      "has_issues": true,+      "has_projects": true,+      "has_downloads": true,+      "has_wiki": true,+      "has_pages": false,+      "forks_count": 0,+      "mirror_url": null,+      "open_issues_count": 1,+      "forks": 0,+      "open_issues": 1,+      "watchers": 0,+      "default_branch": "master"+    }+  },+  "_links": {+    "self": {+      "href": "https://api.github.com/repos/phadej/github/pulls/9"+    },+    "html": {+      "href": "https://github.com/phadej/github/pull/9"+    },+    "issue": {+      "href": "https://api.github.com/repos/phadej/github/issues/9"+    },+    "comments": {+      "href": "https://api.github.com/repos/phadej/github/issues/9/comments"+    },+    "review_comments": {+      "href": "https://api.github.com/repos/phadej/github/pulls/9/comments"+    },+    "review_comment": {+      "href": "https://api.github.com/repos/phadej/github/pulls/comments{/number}"+    },+    "commits": {+      "href": "https://api.github.com/repos/phadej/github/pulls/9/commits"+    },+    "statuses": {+      "href": "https://api.github.com/repos/phadej/github/statuses/20218048bb9529de09f1fdaa9126f60ffeb07ce5"+    }+  },+  "author_association": "OWNER",+  "merged": false,+  "mergeable": null,+  "rebaseable": null,+  "mergeable_state": "unknown",+  "merged_by": null,+  "comments": 0,+  "review_comments": 0,+  "maintainer_can_modify": false,+  "commits": 6,+  "additions": 363,+  "deletions": 48,+  "changed_files": 19+}
github.cabal view
@@ -1,5 +1,5 @@ name:                github-version:             0.17.0+version:             0.18 synopsis:            Access to the GitHub API, v3. description:   The GitHub API provides programmatic access to the full@@ -33,6 +33,8 @@   fixtures/issue-search.json,   fixtures/list-teams.json,   fixtures/members-list.json,+  fixtures/pull-request-opened.json,+  fixtures/pull-request-review-requested.json,   fixtures/user-organizations.json,   fixtures/user.json @@ -86,6 +88,7 @@     GitHub.Data.Request     GitHub.Data.Reviews     GitHub.Data.Search+    GitHub.Data.Statuses     GitHub.Data.Teams     GitHub.Data.URL     GitHub.Data.Webhooks@@ -118,6 +121,7 @@     GitHub.Endpoints.Repos.DeployKeys     GitHub.Endpoints.Repos.Forks     GitHub.Endpoints.Repos.Releases+    GitHub.Endpoints.Repos.Statuses     GitHub.Endpoints.Repos.Webhooks     GitHub.Endpoints.Search     GitHub.Endpoints.Users@@ -142,7 +146,7 @@                  http-client           >=0.4.8.1   && <0.6,                  http-client-tls       >=0.2.2     && <0.4,                  http-link-header      >=1.0.1     && <1.1,-                 http-types            >=0.8.6     && <0.10,+                 http-types            >=0.8.6     && <0.11,                  iso8601-time          >=0.1.4     && <0.2,                  mtl                   >=2.1.3.1   && <2.3,                  network-uri           >=2.6.0.3   && <2.7,@@ -182,8 +186,10 @@     GitHub.EventsSpec   main-is: Spec.hs   ghc-options: -Wall+  build-tool-depends: hspec-discover:hspec-discover   build-depends: base,                  base-compat,+                 bytestring,                  github,                  vector,                  unordered-containers,
spec/GitHub/CommitsSpec.hs view
@@ -6,13 +6,12 @@  import GitHub.Auth                    (Auth (..)) import GitHub.Endpoints.Repos.Commits (Commit, commitSha, commitsFor',-                                       commitsForR, diffR, mkName)+                                       commitsForR, diffR, mkCommitName) import GitHub.Request                 (executeRequest)  import Control.Monad      (forM_) import Data.Either.Compat (isRight) import Data.List          (nub, sort)-import Data.Proxy         (Proxy (..)) import Data.String        (fromString) import System.Environment (lookupEnv) import Test.Hspec         (Spec, describe, it, pendingWith, shouldBe,@@ -59,6 +58,5 @@         d `shouldSatisfy` isRight      it "issue #155" $ withAuth $ \auth -> do-      let mkCommitName = mkName (Proxy :: Proxy Commit)       d <- executeRequest auth $ diffR "nomeata" "codespeed" (mkCommitName "ghc") (mkCommitName "tobami:master")       d `shouldSatisfy` isRight
spec/GitHub/PullRequestsSpec.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TemplateHaskell   #-} module GitHub.PullRequestsSpec where  import qualified GitHub@@ -6,11 +7,15 @@ import Prelude () import Prelude.Compat -import Data.Either.Compat   (isRight)-import Data.Foldable        (for_)-import Data.String          (fromString)-import System.Environment   (lookupEnv)-import Test.Hspec           (Spec, describe, it, pendingWith, shouldSatisfy)+import Data.Aeson.Compat     (eitherDecodeStrict)+import Data.ByteString       (ByteString)+import Data.Either.Compat    (isRight)+import Data.FileEmbed        (embedFile)+import Data.Foldable         (for_)+import Data.String           (fromString)+import qualified Data.Vector as V+import System.Environment    (lookupEnv)+import Test.Hspec            (Spec, describe, it, pendingWith, shouldBe, shouldSatisfy)  fromRightS :: Show a => Either a b -> b fromRightS (Right b) = b@@ -28,8 +33,23 @@     describe "pullRequestsForR" $ do         it "works" $ withAuth $ \auth -> for_ repos $ \(owner, repo) -> do             cs <- GitHub.executeRequest auth $-                GitHub.pullRequestsForR owner repo opts GitHub.FetchAll +                GitHub.pullRequestsForR owner repo opts GitHub.FetchAll             cs `shouldSatisfy` isRight++    describe "decoding pull request payloads" $ do+        it "decodes a pull request 'opened' payload" $ do+            V.length (GitHub.simplePullRequestRequestedReviewers simplePullRequestOpened)+                `shouldBe` 0++            V.length (GitHub.pullRequestRequestedReviewers pullRequestOpened)+                `shouldBe` 0++        it "decodes a pull request 'review_requested' payload" $ do+            V.length (GitHub.simplePullRequestRequestedReviewers simplePullRequestReviewRequested)+                `shouldBe` 1++            V.length (GitHub.pullRequestRequestedReviewers pullRequestReviewRequested)+                `shouldBe` 1   where     repos =       [ ("thoughtbot", "paperclip")@@ -37,3 +57,25 @@       , ("haskell", "cabal")       ]     opts = GitHub.stateClosed++    simplePullRequestOpened :: GitHub.SimplePullRequest+    simplePullRequestOpened =+        fromRightS (eitherDecodeStrict prOpenedPayload)++    pullRequestOpened :: GitHub.PullRequest+    pullRequestOpened =+        fromRightS (eitherDecodeStrict prOpenedPayload)++    simplePullRequestReviewRequested :: GitHub.SimplePullRequest+    simplePullRequestReviewRequested =+        fromRightS (eitherDecodeStrict prReviewRequestedPayload)++    pullRequestReviewRequested :: GitHub.PullRequest+    pullRequestReviewRequested =+        fromRightS (eitherDecodeStrict prReviewRequestedPayload)++    prOpenedPayload :: ByteString+    prOpenedPayload = $(embedFile "fixtures/pull-request-opened.json")++    prReviewRequestedPayload :: ByteString+    prReviewRequestedPayload = $(embedFile "fixtures/pull-request-review-requested.json")
src/GitHub.hs view
@@ -52,14 +52,14 @@     -- * Create a gist     -- * Edit a gist     -- * List gist commits-    -- * Star a gist-    -- * Unstar a gist     -- * Check if a gist is starred     -- * Fork a gist     -- * List gist forks-    -- * Delete a gist     gistsR,     gistR,+    starGistR,+    unstarGistR,+    deleteGistR,      -- ** Comments     -- | See <https://developer.github.com/v3/gists/comments/>@@ -106,12 +106,10 @@     -- ** Comments     -- | See <https://developer.github.com/v3/issues/comments/>     ---    -- Missing endpoints:-    ---    -- * Delete comment     commentR,     commentsR,     createCommentR,+    deleteCommentR,     editCommentR,      -- ** Events@@ -328,6 +326,12 @@     usersFollowingR,     usersFollowedByR, +    -- ** Statuses+    -- | See <https://developer.github.com/v3/repos/statuses/>+    createStatusR,+    statusesForR,+    statusForR,+     -- * Data definitions     module GitHub.Data,     -- * Request handling@@ -361,6 +365,7 @@ import GitHub.Endpoints.Repos.Commits import GitHub.Endpoints.Repos.Forks import GitHub.Endpoints.Repos.Releases+import GitHub.Endpoints.Repos.Statuses import GitHub.Endpoints.Repos.Webhooks import GitHub.Endpoints.Search import GitHub.Endpoints.Users
src/GitHub/Data.hs view
@@ -16,6 +16,7 @@     mkTeamName,     mkOrganizationName,     mkRepoName,+    mkCommitName,     fromUserName,     fromOrganizationName,     -- ** Id@@ -48,6 +49,7 @@     module GitHub.Data.Request,     module GitHub.Data.Reviews,     module GitHub.Data.Search,+    module GitHub.Data.Statuses,     module GitHub.Data.Teams,     module GitHub.Data.URL,     module GitHub.Data.Webhooks@@ -76,6 +78,7 @@ import GitHub.Data.Request import GitHub.Data.Reviews import GitHub.Data.Search+import GitHub.Data.Statuses import GitHub.Data.Teams import GitHub.Data.URL import GitHub.Data.Webhooks@@ -109,6 +112,9 @@  mkRepoName :: Text -> Name Repo mkRepoName = N++mkCommitName :: Text -> Name Commit+mkCommitName = N  fromOrganizationName :: Name Organization -> Name Owner fromOrganizationName = N . untagName
src/GitHub/Data/PullRequests.hs view
@@ -29,23 +29,24 @@ import qualified Data.Text as T  data SimplePullRequest = SimplePullRequest-    { simplePullRequestClosedAt  :: !(Maybe UTCTime)-    , simplePullRequestCreatedAt :: !UTCTime-    , simplePullRequestUser      :: !SimpleUser-    , simplePullRequestPatchUrl  :: !URL-    , simplePullRequestState     :: !IssueState-    , simplePullRequestNumber    :: !Int-    , simplePullRequestHtmlUrl   :: !URL-    , simplePullRequestUpdatedAt :: !UTCTime-    , simplePullRequestBody      :: !(Maybe Text)-    , simplePullRequestAssignees :: (Vector SimpleUser)-    , simplePullRequestIssueUrl  :: !URL-    , simplePullRequestDiffUrl   :: !URL-    , simplePullRequestUrl       :: !URL-    , simplePullRequestLinks     :: !PullRequestLinks-    , simplePullRequestMergedAt  :: !(Maybe UTCTime)-    , simplePullRequestTitle     :: !Text-    , simplePullRequestId        :: !(Id PullRequest)+    { simplePullRequestClosedAt           :: !(Maybe UTCTime)+    , simplePullRequestCreatedAt          :: !UTCTime+    , simplePullRequestUser               :: !SimpleUser+    , simplePullRequestPatchUrl           :: !URL+    , simplePullRequestState              :: !IssueState+    , simplePullRequestNumber             :: !Int+    , simplePullRequestHtmlUrl            :: !URL+    , simplePullRequestUpdatedAt          :: !UTCTime+    , simplePullRequestBody               :: !(Maybe Text)+    , simplePullRequestAssignees          :: (Vector SimpleUser)+    , simplePullRequestRequestedReviewers :: (Vector SimpleUser)+    , simplePullRequestIssueUrl           :: !URL+    , simplePullRequestDiffUrl            :: !URL+    , simplePullRequestUrl                :: !URL+    , simplePullRequestLinks              :: !PullRequestLinks+    , simplePullRequestMergedAt           :: !(Maybe UTCTime)+    , simplePullRequestTitle              :: !Text+    , simplePullRequestId                 :: !(Id PullRequest)     }   deriving (Show, Data, Typeable, Eq, Ord, Generic) @@ -53,35 +54,36 @@ instance Binary SimplePullRequest  data PullRequest = PullRequest-    { pullRequestClosedAt       :: !(Maybe UTCTime)-    , pullRequestCreatedAt      :: !UTCTime-    , pullRequestUser           :: !SimpleUser-    , pullRequestPatchUrl       :: !URL-    , pullRequestState          :: !IssueState-    , pullRequestNumber         :: !Int-    , pullRequestHtmlUrl        :: !URL-    , pullRequestUpdatedAt      :: !UTCTime-    , pullRequestBody           :: !(Maybe Text)-    , pullRequestAssignees      :: (Vector SimpleUser)-    , pullRequestIssueUrl       :: !URL-    , pullRequestDiffUrl        :: !URL-    , pullRequestUrl            :: !URL-    , pullRequestLinks          :: !PullRequestLinks-    , pullRequestMergedAt       :: !(Maybe UTCTime)-    , pullRequestTitle          :: !Text-    , pullRequestId             :: !(Id PullRequest)-    , pullRequestMergedBy       :: !(Maybe SimpleUser)-    , pullRequestChangedFiles   :: !Int-    , pullRequestHead           :: !PullRequestCommit-    , pullRequestComments       :: !Count-    , pullRequestDeletions      :: !Count-    , pullRequestAdditions      :: !Count-    , pullRequestReviewComments :: !Count-    , pullRequestBase           :: !PullRequestCommit-    , pullRequestCommits        :: !Count-    , pullRequestMerged         :: !Bool-    , pullRequestMergeable      :: !(Maybe Bool)-    , pullRequestMergeableState :: !MergeableState+    { pullRequestClosedAt             :: !(Maybe UTCTime)+    , pullRequestCreatedAt            :: !UTCTime+    , pullRequestUser                 :: !SimpleUser+    , pullRequestPatchUrl             :: !URL+    , pullRequestState                :: !IssueState+    , pullRequestNumber               :: !Int+    , pullRequestHtmlUrl              :: !URL+    , pullRequestUpdatedAt            :: !UTCTime+    , pullRequestBody                 :: !(Maybe Text)+    , pullRequestAssignees            :: (Vector SimpleUser)+    , pullRequestRequestedReviewers   :: (Vector SimpleUser)+    , pullRequestIssueUrl             :: !URL+    , pullRequestDiffUrl              :: !URL+    , pullRequestUrl                  :: !URL+    , pullRequestLinks                :: !PullRequestLinks+    , pullRequestMergedAt             :: !(Maybe UTCTime)+    , pullRequestTitle                :: !Text+    , pullRequestId                   :: !(Id PullRequest)+    , pullRequestMergedBy             :: !(Maybe SimpleUser)+    , pullRequestChangedFiles         :: !Int+    , pullRequestHead                 :: !PullRequestCommit+    , pullRequestComments             :: !Count+    , pullRequestDeletions            :: !Count+    , pullRequestAdditions            :: !Count+    , pullRequestReviewComments       :: !Count+    , pullRequestBase                 :: !PullRequestCommit+    , pullRequestCommits              :: !Count+    , pullRequestMerged               :: !Bool+    , pullRequestMergeable            :: !(Maybe Bool)+    , pullRequestMergeableState       :: !MergeableState     }   deriving (Show, Data, Typeable, Eq, Ord, Generic) @@ -197,6 +199,7 @@         <*> o .: "updated_at"         <*> o .:? "body"         <*> o .: "assignees"+        <*> o .:? "requested_reviewers" .!= mempty         <*> o .: "issue_url"         <*> o .: "diff_url"         <*> o .: "url"@@ -237,6 +240,7 @@         <*> o .: "updated_at"         <*> o .:? "body"         <*> o .: "assignees"+        <*> o .:? "requested_reviewers" .!= mempty         <*> o .: "issue_url"         <*> o .: "diff_url"         <*> o .: "url"
src/GitHub/Data/Repos.hs view
@@ -38,6 +38,7 @@     , repoFork            :: !(Maybe Bool)     , repoGitUrl          :: !(Maybe URL)     , repoPrivate         :: !Bool+    , repoArchived        :: !Bool     , repoCloneUrl        :: !(Maybe URL)     , repoSize            :: !(Maybe Int)     , repoUpdatedAt       :: !(Maybe UTCTime)@@ -157,6 +158,7 @@         <*> o .: "fork"         <*> o .:? "git_url"         <*> o .: "private"+        <*> o .:? "archived" .!= False         <*> o .:? "clone_url"         <*> o .:? "size"         <*> o .:? "updated_at"
+ src/GitHub/Data/Statuses.hs view
@@ -0,0 +1,110 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric      #-}+{-# LANGUAGE NoImplicitPrelude  #-}+{-# LANGUAGE OverloadedStrings  #-}+module GitHub.Data.Statuses where++import GitHub.Data.Definitions+import GitHub.Data.Name        (Name)+import GitHub.Data.Id          (Id)+import GitHub.Data.URL         (URL)+import GitHub.Internal.Prelude+import Prelude ()++import GitHub.Data.GitData (Commit)+import GitHub.Data.Repos   (RepoRef)+++data StatusState+    = StatusPending+    | StatusSuccess+    | StatusError+    | StatusFailure+  deriving (Show, Data, Enum, Bounded, Typeable, Eq, Ord, Generic)++instance NFData StatusState where rnf = genericRnf+instance Binary StatusState++instance FromJSON StatusState where+  parseJSON (String "pending") = pure StatusPending+  parseJSON (String "success") = pure StatusSuccess+  parseJSON (String "error")   = pure StatusError+  parseJSON (String "failure") = pure StatusFailure+  parseJSON _ = fail "Could not build a StatusState"++instance ToJSON StatusState where+  toJSON StatusPending = String "pending"+  toJSON StatusSuccess = String "success"+  toJSON StatusError   = String "error"+  toJSON StatusFailure = String "failure"+++data Status = Status+    { statusCreatedAt   :: !UTCTime+    , statusUpdatedAt   :: !UTCTime+    , statusState       :: !StatusState+    , statusTargetUrl   :: !(Maybe URL)+    , statusDescription :: !(Maybe Text)+    , statusId          :: !(Id Status)+    , statusUrl         :: !URL+    , statusContext     :: !(Maybe Text)+    , statusCreator     :: !(Maybe SimpleUser)+    }+  deriving (Show, Data, Typeable, Eq, Ord, Generic)++instance FromJSON Status where+  parseJSON = withObject "Status" $ \o -> Status+      <$> o .: "created_at"+      <*> o .: "updated_at"+      <*> o .: "state"+      <*> o .:? "target_url"+      <*> o .:? "description"+      <*> o .: "id"+      <*> o .: "url"+      <*> o .:? "context"+      <*> o .:? "creator"+++data NewStatus = NewStatus+    { newStatusState       :: !StatusState+    , newStatusTargetUrl   :: !(Maybe URL)+    , newStatusDescription :: !(Maybe Text)+    , newStatusContext     :: !(Maybe Text)+    }+  deriving (Show, Data, Typeable, Eq, Ord, Generic)++instance NFData NewStatus where rnf = genericRnf+instance Binary NewStatus++instance ToJSON NewStatus where+    toJSON (NewStatus s t d c) = object $ filter notNull $+        [ "state"       .= s+        , "target_url"  .= t+        , "description" .= d+        , "context"     .= c+        ]+      where+        notNull (_, Null) = False+        notNull (_, _)    = True+++data CombinedStatus = CombinedStatus+    { combinedStatusState      :: !StatusState+    , combinedStatusSha        :: !(Name Commit)+    , combinedStatusTotalCount :: !Int+    , combinedStatusStatuses   :: !(Vector Status)+    , combinedStatusRepository :: !RepoRef+    , combinedStatusCommitUrl  :: !URL+    , combinedStatusUrl        :: !URL+    }+  deriving (Show, Data, Typeable, Eq, Ord, Generic)++instance FromJSON CombinedStatus where+    parseJSON = withObject "CombinedStatus" $ \o -> CombinedStatus+        <$> o .: "state"+        <*> o .: "sha"+        <*> o .: "total_count"+        <*> o .: "statuses"+        <*> o .: "repository"+        <*> o .: "commit_url"+        <*> o .: "url"
src/GitHub/Endpoints/Gists.hs view
@@ -11,6 +11,12 @@     gist,     gist',     gistR,+    starGist,+    starGistR,+    unstarGist,+    unstarGistR,+    deleteGist,+    deleteGistR,     module GitHub.Data,     ) where @@ -55,3 +61,36 @@ gistR :: Name Gist -> Request k Gist gistR gid =     query ["gists", toPathPart gid] []++-- | Star a gist by the authenticated user.+--+-- > starGist ("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 -> Request 'RW ()+starGistR gid = command Put' ["gists", toPathPart gid, "star"] mempty++-- | Unstar a gist by the authenticated user.+--+-- > unstarGist ("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 -> Request 'RW ()+unstarGistR gid = command Delete ["gists", toPathPart gid, "star"] mempty++-- | Delete a gist by the authenticated user.+--+-- > deleteGist ("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>+deleteGistR :: Name Gist -> Request 'RW ()+deleteGistR gid = command Delete ["gists", toPathPart gid] mempty
src/GitHub/Endpoints/Issues/Comments.hs view
@@ -13,6 +13,8 @@     comments',     createComment,     createCommentR,+    deleteComment,+    deleteCommentR,     editComment,     editCommentR,     module GitHub.Data,@@ -86,5 +88,21 @@ 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 (User (user, 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>+deleteCommentR :: Name Owner -> Name Repo -> Id Comment -> Request 'RW ()+deleteCommentR user repo commid =+    command Delete parts mempty   where     parts = ["repos", toPathPart user, toPathPart repo, "issues", "comments", toPathPart commid]
+ src/GitHub/Endpoints/Repos/Statuses.hs view
@@ -0,0 +1,66 @@+-----------------------------------------------------------------------------+-- |+-- License     :  BSD-3-Clause+-- Maintainer  :  Oleg Grenrus <oleg.grenrus@iki.fi>+--+-- 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 =+    command Post parts . encode+    where+        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>+statusForR :: Name Owner -> Name Repo -> Name Commit -> Request 'RW CombinedStatus+statusForR user repo sha =+    query ["repos", toPathPart user, toPathPart repo, "commits", toPathPart sha, "status"] []