From aa9e34e992058ce1b5ff6e23494a14712ab48e98 Mon Sep 17 00:00:00 2001 From: takezoe Date: Thu, 12 Sep 2013 12:57:07 +0900 Subject: [PATCH] (refs #74)Added case classes for payload of web hook. --- src/main/scala/service/WebHookService.scala | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/main/scala/service/WebHookService.scala b/src/main/scala/service/WebHookService.scala index 0c050d9d0..a6e4d50d8 100644 --- a/src/main/scala/service/WebHookService.scala +++ b/src/main/scala/service/WebHookService.scala @@ -17,3 +17,39 @@ trait WebHookService { Query(WebHooks).filter(_.byPrimaryKey(owner, repository, url)).delete } + +object WebHookService { + + case class WebHookPayload( + before: String, + after: String, + ref: String, + commits: List[WebHookCommit], + repository: WebHookRepository) + + case class WebHookCommit( + id: String, + message: String, + timestamp: String, + url: String, + added: List[String], + removed: List[String], + modified: List[String], + author: WebHookUser) + + case class WebHookRepository( + name: String, + url: String, + pledgie: String, + description: String, + homepage: String, + watchers: Int, + forks: Int, + `private`: Boolean, + owner: WebHookUser) + + case class WebHookUser( + name: String, + email: String) + +}