Sha256: 6320125d8a121597d0ccb6b695712fe233beafac1217e2350e9a9ad71edae08a

Contents?: true

Size: 1.31 KB

Versions: 20

Compression:

Stored size: 1.31 KB

Contents

package s3.website.model

case class S3Endpoint(
  s3WebsiteHostname: String,
  s3Hostname: String
)

object S3Endpoint {
  val defaultEndpoint = S3Endpoint("s3-website-us-east-1.amazonaws.com", "s3.amazonaws.com")

  def forString(locationConstraint: String): Either[ClientError, S3Endpoint] = locationConstraint match {
    case "EU" | "eu-west-1" => Right(S3Endpoint("s3-website-eu-west-1.amazonaws.com",      "s3-eu-west-1.amazonaws.com"))
    case "us-east-1" =>        Right(defaultEndpoint)
    case "us-west-1" =>        Right(S3Endpoint("s3-website-us-west-1.amazonaws.com",      "s3-us-west-1.amazonaws.com"))
    case "us-west-2" =>        Right(S3Endpoint("s3-website-us-west-2.amazonaws.com",      "s3-us-west-2.amazonaws.com"))
    case "ap-southeast-1" =>   Right(S3Endpoint("s3-website-ap-southeast-1.amazonaws.com", "s3-ap-southeast-1.amazonaws.com"))
    case "ap-southeast-2" =>   Right(S3Endpoint("s3-website-ap-southeast-2.amazonaws.com", "s3-ap-southeast-2.amazonaws.com"))
    case "ap-northeast-1" =>   Right(S3Endpoint("s3-website-ap-northeast-1.amazonaws.com", "s3-ap-northeast-1.amazonaws.com"))
    case "sa-east-1" =>        Right(S3Endpoint("s3-website-sa-east-1.amazonaws.com",      "s3-sa-east-1.amazonaws.com"))
    case _ =>                  Left(ClientError(s"Unrecognised endpoint: $locationConstraint"))
  }
}

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
s3_website_monadic-0.0.31 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.30 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.29 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.28 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.27 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.26 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.25 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.24 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.23 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.22 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.21 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.20 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.19 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.18 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.16 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.15 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.14 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.13 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.12 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website_monadic-0.0.11 src/main/scala/s3/website/model/S3Endpoint.scala