scala.googleapis.storage.BucketStorageLayout.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class BucketStorageLayout(
/** The location of the bucket.
*/
location: Option[String] = None,
/** The bucket's hierarchical namespace configuration.
*/
hierarchicalNamespace: Option[BucketStorageLayoutHierarchicalNamespace] = None,
/** The name of the bucket.
*/
bucket: Option[String] = None,
/** The kind of item this is. For storage layout, this is always storage#storageLayout.
*/
kind: Option[String] = None,
/** The type of the bucket location.
*/
locationType: Option[String] = None,
/** The bucket's custom placement configuration for Custom Dual Regions.
*/
customPlacementConfig: Option[BucketStorageLayoutCustomPlacementConfig] = None,
)
object BucketStorageLayout {
implicit val encoder: Encoder[BucketStorageLayout] = Encoder.instance { x =>
Json.obj(
"location" := x.location,
"hierarchicalNamespace" := x.hierarchicalNamespace,
"bucket" := x.bucket,
"kind" := x.kind,
"locationType" := x.locationType,
"customPlacementConfig" := x.customPlacementConfig,
)
}
implicit val decoder: Decoder[BucketStorageLayout] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("location")
v1 <- c.get[Option[BucketStorageLayoutHierarchicalNamespace]]("hierarchicalNamespace")
v2 <- c.get[Option[String]]("bucket")
v3 <- c.get[Option[String]]("kind")
v4 <- c.get[Option[String]]("locationType")
v5 <- c.get[Option[BucketStorageLayoutCustomPlacementConfig]]("customPlacementConfig")
} yield BucketStorageLayout(v0, v1, v2, v3, v4, v5)
}
}