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