Sha256: a24a4c4a91c42ad20add7974fc1931f825b316e92db401de03e8c8e9abc5af14

Contents?: true

Size: 729 Bytes

Versions: 10

Compression:

Stored size: 729 Bytes

Contents

package s3.website.model

case class S3Endpoint(
  s3WebsiteHostname: String
)

object S3Endpoint {
  def defaultEndpoint = S3Endpoint.fromString("us-east-1")

  val oldRegions = Seq(
    "us-east-1",
    "us-west-1",
    "us-west-2",
    "ap-southeast-1",
    "ap-southeast-2",
    "ap-northeast-1",
    "eu-west-1",
    "sa-east-1"
  )

  def fromString(region: String): S3Endpoint = {
    if (region == "EU") {
      return S3Endpoint.fromString("eu-west-1")
    }

    val isOldRegion = oldRegions.contains(region)
    val s3WebsiteHostname =
      if (isOldRegion)
        s"s3-website-$region.amazonaws.com"
      else
        s"s3-website.$region.amazonaws.com"

    S3Endpoint(s3WebsiteHostname = s3WebsiteHostname)
  }
}

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
s3_website_revived-4.0.3 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_revived-4.0.2 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_revived-4.0.1 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_revived-4.0.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-3.4.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-3.3.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-3.2.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-3.1.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-3.0.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.16.0 src/main/scala/s3/website/model/S3Endpoint.scala