scala.googleapis.storage.BucketLifecycleRule.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class BucketLifecycleRule(
/** The action to take.
*/
action: Option[BucketLifecycleRuleAction] = None,
/** The condition(s) under which the action will be taken.
*/
condition: Option[BucketLifecycleRuleCondition] = None,
)
object BucketLifecycleRule {
implicit val encoder: Encoder[BucketLifecycleRule] = Encoder.instance { x =>
Json.obj("action" := x.action, "condition" := x.condition)
}
implicit val decoder: Decoder[BucketLifecycleRule] = Decoder.instance { c =>
for {
v0 <- c.get[Option[BucketLifecycleRuleAction]]("action")
v1 <- c.get[Option[BucketLifecycleRuleCondition]]("condition")
} yield BucketLifecycleRule(v0, v1)
}
}