scala.googleapis.bigquery.JobStatisticsEdition.scala Maven / Gradle / Ivy
package googleapis.bigquery
import io.circe._
sealed abstract class JobStatisticsEdition(val value: String) extends Product with Serializable
object JobStatisticsEdition {
/** Default value, which will be treated as ENTERPRISE.
*/
case object RESERVATION_EDITION_UNSPECIFIED
extends JobStatisticsEdition("RESERVATION_EDITION_UNSPECIFIED")
/** Standard edition.
*/
case object STANDARD extends JobStatisticsEdition("STANDARD")
/** Enterprise edition.
*/
case object ENTERPRISE extends JobStatisticsEdition("ENTERPRISE")
/** Enterprise plus edition.
*/
case object ENTERPRISE_PLUS extends JobStatisticsEdition("ENTERPRISE_PLUS")
val values = List(RESERVATION_EDITION_UNSPECIFIED, STANDARD, ENTERPRISE, ENTERPRISE_PLUS)
def fromString(input: String): Either[String, JobStatisticsEdition] = values
.find(_.value == input)
.toRight(s"'$input' was not a valid value for JobStatisticsEdition")
implicit val decoder: Decoder[JobStatisticsEdition] = Decoder[String].emap(s => fromString(s))
implicit val encoder: Encoder[JobStatisticsEdition] = Encoder[String].contramap(_.value)
}