module Stratosphere.GameLift.Location (
        Location(..), mkLocation
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Location
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-location.html>
    Location {Location -> ()
haddock_workaround_ :: (),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-location.html#cfn-gamelift-location-locationname>
              Location -> Value Text
locationName :: (Value Prelude.Text),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-location.html#cfn-gamelift-location-tags>
              Location -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (Location -> Location -> Bool
(Location -> Location -> Bool)
-> (Location -> Location -> Bool) -> Eq Location
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Location -> Location -> Bool
== :: Location -> Location -> Bool
$c/= :: Location -> Location -> Bool
/= :: Location -> Location -> Bool
Prelude.Eq, Int -> Location -> ShowS
[Location] -> ShowS
Location -> String
(Int -> Location -> ShowS)
-> (Location -> String) -> ([Location] -> ShowS) -> Show Location
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Location -> ShowS
showsPrec :: Int -> Location -> ShowS
$cshow :: Location -> String
show :: Location -> String
$cshowList :: [Location] -> ShowS
showList :: [Location] -> ShowS
Prelude.Show)
mkLocation :: Value Prelude.Text -> Location
mkLocation :: Value Text -> Location
mkLocation Value Text
locationName
  = Location
      {haddock_workaround_ :: ()
haddock_workaround_ = (), locationName :: Value Text
locationName = Value Text
locationName,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Location where
  toResourceProperties :: Location -> ResourceProperties
toResourceProperties Location {Maybe [Tag]
()
Value Text
haddock_workaround_ :: Location -> ()
locationName :: Location -> Value Text
tags :: Location -> Maybe [Tag]
haddock_workaround_ :: ()
locationName :: Value Text
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::GameLift::Location", supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"LocationName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
locationName]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON Location where
  toJSON :: Location -> Value
toJSON Location {Maybe [Tag]
()
Value Text
haddock_workaround_ :: Location -> ()
locationName :: Location -> Value Text
tags :: Location -> Maybe [Tag]
haddock_workaround_ :: ()
locationName :: Value Text
tags :: Maybe [Tag]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"LocationName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
locationName]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "LocationName" Location where
  type PropertyType "LocationName" Location = Value Prelude.Text
  set :: PropertyType "LocationName" Location -> Location -> Location
set PropertyType "LocationName" Location
newValue Location {Maybe [Tag]
()
Value Text
haddock_workaround_ :: Location -> ()
locationName :: Location -> Value Text
tags :: Location -> Maybe [Tag]
haddock_workaround_ :: ()
locationName :: Value Text
tags :: Maybe [Tag]
..} = Location {locationName :: Value Text
locationName = PropertyType "LocationName" Location
Value Text
newValue, Maybe [Tag]
()
haddock_workaround_ :: ()
tags :: Maybe [Tag]
haddock_workaround_ :: ()
tags :: Maybe [Tag]
..}
instance Property "Tags" Location where
  type PropertyType "Tags" Location = [Tag]
  set :: PropertyType "Tags" Location -> Location -> Location
set PropertyType "Tags" Location
newValue Location {Maybe [Tag]
()
Value Text
haddock_workaround_ :: Location -> ()
locationName :: Location -> Value Text
tags :: Location -> Maybe [Tag]
haddock_workaround_ :: ()
locationName :: Value Text
tags :: Maybe [Tag]
..}
    = Location {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" Location
newValue, ()
Value Text
haddock_workaround_ :: ()
locationName :: Value Text
haddock_workaround_ :: ()
locationName :: Value Text
..}