scala.googleapis.storage.ObjectRetention.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class ObjectRetention(
/** The bucket's object retention mode, can only be Unlocked or Locked.
*/
mode: Option[String] = None,
/** A time in RFC 3339 format until which object retention protects this object.
*/
retainUntilTime: Option[String] = None,
)
object ObjectRetention {
implicit val encoder: Encoder[ObjectRetention] = Encoder.instance { x =>
Json.obj("mode" := x.mode, "retainUntilTime" := x.retainUntilTime)
}
implicit val decoder: Decoder[ObjectRetention] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("mode")
v1 <- c.get[Option[String]]("retainUntilTime")
} yield ObjectRetention(v0, v1)
}
}