scala.googleapis.bigquery.ScriptOptions.scala Maven / Gradle / Ivy
package googleapis.bigquery
import io.circe._
import io.circe.syntax._
final case class ScriptOptions(
/** Determines which statement in the script represents the "key result", used to populate the schema and query results of the script job. Default is LAST.
*/
keyResultStatement: Option[ScriptOptionsKeyResultStatement] = None,
/** Limit on the number of bytes billed per statement. Exceeding this budget results in an error.
*/
statementByteBudget: Option[Long] = None,
/** Timeout period for each statement in a script.
*/
statementTimeoutMs: Option[Long] = None,
)
object ScriptOptions {
implicit val encoder: Encoder[ScriptOptions] = Encoder.instance { x =>
Json.obj(
"keyResultStatement" := x.keyResultStatement,
"statementByteBudget" := x.statementByteBudget,
"statementTimeoutMs" := x.statementTimeoutMs,
)
}
implicit val decoder: Decoder[ScriptOptions] = Decoder.instance { c =>
for {
v0 <- c.get[Option[ScriptOptionsKeyResultStatement]]("keyResultStatement")
v1 <- c.get[Option[Long]]("statementByteBudget")
v2 <- c.get[Option[Long]]("statementTimeoutMs")
} yield ScriptOptions(v0, v1, v2)
}
}