All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.codacy.client.bitbucket.v2.SimpleCommitSha.scala Maven / Gradle / Ivy

There is a newer version: 19.0.7
Show newest version
package com.codacy.client.bitbucket.v2

import play.api.libs.json._

case class SimpleCommitSha(value: String)

object SimpleCommitSha {
  implicit def commitReader: Reads[SimpleCommitSha] = Reads { (json: JsValue) =>
    (for {
      hash <- (json \ "hash").asOpt[String]
    } yield SimpleCommitSha(hash))
      .map(JsSuccess(_))
      .getOrElse(JsError("could not read commit"))
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy