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

scala.googleapis.bigquery.TableMetadataCacheUsageUnusedReason.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 TableMetadataCacheUsageUnusedReason(val value: String)
    extends Product
    with Serializable
object TableMetadataCacheUsageUnusedReason {

  /** Unused reasons not specified.
    */
  case object UNUSED_REASON_UNSPECIFIED
      extends TableMetadataCacheUsageUnusedReason("UNUSED_REASON_UNSPECIFIED")

  /** Metadata cache was outside the table's maxStaleness.
    */
  case object EXCEEDED_MAX_STALENESS
      extends TableMetadataCacheUsageUnusedReason("EXCEEDED_MAX_STALENESS")

  /** Metadata caching feature is not enabled. [Update BigLake tables] (/bigquery/docs/create-cloud-storage-table-biglake#update-biglake-tables) to enable the metadata caching.
    */
  case object METADATA_CACHING_NOT_ENABLED
      extends TableMetadataCacheUsageUnusedReason("METADATA_CACHING_NOT_ENABLED")

  /** Other unknown reason.
    */
  case object OTHER_REASON extends TableMetadataCacheUsageUnusedReason("OTHER_REASON")
  val values = List(
    UNUSED_REASON_UNSPECIFIED,
    EXCEEDED_MAX_STALENESS,
    METADATA_CACHING_NOT_ENABLED,
    OTHER_REASON,
  )
  def fromString(input: String): Either[String, TableMetadataCacheUsageUnusedReason] = values
    .find(_.value == input)
    .toRight(s"'$input' was not a valid value for TableMetadataCacheUsageUnusedReason")
  implicit val decoder: Decoder[TableMetadataCacheUsageUnusedReason] =
    Decoder[String].emap(s => fromString(s))
  implicit val encoder: Encoder[TableMetadataCacheUsageUnusedReason] =
    Encoder[String].contramap(_.value)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy