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

scala.googleapis.bigquery.QueryParameter.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 QueryParameter(
    /** Optional. If unset, this is a positional parameter. Otherwise, should be unique within a query.
      */
    name: Option[String] = None,
    /** Required. The type of this parameter.
      */
    parameterType: Option[QueryParameterType] = None,
    /** Required. The value of this parameter.
      */
    parameterValue: Option[QueryParameterValue] = None,
)
object QueryParameter {
  implicit val encoder: Encoder[QueryParameter] = Encoder.instance { x =>
    Json.obj(
      "name" := x.name,
      "parameterType" := x.parameterType,
      "parameterValue" :=
        x.parameterValue,
    )
  }
  implicit val decoder: Decoder[QueryParameter] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[String]]("name")
      v1 <- c.get[Option[QueryParameterType]]("parameterType")
      v2 <- c.get[Option[QueryParameterValue]]("parameterValue")
    } yield QueryParameter(v0, v1, v2)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy