All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.googleapis.bigquery.DataSplitResult.scala Maven / Gradle / Ivy

There is a newer version: 0.4.5-v2-20240905
Show newest version
package googleapis.bigquery

import io.circe._
import io.circe.syntax._

final case class DataSplitResult(
    /** Table reference of the evaluation data after split.
      */
    evaluationTable: Option[TableReference] = None,
    /** Table reference of the test data after split.
      */
    testTable: Option[TableReference] = None,
    /** Table reference of the training data after split.
      */
    trainingTable: Option[TableReference] = None,
)
object DataSplitResult {
  implicit val encoder: Encoder[DataSplitResult] = Encoder.instance { x =>
    Json.obj(
      "evaluationTable" := x.evaluationTable,
      "testTable" := x.testTable,
      "trainingTable" := x.trainingTable,
    )
  }
  implicit val decoder: Decoder[DataSplitResult] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[TableReference]]("evaluationTable")
      v1 <- c.get[Option[TableReference]]("testTable")
      v2 <- c.get[Option[TableReference]]("trainingTable")
    } yield DataSplitResult(v0, v1, v2)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy