{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.GameLift.Types.LocationConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LocationConfiguration = LocationConfiguration'
{
LocationConfiguration -> Maybe Text
location :: Prelude.Maybe Prelude.Text
}
deriving (LocationConfiguration -> LocationConfiguration -> Bool
(LocationConfiguration -> LocationConfiguration -> Bool)
-> (LocationConfiguration -> LocationConfiguration -> Bool)
-> Eq LocationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LocationConfiguration -> LocationConfiguration -> Bool
$c/= :: LocationConfiguration -> LocationConfiguration -> Bool
== :: LocationConfiguration -> LocationConfiguration -> Bool
$c== :: LocationConfiguration -> LocationConfiguration -> Bool
Prelude.Eq, ReadPrec [LocationConfiguration]
ReadPrec LocationConfiguration
Int -> ReadS LocationConfiguration
ReadS [LocationConfiguration]
(Int -> ReadS LocationConfiguration)
-> ReadS [LocationConfiguration]
-> ReadPrec LocationConfiguration
-> ReadPrec [LocationConfiguration]
-> Read LocationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LocationConfiguration]
$creadListPrec :: ReadPrec [LocationConfiguration]
readPrec :: ReadPrec LocationConfiguration
$creadPrec :: ReadPrec LocationConfiguration
readList :: ReadS [LocationConfiguration]
$creadList :: ReadS [LocationConfiguration]
readsPrec :: Int -> ReadS LocationConfiguration
$creadsPrec :: Int -> ReadS LocationConfiguration
Prelude.Read, Int -> LocationConfiguration -> ShowS
[LocationConfiguration] -> ShowS
LocationConfiguration -> String
(Int -> LocationConfiguration -> ShowS)
-> (LocationConfiguration -> String)
-> ([LocationConfiguration] -> ShowS)
-> Show LocationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LocationConfiguration] -> ShowS
$cshowList :: [LocationConfiguration] -> ShowS
show :: LocationConfiguration -> String
$cshow :: LocationConfiguration -> String
showsPrec :: Int -> LocationConfiguration -> ShowS
$cshowsPrec :: Int -> LocationConfiguration -> ShowS
Prelude.Show, (forall x. LocationConfiguration -> Rep LocationConfiguration x)
-> (forall x. Rep LocationConfiguration x -> LocationConfiguration)
-> Generic LocationConfiguration
forall x. Rep LocationConfiguration x -> LocationConfiguration
forall x. LocationConfiguration -> Rep LocationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LocationConfiguration x -> LocationConfiguration
$cfrom :: forall x. LocationConfiguration -> Rep LocationConfiguration x
Prelude.Generic)
newLocationConfiguration ::
LocationConfiguration
newLocationConfiguration :: LocationConfiguration
newLocationConfiguration =
LocationConfiguration' :: Maybe Text -> LocationConfiguration
LocationConfiguration' {$sel:location:LocationConfiguration' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing}
locationConfiguration_location :: Lens.Lens' LocationConfiguration (Prelude.Maybe Prelude.Text)
locationConfiguration_location :: (Maybe Text -> f (Maybe Text))
-> LocationConfiguration -> f LocationConfiguration
locationConfiguration_location = (LocationConfiguration -> Maybe Text)
-> (LocationConfiguration -> Maybe Text -> LocationConfiguration)
-> Lens
LocationConfiguration
LocationConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocationConfiguration' {Maybe Text
location :: Maybe Text
$sel:location:LocationConfiguration' :: LocationConfiguration -> Maybe Text
location} -> Maybe Text
location) (\s :: LocationConfiguration
s@LocationConfiguration' {} Maybe Text
a -> LocationConfiguration
s {$sel:location:LocationConfiguration' :: Maybe Text
location = Maybe Text
a} :: LocationConfiguration)
instance Prelude.Hashable LocationConfiguration
instance Prelude.NFData LocationConfiguration
instance Core.ToJSON LocationConfiguration where
toJSON :: LocationConfiguration -> Value
toJSON LocationConfiguration' {Maybe Text
location :: Maybe Text
$sel:location:LocationConfiguration' :: LocationConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"Location" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
location]
)