yannick-cw / contenful-scala   0.0.4

GitHub

Providing scala binding for contentful

Scala versions: 2.12

contentful-scala

Generic CMAEntry reader

import com.contentful.java.cma.model.CMAEntry
import io.yannick_cw.contenful.parser.MetaInfo._
import io.yannick_cw.contenful.parser.syntax._
import io.yannick_cw.contenful.parser.auto._

case class Person(
  name: String,
  age: Int,
  more: Option[String],
  results: List[Int],
  // meta-info
  createdAt: CreatedAt,
  updatedAt: Option[UpdatedAt],
  firstPublishedAt: Option[FirstPublishedAt],
  publishedAt: Option[PublishedAt],
  status: Status
)

val entry: CmaEntry = ???
println(entry.as[Person])