{-# 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.DesiredPlayerSession where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DesiredPlayerSession = DesiredPlayerSession'
{
DesiredPlayerSession -> Maybe Text
playerData :: Prelude.Maybe Prelude.Text,
DesiredPlayerSession -> Maybe Text
playerId :: Prelude.Maybe Prelude.Text
}
deriving (DesiredPlayerSession -> DesiredPlayerSession -> Bool
(DesiredPlayerSession -> DesiredPlayerSession -> Bool)
-> (DesiredPlayerSession -> DesiredPlayerSession -> Bool)
-> Eq DesiredPlayerSession
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DesiredPlayerSession -> DesiredPlayerSession -> Bool
$c/= :: DesiredPlayerSession -> DesiredPlayerSession -> Bool
== :: DesiredPlayerSession -> DesiredPlayerSession -> Bool
$c== :: DesiredPlayerSession -> DesiredPlayerSession -> Bool
Prelude.Eq, ReadPrec [DesiredPlayerSession]
ReadPrec DesiredPlayerSession
Int -> ReadS DesiredPlayerSession
ReadS [DesiredPlayerSession]
(Int -> ReadS DesiredPlayerSession)
-> ReadS [DesiredPlayerSession]
-> ReadPrec DesiredPlayerSession
-> ReadPrec [DesiredPlayerSession]
-> Read DesiredPlayerSession
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DesiredPlayerSession]
$creadListPrec :: ReadPrec [DesiredPlayerSession]
readPrec :: ReadPrec DesiredPlayerSession
$creadPrec :: ReadPrec DesiredPlayerSession
readList :: ReadS [DesiredPlayerSession]
$creadList :: ReadS [DesiredPlayerSession]
readsPrec :: Int -> ReadS DesiredPlayerSession
$creadsPrec :: Int -> ReadS DesiredPlayerSession
Prelude.Read, Int -> DesiredPlayerSession -> ShowS
[DesiredPlayerSession] -> ShowS
DesiredPlayerSession -> String
(Int -> DesiredPlayerSession -> ShowS)
-> (DesiredPlayerSession -> String)
-> ([DesiredPlayerSession] -> ShowS)
-> Show DesiredPlayerSession
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DesiredPlayerSession] -> ShowS
$cshowList :: [DesiredPlayerSession] -> ShowS
show :: DesiredPlayerSession -> String
$cshow :: DesiredPlayerSession -> String
showsPrec :: Int -> DesiredPlayerSession -> ShowS
$cshowsPrec :: Int -> DesiredPlayerSession -> ShowS
Prelude.Show, (forall x. DesiredPlayerSession -> Rep DesiredPlayerSession x)
-> (forall x. Rep DesiredPlayerSession x -> DesiredPlayerSession)
-> Generic DesiredPlayerSession
forall x. Rep DesiredPlayerSession x -> DesiredPlayerSession
forall x. DesiredPlayerSession -> Rep DesiredPlayerSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DesiredPlayerSession x -> DesiredPlayerSession
$cfrom :: forall x. DesiredPlayerSession -> Rep DesiredPlayerSession x
Prelude.Generic)
newDesiredPlayerSession ::
DesiredPlayerSession
newDesiredPlayerSession :: DesiredPlayerSession
newDesiredPlayerSession =
DesiredPlayerSession' :: Maybe Text -> Maybe Text -> DesiredPlayerSession
DesiredPlayerSession'
{ $sel:playerData:DesiredPlayerSession' :: Maybe Text
playerData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:playerId:DesiredPlayerSession' :: Maybe Text
playerId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
desiredPlayerSession_playerData :: Lens.Lens' DesiredPlayerSession (Prelude.Maybe Prelude.Text)
desiredPlayerSession_playerData :: (Maybe Text -> f (Maybe Text))
-> DesiredPlayerSession -> f DesiredPlayerSession
desiredPlayerSession_playerData = (DesiredPlayerSession -> Maybe Text)
-> (DesiredPlayerSession -> Maybe Text -> DesiredPlayerSession)
-> Lens
DesiredPlayerSession DesiredPlayerSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DesiredPlayerSession' {Maybe Text
playerData :: Maybe Text
$sel:playerData:DesiredPlayerSession' :: DesiredPlayerSession -> Maybe Text
playerData} -> Maybe Text
playerData) (\s :: DesiredPlayerSession
s@DesiredPlayerSession' {} Maybe Text
a -> DesiredPlayerSession
s {$sel:playerData:DesiredPlayerSession' :: Maybe Text
playerData = Maybe Text
a} :: DesiredPlayerSession)
desiredPlayerSession_playerId :: Lens.Lens' DesiredPlayerSession (Prelude.Maybe Prelude.Text)
desiredPlayerSession_playerId :: (Maybe Text -> f (Maybe Text))
-> DesiredPlayerSession -> f DesiredPlayerSession
desiredPlayerSession_playerId = (DesiredPlayerSession -> Maybe Text)
-> (DesiredPlayerSession -> Maybe Text -> DesiredPlayerSession)
-> Lens
DesiredPlayerSession DesiredPlayerSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DesiredPlayerSession' {Maybe Text
playerId :: Maybe Text
$sel:playerId:DesiredPlayerSession' :: DesiredPlayerSession -> Maybe Text
playerId} -> Maybe Text
playerId) (\s :: DesiredPlayerSession
s@DesiredPlayerSession' {} Maybe Text
a -> DesiredPlayerSession
s {$sel:playerId:DesiredPlayerSession' :: Maybe Text
playerId = Maybe Text
a} :: DesiredPlayerSession)
instance Prelude.Hashable DesiredPlayerSession
instance Prelude.NFData DesiredPlayerSession
instance Core.ToJSON DesiredPlayerSession where
toJSON :: DesiredPlayerSession -> Value
toJSON DesiredPlayerSession' {Maybe Text
playerId :: Maybe Text
playerData :: Maybe Text
$sel:playerId:DesiredPlayerSession' :: DesiredPlayerSession -> Maybe Text
$sel:playerData:DesiredPlayerSession' :: DesiredPlayerSession -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PlayerData" 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
playerData,
(Text
"PlayerId" 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
playerId
]
)