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

scala.googleapis.bigquery.Cluster.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 Cluster(
    /** Centroid id.
      */
    centroidId: Option[Long] = None,
    /** Count of training data rows that were assigned to this cluster.
      */
    count: Option[Long] = None,
    /** Values of highly variant features for this cluster.
      */
    featureValues: Option[List[FeatureValue]] = None,
)
object Cluster {
  implicit val encoder: Encoder[Cluster] = Encoder.instance { x =>
    Json.obj(
      "centroidId" := x.centroidId,
      "count" := x.count,
      "featureValues" := x.featureValues,
    )
  }
  implicit val decoder: Decoder[Cluster] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[Long]]("centroidId")
      v1 <- c.get[Option[Long]]("count")
      v2 <- c.get[Option[List[FeatureValue]]]("featureValues")
    } yield Cluster(v0, v1, v2)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy