scala.googleapis.bigquery.QueryParameter.scala Maven / Gradle / Ivy
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)
}
}