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

scala.googleapis.firebase.Location.scala Maven / Gradle / Ivy

package googleapis.firebase

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

final case class Location(
    /** Products and services that are available in the GCP resource location.
      */
    features: Option[List[LocationFeature]] = None,
    /** The ID of the GCP resource location. It will be one of the available [GCP resource locations](https://firebase.google.com/docs/projects/locations#types).
      */
    locationId: Option[String] = None,
    /** Indicates whether the GCP resource location is a [regional or multi-regional location](https://firebase.google.com/docs/projects/locations#types) for data replication.
      */
    `type`: Option[LocationType] = None,
)
object Location {
  implicit val encoder: Encoder[Location] = Encoder.instance { x =>
    Json.obj(
      "features" := x.features,
      "locationId" := x.locationId,
      "type" := x.`type`,
    )
  }
  implicit val decoder: Decoder[Location] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[List[LocationFeature]]]("features")
      v1 <- c.get[Option[String]]("locationId")
      v2 <- c.get[Option[LocationType]]("type")
    } yield Location(v0, v1, v2)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy