scala.googleapis.bigquery.TableReplicationInfo.scala Maven / Gradle / Ivy
package googleapis.bigquery
import io.circe._
import io.circe.syntax._
final case class TableReplicationInfo(
/** Optional. Output only. Replication error that will permanently stopped table replication.
*/
replicationError: Option[ErrorProto] = None,
/** Optional. Specifies the interval at which the source table is polled for updates. It's Optional. If not specified, default replication interval would be applied.
*/
replicationIntervalMs: Option[Long] = None,
/** Optional. Output only. If source is a materialized view, this field signifies the last refresh time of the source.
*/
replicatedSourceLastRefreshTime: Option[Long] = None,
/** Optional. Output only. Replication status of configured replication.
*/
replicationStatus: Option[TableReplicationInfoReplicationStatus] = None,
/** Required. Source table reference that is replicated.
*/
sourceTable: Option[TableReference] = None,
)
object TableReplicationInfo {
implicit val encoder: Encoder[TableReplicationInfo] = Encoder.instance { x =>
Json.obj(
"replicationError" := x.replicationError,
"replicationIntervalMs" := x.replicationIntervalMs,
"replicatedSourceLastRefreshTime" := x.replicatedSourceLastRefreshTime,
"replicationStatus" := x.replicationStatus,
"sourceTable" := x.sourceTable,
)
}
implicit val decoder: Decoder[TableReplicationInfo] = Decoder.instance { c =>
for {
v0 <- c.get[Option[ErrorProto]]("replicationError")
v1 <- c.get[Option[Long]]("replicationIntervalMs")
v2 <- c.get[Option[Long]]("replicatedSourceLastRefreshTime")
v3 <- c.get[Option[TableReplicationInfoReplicationStatus]]("replicationStatus")
v4 <- c.get[Option[TableReference]]("sourceTable")
} yield TableReplicationInfo(v0, v1, v2, v3, v4)
}
}