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

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

There is a newer version: 0.6.1-v2-20241111
Show newest version
package googleapis.bigquery

import io.circe._
import io.circe.syntax._

final case class TableMetadataCacheUsage(
    /** [Table type](https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#Table.FIELDS.type).
      */
    tableType: Option[String] = None,
    /** Metadata caching eligible table referenced in the query.
      */
    tableReference: Option[TableReference] = None,
    /** Duration since last refresh as of this job for managed tables (indicates metadata cache staleness as seen by this job).
      */
    staleness: Option[String] = None,
    /** Free form human-readable reason metadata caching was unused for the job.
      */
    explanation: Option[String] = None,
    /** Reason for not using metadata caching for the table.
      */
    unusedReason: Option[TableMetadataCacheUsageUnusedReason] = None,
)
object TableMetadataCacheUsage {
  implicit val encoder: Encoder[
    TableMetadataCacheUsage
  ] = Encoder.instance { x =>
    Json.obj(
      "tableType" := x.tableType,
      "tableReference" := x.tableReference,
      "staleness" := x.staleness,
      "explanation" := x.explanation,
      "unusedReason"
        := x.unusedReason,
    )
  }
  implicit val decoder: Decoder[
    TableMetadataCacheUsage
  ] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[String]]("tableType")
      v1 <- c.get[Option[TableReference]]("tableReference")
      v2 <- c.get[Option[String]]("staleness")
      v3 <- c.get[Option[String]]("explanation")
      v4 <- c.get[Option[TableMetadataCacheUsageUnusedReason]]("unusedReason")
    } yield TableMetadataCacheUsage(v0, v1, v2, v3, v4)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy