Skip to content

Commit 62f6c11

Browse files
committed
Change parameters order
1 parent 2178c18 commit 62f6c11

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import play.api.libs.functional.syntax._
55
import play.api.libs.json._
66

77
case class PullRequest(id: Long, title: String, description: String,
8-
authorUsername: Option[String], authorAvatar: Option[String],
9-
authorId: Option[String], state: String, created_on: DateTime, updated_on: DateTime,
8+
authorUsername: Option[String], authorAvatar: Option[String], state: String, created_on: DateTime, updated_on: DateTime,
109
sourceRepository: String, sourceBranch: String, sourceCommit: String,
1110
destRepository: String, destBranch: String, destCommit: Option[String],
12-
apiUrls: Seq[ApiUrl]) {
11+
apiUrls: Seq[ApiUrl], authorId: Option[String] = None) {
1312
val url = s"https://bitbucket.org/$destRepository/pull-request/$id"
1413
}
1514

@@ -49,7 +48,6 @@ object PullRequest {
4948
(__ \ "description").read[String] and
5049
(__ \ "author" \ "username").readNullable[String] and
5150
(__ \ "author" \ "links" \ "avatar" \ "href").readNullable[String].orElse((__ \ "author" \ "links").readNullable[String]) and
52-
(__ \ "author" \ "uuid").readNullable[String] and
5351
(__ \ "state").read[String] and
5452
(__ \ "created_on").read[DateTime] and
5553
(__ \ "updated_on").read[DateTime] and
@@ -60,7 +58,8 @@ object PullRequest {
6058
(__ \ "destination" \ "branch" \ "name").read[String] and
6159
(__ \ "destination" \ "commit" \ "hash").readNullable[String] and
6260
// TODO: (__ \ "destination" \ "commit" \ "hash").read[Option[String]] and
63-
(__ \ "links").read[Map[String, Map[String, String]]].map(parseLinks)
61+
(__ \ "links").read[Map[String, Map[String, String]]].map(parseLinks) and
62+
(__ \ "author" \ "uuid").readNullable[String]
6463
) (PullRequest.apply _)
6564

6665
private def parseLinks(links: Map[String, Map[String, String]]): Seq[ApiUrl] = {

0 commit comments

Comments
 (0)