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

scala.googleapis.bigquery.QueryParameterValue.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 QueryParameterValue(
    /** Optional. The array values, if this is an array type.
      */
    arrayValues: Option[List[QueryParameterValue]] = None,
    /** Optional. The range value, if this is a range type.
      */
    rangeValue: Option[RangeValue] = None,
    /** The struct field values.
      */
    structValues: Option[Map[String, QueryParameterValue]] = None,
    /** Optional. The value of this value, if a simple scalar type.
      */
    value: Option[String] = None,
)
object QueryParameterValue {
  implicit val encoder: Encoder[QueryParameterValue] = Encoder.instance { x =>
    Json.obj(
      "arrayValues" := x.arrayValues,
      "rangeValue" := x.rangeValue,
      "structValues" := x.structValues,
      "value" := x.value,
    )
  }
  implicit val decoder: Decoder[QueryParameterValue] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[List[QueryParameterValue]]]("arrayValues")
      v1 <- c.get[Option[RangeValue]]("rangeValue")
      v2 <- c.get[Option[Map[String, QueryParameterValue]]]("structValues")
      v3 <- c.get[Option[String]]("value")
    } yield QueryParameterValue(v0, v1, v2, v3)

  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy