Skip to content

Commit dfe149b

Browse files
committed
retreive more pull request info
1 parent 5e58fb4 commit dfe149b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/main/scala/com/codacy/client/bitbucket/PullRequest.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ import org.joda.time.DateTime
44
import play.api.libs.functional.syntax._
55
import play.api.libs.json._
66

7-
case class PullRequest(id: Long, title: String, description: String, author: String,
7+
case class PullRequest(id: Long, title: String, description: String,
8+
authorUsername: String, authorAvatar: String,
89
state: String, created_on: DateTime, updated_on: DateTime,
9-
destBranch: String, destCommit: String)
10+
sourceRepository: String, sourceBranch: String, sourceCommit: String,
11+
destRepository: String, destBranch: String, destCommit: String) {
12+
val url: String = s"https://bitbucket.org/$destRepository/pull-request/$id"
13+
}
1014

1115
object PullRequest {
1216
val dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSZZ"
@@ -17,9 +21,14 @@ object PullRequest {
1721
(__ \ "title").read[String] and
1822
(__ \ "description").read[String] and
1923
(__ \ "author" \ "username").read[String] and
24+
(__ \ "author" \ "links" \ "avatar").read[String] and
2025
(__ \ "state").read[String] and
2126
(__ \ "created_on").read[DateTime] and
2227
(__ \ "updated_on").read[DateTime] and
28+
(__ \ "source" \ "repository" \ "full_name").read[String] and
29+
(__ \ "source" \ "branch" \ "name").read[String] and
30+
(__ \ "source" \ "commit" \ "hash").read[String] and
31+
(__ \ "destination" \ "repository" \ "full_name").read[String] and
2332
(__ \ "destination" \ "branch" \ "name").read[String] and
2433
(__ \ "destination" \ "commit" \ "hash").read[String]
2534
)(PullRequest.apply _)

0 commit comments

Comments
 (0)