scala.googleapis.storage.BucketAutoclass.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class BucketAutoclass(
/** Whether or not Autoclass is enabled on this bucket
*/
enabled: Option[Boolean] = None,
/** The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE.
*/
terminalStorageClass: Option[String] = None,
/** A date and time in RFC 3339 format representing the time of the most recent update to "terminalStorageClass".
*/
terminalStorageClassUpdateTime: Option[String] = None,
/** A date and time in RFC 3339 format representing the instant at which "enabled" was last toggled.
*/
toggleTime: Option[String] = None,
)
object BucketAutoclass {
implicit val encoder: Encoder[BucketAutoclass] = Encoder.instance { x =>
Json.obj(
"enabled" := x.enabled,
"terminalStorageClass" := x.terminalStorageClass,
"terminalStorageClassUpdateTime" := x.terminalStorageClassUpdateTime,
"toggleTime" := x.toggleTime,
)
}
implicit val decoder: Decoder[BucketAutoclass] = Decoder.instance { c =>
for {
v0 <- c.get[Option[Boolean]]("enabled")
v1 <- c.get[Option[String]]("terminalStorageClass")
v2 <- c.get[Option[String]]("terminalStorageClassUpdateTime")
v3 <- c.get[Option[String]]("toggleTime")
} yield BucketAutoclass(v0, v1, v2, v3)
}
}