<commit_before>package almhirt.docit

import scalaz._, Scalaz._

trait DocItPathNode{
  def name: String
  def title: String
  def description: String
  def uriPatternPart: String
}

case class DocTreeNode(payload: DocItPathNode, children: List[DocTreeNode] = Nil)

case class ServiceDoc(
  name: String,
  title: String,
  description: String) extends DocItPathNode {
  def uriPatternPart = name
}
  
case class ResourceDoc(
  name: String,
  title: String,
  description: String,
  parameter: Option[String],
  requiresAuthentication: Boolean,
  methods: List[MethodDoc]= Nil) extends DocItPathNode {
  val uriPatternPart = if(parameter.isEmpty) name else "{%s}".format(name)
}
  
sealed trait MethodDoc {
  def name: String
  def description: String
  def methodParams: List[MethodParamDoc]
  def contentTypes: List[ContentTypeDoc]
  def headers: List[HeaderDoc]
}

case class GET(description: String, methodParams: List[MethodParamDoc] = Nil, contentTypes: List[ContentTypeDoc] = Nil, headers: List[HeaderDoc] = Nil) extends MethodDoc { val name = "GET"}
case class PUT(description: String, methodParams: List[MethodParamDoc] = Nil, contentTypes: List[ContentTypeDoc] = Nil, headers: List[HeaderDoc] = Nil) extends MethodDoc { val name = "PUT"}
case class POST(description: String, methodParams: List[MethodParamDoc] = Nil, contentTypes: List[ContentTypeDoc] = Nil, headers: List[HeaderDoc] = Nil) extends MethodDoc { val name = "POST"}
case class DELETE(description: String, methodParams: List[MethodParamDoc] = Nil, contentTypes: List[ContentTypeDoc] = Nil, headers: List[HeaderDoc] = Nil) extends MethodDoc { val name = "DELETE"}


sealed trait ContentTypeDoc{
  def headerString: String
  def docLink: Option[String]
}

case object AppXml extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/application/index.html""")
  val headerString = "application/xml"
}
case object AppJson extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/application/index.html""")
  val headerString = "application/json"
}
case object ImgJpeg extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/image/index.html""")
  val headerString = "image/jpeg"
}
case object ImgPng extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/image/index.html""")
  val headerString = "image/png"
}

case object TextPlain extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/text/index.html""")
  val headerString = "text/plain"
}

case class CustomContentType(headerString: String, docLink: Option[String] = None) extends ContentTypeDoc

sealed trait MethodParamDoc{
  def name: String
  def description: String
  def isFlag: Boolean
}

case class MethodParamFlag(name: String, description: String) extends MethodParamDoc {
  val isFlag = true
}

case class MethodParamValues(name: String, description: String) extends MethodParamDoc {
  val isFlag = false
}

sealed trait HeaderDoc

<commit_msg>added content types<commit_after>package almhirt.docit

import scalaz._, Scalaz._

trait DocItPathNode{
  def name: String
  def title: String
  def description: String
  def uriPatternPart: String
}

case class DocTreeNode(payload: DocItPathNode, children: List[DocTreeNode] = Nil)

case class ServiceDoc(
  name: String,
  title: String,
  description: String) extends DocItPathNode {
  def uriPatternPart = name
}
  
case class ResourceDoc(
  name: String,
  title: String,
  description: String,
  parameter: Option[String],
  requiresAuthentication: Boolean,
  methods: List[MethodDoc]= Nil) extends DocItPathNode {
  val uriPatternPart = if(parameter.isEmpty) name else "{%s}".format(name)
}
  
sealed trait MethodDoc {
  def name: String
  def description: String
  def methodParams: List[MethodParamDoc]
  def contentTypes: List[ContentTypeDoc]
  def headers: List[HeaderDoc]
}

case class GET(description: String, methodParams: List[MethodParamDoc] = Nil, contentTypes: List[ContentTypeDoc] = Nil, headers: List[HeaderDoc] = Nil) extends MethodDoc { val name = "GET"}
case class PUT(description: String, methodParams: List[MethodParamDoc] = Nil, contentTypes: List[ContentTypeDoc] = Nil, headers: List[HeaderDoc] = Nil) extends MethodDoc { val name = "PUT"}
case class POST(description: String, methodParams: List[MethodParamDoc] = Nil, contentTypes: List[ContentTypeDoc] = Nil, headers: List[HeaderDoc] = Nil) extends MethodDoc { val name = "POST"}
case class DELETE(description: String, methodParams: List[MethodParamDoc] = Nil, contentTypes: List[ContentTypeDoc] = Nil, headers: List[HeaderDoc] = Nil) extends MethodDoc { val name = "DELETE"}


sealed trait ContentTypeDoc{
  def headerString: String
  def docLink: Option[String]
}

case object AppXml extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/application/index.html""")
  val headerString = "application/xml"
}
case object AppJson extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/application/index.html""")
  val headerString = "application/json"
}
case object ImgJpeg extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/image/index.html""")
  val headerString = "image/jpeg"
}
case object ImgPng extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/image/index.html""")
  val headerString = "image/png"
}

case object TextPlain extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/text/index.html""")
  val headerString = "text/plain"
}

case object TextXml extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/text/index.html""")
  val headerString = "text/xml"
}

case object TextRichText extends ContentTypeDoc {
  val docLink = Some("""http://www.iana.org/assignments/media-types/text/index.html""")
  val headerString = "text/richtext"
}

case class CustomContentType(headerString: String, docLink: Option[String] = None) extends ContentTypeDoc

sealed trait MethodParamDoc{
  def name: String
  def description: String
  def isFlag: Boolean
}

case class MethodParamFlag(name: String, description: String) extends MethodParamDoc {
  val isFlag = true
}

case class MethodParamValues(name: String, description: String) extends MethodParamDoc {
  val isFlag = false
}

sealed trait HeaderDoc


{'fraction_non_alphanumeric': 0.10761390887290168, 'fraction_numerical': 0.0, 'mean_word_length': 4.519437551695616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, 'xml': 3}, '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': '935195', 'n_tokens_mistral': 2061, 'n_tokens_neox': 1989, 'n_words': 552}