<commit_before>package models.hms

import play.api.libs.json._

/**
  * author: cvandrei
  * since: 2016-02-17
  */
case class Transcode(SourceType: String,
                     Sources: List[Source],
                     Collapsed: Option[Boolean],
                     CollapsedName: Option[String],
                     DownloadProvision: String,
                     PushFinishedNotification: Boolean,
                     PushErrorNotification: Boolean,
                     PushStatusNotification: Boolean,
                     PushNotificationCallback: String
                    )

object Transcode {

  implicit object TranscodeReads extends Format[Transcode] {

    override def reads(json: JsValue): JsResult[Transcode] = {

      val collapsed = (json \ "Collapsed").asOpt[String] match {
        case Some("true") => Some(true)
        case Some("false") => Some(false)
        case None => None
      }

      val transcode = Transcode(
        (json \ "SourceType").as[String],
        (json \ "Sources").as[List[Source]],
        collapsed,
        (json \ "CollapsedName").asOpt[String],
        (json \ "DownloadProvision").as[String],
        (json \ "PushFinishedNotification").as[String].toBoolean,
        (json \ "PushErrorNotification").as[String].toBoolean,
        (json \ "PushStatusNotification").as[String].toBoolean,<commit_msg>match is now exhausting<commit_after>package models.hms

import play.api.libs.json._

/**
  * author: cvandrei
  * since: 2016-02-17
  */
case class Transcode(SourceType: String,
                     Sources: List[Source],
                     Collapsed: Option[Boolean],
                     CollapsedName: Option[String],
                     DownloadProvision: String,
                     PushFinishedNotification: Boolean,
                     PushErrorNotification: Boolean,
                     PushStatusNotification: Boolean,
                     PushNotificationCallback: String
                    )

object Transcode {

  implicit object TranscodeReads extends Format[Transcode] {

    override def reads(json: JsValue): JsResult[Transcode] = {

      val collapsed = (json \ "Collapsed").asOpt[String] match {
        case Some("true") => Some(true)
        case Some("false") => Some(false)
        case _ => None
      }

      val transcode = Transcode(
        (json \ "SourceType").as[String],
        (json \ "Sources").as[List[Source]],
        collapsed,
        (json \ "CollapsedName").asOpt[String],
        (json \ "DownloadProvision").as[String],
        (json \ "PushFinishedNotification").as[String].toBoolean,
        (json \ "PushErrorNotification").as[String].toBoolean,
        (json \ "PushStatusNotification").as[String].toBoolean,
{'fraction_non_alphanumeric': 0.11457950789570327, 'fraction_numerical': 0.0058758721997796545, 'mean_word_length': 2.1095890410958904, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7294975', 'n_tokens_mistral': 743, 'n_tokens_neox': 696, 'n_words': 145}