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

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

The newest version!
package googleapis.storage

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

final case class ManagedFolder(
    /** The name of the managed folder. Required if not specified by URL parameter.
      */
    name: Option[String] = None,
    /** The creation time of the managed folder in RFC 3339 format.
      */
    createTime: Option[String] = None,
    /** The link to this managed folder.
      */
    selfLink: Option[String] = None,
    /** The ID of the managed folder, including the bucket name and managed folder name.
      */
    id: Option[String] = None,
    /** The name of the bucket containing this managed folder.
      */
    bucket: Option[String] = None,
    /** The kind of item this is. For managed folders, this is always storage#managedFolder.
      */
    kind: Option[String] = None,
    /** The last update time of the managed folder metadata in RFC 3339 format.
      */
    updateTime: Option[String] = None,
    /** The version of the metadata for this managed folder. Used for preconditions and for detecting changes in metadata.
      */
    metageneration: Option[Long] = None,
)
object ManagedFolder {
  implicit val encoder: Encoder[ManagedFolder] = Encoder.instance { x =>
    Json.obj(
      "name" := x.name,
      "createTime" := x.createTime,
      "selfLink" := x.selfLink,
      "id" := x.id,
      "bucket" := x.bucket,
      "kind" := x.kind,
      "updateTime" := x.updateTime,
      "metageneration" := x.metageneration,
    )
  }
  implicit val decoder: Decoder[ManagedFolder] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[String]]("name")
      v1 <- c.get[Option[String]]("createTime")
      v2 <- c.get[Option[String]]("selfLink")
      v3 <- c.get[Option[String]]("id")
      v4 <- c.get[Option[String]]("bucket")
      v5 <- c.get[Option[String]]("kind")
      v6 <- c.get[Option[String]]("updateTime")
      v7 <- c.get[Option[Long]]("metageneration")
    } yield ManagedFolder(v0, v1, v2, v3, v4, v5, v6, v7)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy