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

scala.googleapis.bigquery.ScriptOptionsKeyResultStatement.scala Maven / Gradle / Ivy

There is a newer version: 0.4.5-v2-20240905
Show newest version
package googleapis.bigquery

import io.circe._

sealed abstract class ScriptOptionsKeyResultStatement(val value: String)
    extends Product
    with Serializable
object ScriptOptionsKeyResultStatement {

  /** Default value.
    */
  case object KEY_RESULT_STATEMENT_KIND_UNSPECIFIED
      extends ScriptOptionsKeyResultStatement("KEY_RESULT_STATEMENT_KIND_UNSPECIFIED")

  /** The last result determines the key result.
    */
  case object LAST extends ScriptOptionsKeyResultStatement("LAST")

  /** The first SELECT statement determines the key result.
    */
  case object FIRST_SELECT extends ScriptOptionsKeyResultStatement("FIRST_SELECT")
  val values = List(KEY_RESULT_STATEMENT_KIND_UNSPECIFIED, LAST, FIRST_SELECT)
  def fromString(input: String): Either[String, ScriptOptionsKeyResultStatement] = values
    .find(_.value == input)
    .toRight(s"'$input' was not a valid value for ScriptOptionsKeyResultStatement")
  implicit val decoder: Decoder[ScriptOptionsKeyResultStatement] =
    Decoder[String].emap(s => fromString(s))
  implicit val encoder: Encoder[ScriptOptionsKeyResultStatement] =
    Encoder[String].contramap(_.value)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy