@@ -5,11 +5,10 @@ import play.api.libs.functional.syntax._
5
5
import play .api .libs .json ._
6
6
7
7
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 ,
10
9
sourceRepository : String , sourceBranch : String , sourceCommit : String ,
11
10
destRepository : String , destBranch : String , destCommit : Option [String ],
12
- apiUrls : Seq [ApiUrl ]) {
11
+ apiUrls : Seq [ApiUrl ], authorId : Option [ String ] = None ) {
13
12
val url = s " https://bitbucket.org/ $destRepository/pull-request/ $id"
14
13
}
15
14
@@ -49,7 +48,6 @@ object PullRequest {
49
48
(__ \ " description" ).read[String ] and
50
49
(__ \ " author" \ " username" ).readNullable[String ] and
51
50
(__ \ " author" \ " links" \ " avatar" \ " href" ).readNullable[String ].orElse((__ \ " author" \ " links" ).readNullable[String ]) and
52
- (__ \ " author" \ " uuid" ).readNullable[String ] and
53
51
(__ \ " state" ).read[String ] and
54
52
(__ \ " created_on" ).read[DateTime ] and
55
53
(__ \ " updated_on" ).read[DateTime ] and
@@ -60,7 +58,8 @@ object PullRequest {
60
58
(__ \ " destination" \ " branch" \ " name" ).read[String ] and
61
59
(__ \ " destination" \ " commit" \ " hash" ).readNullable[String ] and
62
60
// 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 ]
64
63
) (PullRequest .apply _)
65
64
66
65
private def parseLinks (links : Map [String , Map [String , String ]]): Seq [ApiUrl ] = {
0 commit comments