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

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

The newest version!
package googleapis.storage

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

final case class RewriteResponse(
    /** The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.
      */
    totalBytesRewritten: Option[Long] = None,
    /** A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes.
      */
    resource: Option[Object] = None,
    /** A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy.
      */
    rewriteToken: Option[String] = None,
    /** true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response.
      */
    done: Option[Boolean] = None,
    /** The kind of item this is.
      */
    kind: Option[String] = None,
    /** The total size of the object being copied in bytes. This property is always present in the response.
      */
    objectSize: Option[Long] = None,
)
object RewriteResponse {
  implicit val encoder: Encoder[RewriteResponse] = Encoder.instance { x =>
    Json.obj(
      "totalBytesRewritten" := x.totalBytesRewritten,
      "resource" := x.resource,
      "rewriteToken" := x.rewriteToken,
      "done" := x.done,
      "kind" := x.kind,
      "objectSize" := x.objectSize,
    )
  }
  implicit val decoder: Decoder[RewriteResponse] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[Long]]("totalBytesRewritten")
      v1 <- c.get[Option[Object]]("resource")
      v2 <- c.get[Option[String]]("rewriteToken")
      v3 <- c.get[Option[Boolean]]("done")
      v4 <- c.get[Option[String]]("kind")
      v5 <- c.get[Option[Long]]("objectSize")
    } yield RewriteResponse(v0, v1, v2, v3, v4, v5)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy