Skip to content

Commit

Permalink
Add missing webhook event types
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiemcmichael committed Apr 24, 2019
1 parent 9fa0b01 commit 82a223c
Showing 1 changed file with 81 additions and 3 deletions.
84 changes: 81 additions & 3 deletions src/GitHub/Data/Webhooks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,52 @@ instance Binary RepoWebhook

data RepoWebhookEvent
= WebhookWildcardEvent
| WebhookCheckRunEvent
| WebhookCheckSuiteEvent
| WebhookCommitCommentEvent
| WebhookContentReferenceEvent
| WebhookCreateEvent
| WebhookDeleteEvent
| WebhookDeployKeyEvent
| WebhookDeploymentEvent
| WebhookDeploymentStatusEvent
| WebhookDownloadEvent
| WebhookFollowEvent
| WebhookForkEvent
| WebhookForkApplyEvent
| WebhookGitHubAppAuthorizationEvent
| WebhookGistEvent
| WebhookGollumEvent
| WebhookInstallationEvent
| WebhookInstallationRepositoriesEvent
| WebhookIssueCommentEvent
| WebhookIssuesEvent
| WebhookLabelEvent
| WebhookMarketplacePurchaseEvent
| WebhookMemberEvent
| WebhookMembershipEvent
| WebhookMetaEvent
| WebhookMilestoneEvent
| WebhookOrganizationEvent
| WebhookOrgBlockEvent
| WebhookPageBuildEvent
| WebhookPingEvent
| WebhookProjectCardEvent
| WebhookProjectColumnEvent
| WebhookProjectEvent
| WebhookPublicEvent
| WebhookPullRequestReviewCommentEvent
| WebhookPullRequestEvent
| WebhookPullRequestReviewEvent
| WebhookPullRequestReviewCommentEvent
| WebhookPushEvent
| WebhookReleaseEvent
| WebhookRepositoryEvent
| WebhookRepositoryImportEvent
| WebhookRepositoryVulnerabilityAlertEvent
| WebhookSecurityAdvisoryEvent
| WebhookStarEvent
| WebhookStatusEvent
| WebhookTeamEvent
| WebhookTeamAddEvent
| WebhookWatchEvent
deriving (Show, Data, Typeable, Eq, Ord, Generic)
Expand Down Expand Up @@ -105,52 +131,104 @@ instance Binary EditRepoWebhook

instance FromJSON RepoWebhookEvent where
parseJSON (String "*") = pure WebhookWildcardEvent
parseJSON (String "check_run") = pure WebhookCheckRunEvent
parseJSON (String "check_suite") = pure WebhookCheckSuiteEvent
parseJSON (String "commit_comment") = pure WebhookCommitCommentEvent
parseJSON (String "content_reference") = pure WebhookContentReferenceEvent
parseJSON (String "create") = pure WebhookCreateEvent
parseJSON (String "delete") = pure WebhookDeleteEvent
parseJSON (String "deploy_key") = pure WebhookDeployKeyEvent
parseJSON (String "deployment") = pure WebhookDeploymentEvent
parseJSON (String "deployment_status") = pure WebhookDeploymentStatusEvent
parseJSON (String "download") = pure WebhookDownloadEvent
parseJSON (String "follow") = pure WebhookFollowEvent
parseJSON (String "fork") = pure WebhookForkEvent
parseJSON (String "fork_apply") = pure WebhookForkApplyEvent
parseJSON (String "github_app_authorization") = pure WebhookGitHubAppAuthorizationEvent
parseJSON (String "gist") = pure WebhookGistEvent
parseJSON (String "gollum") = pure WebhookGollumEvent
parseJSON (String "installation") = pure WebhookInstallationEvent
parseJSON (String "installation_repositories") = pure WebhookInstallationRepositoriesEvent
parseJSON (String "issue_comment") = pure WebhookIssueCommentEvent
parseJSON (String "issues") = pure WebhookIssuesEvent
parseJSON (String "label") = pure WebhookLabelEvent
parseJSON (String "marketplace_purchase") = pure WebhookMarketplacePurchaseEvent
parseJSON (String "member") = pure WebhookMemberEvent
parseJSON (String "membership") = pure WebhookMembershipEvent
parseJSON (String "meta") = pure WebhookMetaEvent
parseJSON (String "milestone") = pure WebhookMilestoneEvent
parseJSON (String "organization") = pure WebhookOrganizationEvent
parseJSON (String "org_block") = pure WebhookOrgBlockEvent
parseJSON (String "page_build") = pure WebhookPageBuildEvent
parseJSON (String "ping") = pure WebhookPingEvent
parseJSON (String "project_card") = pure WebhookProjectCardEvent
parseJSON (String "project_column") = pure WebhookProjectColumnEvent
parseJSON (String "project") = pure WebhookProjectEvent
parseJSON (String "public") = pure WebhookPublicEvent
parseJSON (String "pull_request_review_comment") = pure WebhookPullRequestReviewCommentEvent
parseJSON (String "pull_request") = pure WebhookPullRequestEvent
parseJSON (String "pull_request_review") = pure WebhookPullRequestReviewEvent
parseJSON (String "pull_request_review_comment") = pure WebhookPullRequestReviewCommentEvent
parseJSON (String "push") = pure WebhookPushEvent
parseJSON (String "release") = pure WebhookReleaseEvent
parseJSON (String "repository") = pure WebhookRepositoryEvent
parseJSON (String "repository_import") = pure WebhookRepositoryImportEvent
parseJSON (String "repository_vulnerability_alert") = pure WebhookRepositoryVulnerabilityAlertEvent
parseJSON (String "security_advisory") = pure WebhookSecurityAdvisoryEvent
parseJSON (String "star") = pure WebhookStarEvent
parseJSON (String "status") = pure WebhookStatusEvent
parseJSON (String "team") = pure WebhookTeamEvent
parseJSON (String "team_add") = pure WebhookTeamAddEvent
parseJSON (String "watch") = pure WebhookWatchEvent
parseJSON _ = fail "Could not build a Webhook event"

instance ToJSON RepoWebhookEvent where
toJSON WebhookWildcardEvent = String "*"
toJSON WebhookCheckRunEvent = String "check_run"
toJSON WebhookCheckSuiteEvent = String "check_suite"
toJSON WebhookCommitCommentEvent = String "commit_comment"
toJSON WebhookContentReferenceEvent = String "content_reference"
toJSON WebhookCreateEvent = String "create"
toJSON WebhookDeleteEvent = String "delete"
toJSON WebhookDeployKeyEvent = String "deploy_key"
toJSON WebhookDeploymentEvent = String "deployment"
toJSON WebhookDeploymentStatusEvent = String "deployment_status"
toJSON WebhookDownloadEvent = String "download"
toJSON WebhookFollowEvent = String "follow"
toJSON WebhookForkEvent = String "fork"
toJSON WebhookForkApplyEvent = String "fork_apply"
toJSON WebhookGitHubAppAuthorizationEvent = String "github_app_authorization"
toJSON WebhookGistEvent = String "gist"
toJSON WebhookGollumEvent = String "gollum"
toJSON WebhookInstallationEvent = String "installation"
toJSON WebhookInstallationRepositoriesEvent = String "installation_repositories"
toJSON WebhookIssueCommentEvent = String "issue_comment"
toJSON WebhookIssuesEvent = String "issues"
toJSON WebhookLabelEvent = String "label"
toJSON WebhookMarketplacePurchaseEvent = String "marketplace_purchase"
toJSON WebhookMemberEvent = String "member"
toJSON WebhookMembershipEvent = String "membership"
toJSON WebhookMetaEvent = String "meta"
toJSON WebhookMilestoneEvent = String "milestone"
toJSON WebhookOrganizationEvent = String "organization"
toJSON WebhookOrgBlockEvent = String "org_block"
toJSON WebhookPageBuildEvent = String "page_build"
toJSON WebhookPingEvent = String "ping"
toJSON WebhookProjectCardEvent = String "project_card"
toJSON WebhookProjectColumnEvent = String "project_column"
toJSON WebhookProjectEvent = String "project"
toJSON WebhookPublicEvent = String "public"
toJSON WebhookPullRequestReviewCommentEvent = String "pull_request_review_comment"
toJSON WebhookPullRequestEvent = String "pull_request"
toJSON WebhookPullRequestReviewEvent = String "pull_request_review"
toJSON WebhookPullRequestReviewCommentEvent = String "pull_request_review_comment"
toJSON WebhookPushEvent = String "push"
toJSON WebhookReleaseEvent = String "release"
toJSON WebhookRepositoryEvent = String "repository"
toJSON WebhookRepositoryImportEvent = String "repository_import"
toJSON WebhookRepositoryVulnerabilityAlertEvent = String "repository_vulnerability_alert"
toJSON WebhookSecurityAdvisoryEvent = String "security_advisory"
toJSON WebhookStarEvent = String "star"
toJSON WebhookStatusEvent = String "status"
toJSON WebhookTeamEvent = String "team"
toJSON WebhookTeamAddEvent = String "team_add"
toJSON WebhookWatchEvent = String "watch"

Expand Down

0 comments on commit 82a223c

Please sign in to comment.