scala.googleapis.bigquery.JobStatistics2ReservationUsage.scala Maven / Gradle / Ivy
package googleapis.bigquery
import JsonInstances._
import io.circe._
import io.circe.syntax._
import scala.concurrent.duration.FiniteDuration
final case class JobStatistics2ReservationUsage(
/** 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 JobStatistics2ReservationUsage {
implicit val encoder: Encoder[
JobStatistics2ReservationUsage
] = Encoder.instance(x => Json.obj("name" := x.name, "slotMs" := x.slotMs))
implicit val decoder: Decoder[
JobStatistics2ReservationUsage
] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("name")
v1 <- c.get[Option[FiniteDuration]]("slotMs")
} yield JobStatistics2ReservationUsage(v0, v1)
}
}