scala.googleapis.storage.AnywhereCache.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class AnywhereCache(
/** The current state of the cache instance.
*/
state: Option[String] = None,
/** The creation time of the cache instance in RFC 3339 format.
*/
createTime: Option[String] = None,
/** The ID of the Anywhere cache instance.
*/
anywhereCacheId: Option[String] = None,
/** The link to this cache instance.
*/
selfLink: Option[String] = None,
/** The cache-level entry admission policy.
*/
admissionPolicy: Option[String] = None,
/** The ID of the resource, including the project number, bucket name and anywhere cache ID.
*/
id: Option[String] = None,
/** The name of the bucket containing this cache instance.
*/
bucket: Option[String] = None,
/** The kind of item this is. For Anywhere Cache, this is always storage#anywhereCache.
*/
kind: Option[String] = None,
/** The TTL of all cache entries in whole seconds. e.g., "7200s".
*/
ttl: Option[String] = None,
/** The zone in which the cache instance is running. For example, us-central1-a.
*/
zone: Option[String] = None,
/** The modification time of the cache instance metadata in RFC 3339 format.
*/
updateTime: Option[String] = None,
/** True if the cache instance has an active Update long-running operation.
*/
pendingUpdate: Option[Boolean] = None,
)
object AnywhereCache {
implicit val encoder: Encoder[AnywhereCache] = Encoder.instance { x =>
Json.obj(
"state" := x.state,
"createTime" := x.createTime,
"anywhereCacheId" := x.anywhereCacheId,
"selfLink" := x.selfLink,
"admissionPolicy" := x.admissionPolicy,
"id" := x.id,
"bucket" := x.bucket,
"kind" := x.kind,
"ttl" := x.ttl,
"zone" := x.zone,
"updateTime" := x.updateTime,
"pendingUpdate" := x.pendingUpdate,
)
}
implicit val decoder: Decoder[AnywhereCache] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("state")
v1 <- c.get[Option[String]]("createTime")
v2 <- c.get[Option[String]]("anywhereCacheId")
v3 <- c.get[Option[String]]("selfLink")
v4 <- c.get[Option[String]]("admissionPolicy")
v5 <- c.get[Option[String]]("id")
v6 <- c.get[Option[String]]("bucket")
v7 <- c.get[Option[String]]("kind")
v8 <- c.get[Option[String]]("ttl")
v9 <- c.get[Option[String]]("zone")
v10 <- c.get[Option[String]]("updateTime")
v11 <- c.get[Option[Boolean]]("pendingUpdate")
} yield AnywhereCache(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)
}
}