scala.googleapis.storage.BucketIamConfiguration.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class BucketIamConfiguration(
/** The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature.
*/
bucketPolicyOnly: Option[BucketIamConfigurationBucketPolicyOnly] = None,
/** The bucket's Public Access Prevention configuration. Currently, 'inherited' and 'enforced' are supported.
*/
publicAccessPrevention: Option[String] = None,
/** The bucket's uniform bucket-level access configuration.
*/
uniformBucketLevelAccess: Option[BucketIamConfigurationUniformBucketLevelAccess] = None,
)
object BucketIamConfiguration {
implicit val encoder: Encoder[BucketIamConfiguration] = Encoder.instance { x =>
Json.obj(
"bucketPolicyOnly" := x.bucketPolicyOnly,
"publicAccessPrevention" := x.publicAccessPrevention,
"uniformBucketLevelAccess" := x.uniformBucketLevelAccess,
)
}
implicit val decoder: Decoder[
BucketIamConfiguration
] = Decoder.instance { c =>
for {
v0 <- c.get[Option[BucketIamConfigurationBucketPolicyOnly]]("bucketPolicyOnly")
v1 <- c.get[Option[String]]("publicAccessPrevention")
v2 <- c.get[Option[BucketIamConfigurationUniformBucketLevelAccess]](
"uniformBucketLevelAccess"
)
} yield BucketIamConfiguration(v0, v1, v2)
}
}