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

scala.googleapis.bigquery.TableConstraints.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 TableConstraints(
    /** Optional. Present only if the table has a foreign key. The foreign key is not enforced.
      */
    foreignKeys: Option[List[TableConstraintsForeignKey]] = None,
    /** Represents the primary key constraint on a table's columns.
      */
    primaryKey: Option[TableConstraintsPrimaryKey] = None,
)
object TableConstraints {
  implicit val encoder: Encoder[TableConstraints] = Encoder.instance { x =>
    Json.obj("foreignKeys" := x.foreignKeys, "primaryKey" := x.primaryKey)
  }
  implicit val decoder: Decoder[TableConstraints] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[List[TableConstraintsForeignKey]]]("foreignKeys")
      v1 <- c.get[Option[TableConstraintsPrimaryKey]]("primaryKey")
    } yield TableConstraints(v0, v1)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy