{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Mismi.Kernel.Data (
MismiRegion (..)
, renderMismiRegion
, parseMismiRegion
) where
import P
data MismiRegion =
IrelandRegion
| FrankfurtRegion
| TokyoRegion
| SeoulRegion
| SingaporeRegion
| SydneyRegion
| MumbaiRegion
| MontrealRegion
| LondonRegion
| BeijingRegion
| NorthVirginiaRegion
| OhioRegion
| NorthCaliforniaRegion
| OregonRegion
| GovCloudRegion
| GovCloudFIPSRegion
| SaoPauloRegion
deriving (Eq, Ord, Read, Show, Enum, Bounded)
renderMismiRegion :: MismiRegion -> Text
renderMismiRegion r =
case r of
IrelandRegion ->
"eu-west-1"
FrankfurtRegion ->
"eu-central-1"
TokyoRegion ->
"ap-northeast-1"
SeoulRegion ->
"ap-northeast-2"
SingaporeRegion ->
"ap-southeast-1"
SydneyRegion ->
"ap-southeast-2"
MumbaiRegion ->
"ap-south-1"
BeijingRegion ->
"cn-north-1"
NorthVirginiaRegion ->
"us-east-1"
OhioRegion ->
"us-east-2"
NorthCaliforniaRegion ->
"us-west-1"
OregonRegion ->
"us-west-2"
GovCloudRegion ->
"us-gov-west-1"
GovCloudFIPSRegion ->
"fips-us-gov-west-1"
SaoPauloRegion ->
"sa-east-1"
MontrealRegion ->
"ca-central-1"
LondonRegion ->
"eu-west-2"
parseMismiRegion :: Text -> Maybe MismiRegion
parseMismiRegion t =
case t of
"eu-west-1" ->
Just IrelandRegion
"eu-central-1" ->
Just FrankfurtRegion
"ap-northeast-1" ->
Just TokyoRegion
"ap-northeast-2" ->
Just SeoulRegion
"ap-southeast-1" ->
Just SingaporeRegion
"ap-southeast-2" ->
Just SydneyRegion
"ap-south-1" ->
Just MumbaiRegion
"cn-north-1" ->
Just BeijingRegion
"us-east-1" ->
Just NorthVirginiaRegion
"us-east-2" ->
Just OhioRegion
"us-west-2" ->
Just OregonRegion
"us-west-1" ->
Just NorthCaliforniaRegion
"us-gov-west-1" ->
Just GovCloudRegion
"fips-us-gov-west-1" ->
Just GovCloudFIPSRegion
"sa-east-1" ->
Just SaoPauloRegion
"eu-west-2" ->
Just LondonRegion
"ca-central-1" ->
Just MontrealRegion
_ ->
Nothing