scala.googleapis.bigquery.JobStatisticsReservationUsage.scala Maven / Gradle / Ivy
package googleapis.bigquery
import JsonInstances._
import io.circe._
import io.circe.syntax._
import scala.concurrent.duration.FiniteDuration
final case class JobStatisticsReservationUsage(
/** Reservation name or "unreserved" for on-demand resource usage and multi-statement queries.
*/
name: Option[String] = None,
/** Total slot milliseconds used by the reservation for a particular job.
*/
slotMs: Option[FiniteDuration] = None,
)
object JobStatisticsReservationUsage {
implicit val encoder: Encoder[
JobStatisticsReservationUsage
] = Encoder.instance(x => Json.obj("name" := x.name, "slotMs" := x.slotMs))
implicit val decoder: Decoder[
JobStatisticsReservationUsage
] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("name")
v1 <- c.get[Option[FiniteDuration]]("slotMs")
} yield JobStatisticsReservationUsage(v0, v1)
}
}