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

com.codacy.client.bitbucket.v2.Webhook.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.{JsObject, Json, Reads}

case class Webhook(
    uuid: String,
    description: Option[String],
    url: String,
    subject: JsObject,
    events: Set[String],
    active: Boolean,
    created_at: String,
    links: JsObject
)

object Webhook {
  implicit val reads: Reads[Webhook] = Json.reads[Webhook].map {
    case hook =>
      hook.uuid match {
        case uuid if uuid.startsWith("{") && uuid.endsWith("}") =>
          hook.copy(uuid = uuid.drop(1).dropRight(1))
        case _ => hook
      }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy