def reads()

in common/app/model/Formats.scala [76:93]


  def reads(json: JsValue): JsResult[CardStyle] = {
    (json \ "type").transform[JsString](Reads.JsStringReads) match {
      case JsSuccess(JsString("SpecialReport"), _)    => JsSuccess(SpecialReport)
      case JsSuccess(JsString("SpecialReportAlt"), _) => JsSuccess(SpecialReportAlt)
      case JsSuccess(JsString("LiveBlog"), _)         => JsSuccess(LiveBlog)
      case JsSuccess(JsString("DeadBlog"), _)         => JsSuccess(DeadBlog)
      case JsSuccess(JsString("Feature"), _)          => JsSuccess(Feature)
      case JsSuccess(JsString("Editorial"), _)        => JsSuccess(Editorial)
      case JsSuccess(JsString("Comment"), _)          => JsSuccess(Comment)
      case JsSuccess(JsString("Media"), _)            => JsSuccess(Media)
      case JsSuccess(JsString("Analysis"), _)         => JsSuccess(Analysis)
      case JsSuccess(JsString("Review"), _)           => JsSuccess(Review)
      case JsSuccess(JsString("Letters"), _)          => JsSuccess(Letters)
      case JsSuccess(JsString("ExternalLink"), _)     => JsSuccess(ExternalLink)
      case JsSuccess(JsString("DefaultCardstyle"), _) => JsSuccess(DefaultCardstyle)
      case _                                          => JsError("Could not convert CardStyle")
    }
  }