scala.googleapis.storage.BucketWebsite.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class BucketWebsite(
/** If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages.
*/
mainPageSuffix: Option[String] = None,
/** If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result.
*/
notFoundPage: Option[String] = None,
)
object BucketWebsite {
implicit val encoder: Encoder[BucketWebsite] = Encoder.instance { x =>
Json.obj(
"mainPageSuffix" := x.mainPageSuffix,
"notFoundPage" := x.notFoundPage,
)
}
implicit val decoder: Decoder[BucketWebsite] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("mainPageSuffix")
v1 <- c.get[Option[String]]("notFoundPage")
} yield BucketWebsite(v0, v1)
}
}