scala.googleapis.storage.Folder.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class Folder(
/** The name of the folder. Required if not specified by URL parameter.
*/
name: Option[String] = None,
/** The creation time of the folder in RFC 3339 format.
*/
createTime: Option[String] = None,
/** The link to this folder.
*/
selfLink: Option[String] = None,
/** Only present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status.
*/
pendingRenameInfo: Option[FolderPendingRenameInfo] = None,
/** The ID of the folder, including the bucket name, folder name.
*/
id: Option[String] = None,
/** The name of the bucket containing this folder.
*/
bucket: Option[String] = None,
/** The kind of item this is. For folders, this is always storage#folder.
*/
kind: Option[String] = None,
/** The modification time of the folder metadata in RFC 3339 format.
*/
updateTime: Option[String] = None,
/** The version of the metadata for this folder. Used for preconditions and for detecting changes in metadata.
*/
metageneration: Option[Long] = None,
)
object Folder {
implicit val encoder: Encoder[Folder] = Encoder.instance { x =>
Json.obj(
"name" := x.name,
"createTime" := x.createTime,
"selfLink" := x.selfLink,
"pendingRenameInfo" := x.pendingRenameInfo,
"id" := x.id,
"bucket" := x.bucket,
"kind" := x.kind,
"updateTime" := x.updateTime,
"metageneration"
:= x.metageneration,
)
}
implicit val decoder: Decoder[Folder] = 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[FolderPendingRenameInfo]]("pendingRenameInfo")
v4 <- c.get[Option[String]]("id")
v5 <- c.get[Option[String]]("bucket")
v6 <- c.get[Option[String]]("kind")
v7 <- c.get[Option[String]]("updateTime")
v8 <- c.get[Option[Long]]("metageneration")
} yield Folder(v0, v1, v2, v3, v4, v5, v6, v7, v8)
}
}