<commit_before>package com.dius.pact.model

case class Pact(provider:Provider, consumer:Consumer, interactions:Seq[Interaction]) {
  def interactionFor(description:String, providerState:String) = interactions.find { i =>
    i.description == description && i.providerState == providerState
  }
}

case class Provider(name:String)

case class Consumer(name:String)

case class Interaction(
                        description: String,
                        providerState: String,
                        request:Request,
                        response:Response)

class HttpMethod(value:String) {
  override def toString = value
}

case object Get    extends HttpMethod("GET")
case object Post   extends HttpMethod("POST")
case object Put    extends HttpMethod("PUT")
case object Delete extends HttpMethod("DELETE")
case object Head   extends HttpMethod("HEAD")
case object Patch  extends HttpMethod("PATCH")

object HttpMethod {
  def build(key: String) = {
    key.toUpperCase match {
      case "GET" =>   Get<commit_msg>shift responsibility for creating error structures to model<commit_after>package com.dius.pact.model

case class Pact(provider:Provider, consumer:Consumer, interactions:Seq[Interaction]) {
  def interactionFor(description:String, providerState:String) = interactions.find { i =>
    i.description == description && i.providerState == providerState
  }

  def invalidRequest(s:String) = {
    Response(500, Map[String, String](), s"""{"error": "$s"}""")
  }
}

case class Provider(name:String)

case class Consumer(name:String)

case class Interaction(
                        description: String,
                        providerState: String,
                        request:Request,
                        response:Response)

class HttpMethod(value:String) {
  override def toString = value
}

case object Get    extends HttpMethod("GET")
case object Post   extends HttpMethod("POST")
case object Put    extends HttpMethod("PUT")
case object Delete extends HttpMethod("DELETE")
case object Head   extends HttpMethod("HEAD")
case object Patch  extends HttpMethod("PATCH")

object HttpMethod {
  def build(key: String) = {
    key.toUpperCase match {
      case "GET" =>   Get
{'fraction_non_alphanumeric': 0.09759418974126191, 'fraction_numerical': 0.0013617793917385383, 'mean_word_length': 3.381709741550696, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4033784', 'n_tokens_mistral': 577, 'n_tokens_neox': 569, 'n_words': 167}