All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.googleapis.storage.BulkRestoreObjectsRequest.scala Maven / Gradle / Ivy

The newest version!
package googleapis.storage

import io.circe._
import io.circe.syntax._

final case class BulkRestoreObjectsRequest(
    /** If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false.
      */
    copySourceAcl: Option[Boolean] = None,
    /** Restores only the objects that were soft-deleted after this time.
      */
    softDeletedAfterTime: Option[String] = None,
    /** Restores only the objects that were soft-deleted before this time.
      */
    softDeletedBeforeTime: Option[String] = None,
    /** If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue.
      */
    allowOverwrite: Option[Boolean] = None,
    /** Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range.
      */
    matchGlobs: Option[List[String]] = None,
)
object BulkRestoreObjectsRequest {
  implicit val encoder: Encoder[
    BulkRestoreObjectsRequest
  ] = Encoder.instance { x =>
    Json.obj(
      "copySourceAcl" := x.copySourceAcl,
      "softDeletedAfterTime" := x.softDeletedAfterTime,
      "softDeletedBeforeTime" := x.softDeletedBeforeTime,
      "allowOverwrite" := x.allowOverwrite,
      "matchGlobs" := x.matchGlobs,
    )
  }
  implicit val decoder: Decoder[
    BulkRestoreObjectsRequest
  ] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[Boolean]]("copySourceAcl")
      v1 <- c.get[Option[String]]("softDeletedAfterTime")
      v2 <- c.get[Option[String]]("softDeletedBeforeTime")
      v3 <- c.get[Option[Boolean]]("allowOverwrite")
      v4 <- c.get[Option[List[String]]]("matchGlobs")
    } yield BulkRestoreObjectsRequest(v0, v1, v2, v3, v4)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy