{-# 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.PlacedPlayerSession where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PlacedPlayerSession = PlacedPlayerSession'
{
PlacedPlayerSession -> Maybe Text
playerSessionId :: Prelude.Maybe Prelude.Text,
PlacedPlayerSession -> Maybe Text
playerId :: Prelude.Maybe Prelude.Text
}
deriving (PlacedPlayerSession -> PlacedPlayerSession -> Bool
(PlacedPlayerSession -> PlacedPlayerSession -> Bool)
-> (PlacedPlayerSession -> PlacedPlayerSession -> Bool)
-> Eq PlacedPlayerSession
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlacedPlayerSession -> PlacedPlayerSession -> Bool
$c/= :: PlacedPlayerSession -> PlacedPlayerSession -> Bool
== :: PlacedPlayerSession -> PlacedPlayerSession -> Bool
$c== :: PlacedPlayerSession -> PlacedPlayerSession -> Bool
Prelude.Eq, ReadPrec [PlacedPlayerSession]
ReadPrec PlacedPlayerSession
Int -> ReadS PlacedPlayerSession
ReadS [PlacedPlayerSession]
(Int -> ReadS PlacedPlayerSession)
-> ReadS [PlacedPlayerSession]
-> ReadPrec PlacedPlayerSession
-> ReadPrec [PlacedPlayerSession]
-> Read PlacedPlayerSession
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlacedPlayerSession]
$creadListPrec :: ReadPrec [PlacedPlayerSession]
readPrec :: ReadPrec PlacedPlayerSession
$creadPrec :: ReadPrec PlacedPlayerSession
readList :: ReadS [PlacedPlayerSession]
$creadList :: ReadS [PlacedPlayerSession]
readsPrec :: Int -> ReadS PlacedPlayerSession
$creadsPrec :: Int -> ReadS PlacedPlayerSession
Prelude.Read, Int -> PlacedPlayerSession -> ShowS
[PlacedPlayerSession] -> ShowS
PlacedPlayerSession -> String
(Int -> PlacedPlayerSession -> ShowS)
-> (PlacedPlayerSession -> String)
-> ([PlacedPlayerSession] -> ShowS)
-> Show PlacedPlayerSession
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlacedPlayerSession] -> ShowS
$cshowList :: [PlacedPlayerSession] -> ShowS
show :: PlacedPlayerSession -> String
$cshow :: PlacedPlayerSession -> String
showsPrec :: Int -> PlacedPlayerSession -> ShowS
$cshowsPrec :: Int -> PlacedPlayerSession -> ShowS
Prelude.Show, (forall x. PlacedPlayerSession -> Rep PlacedPlayerSession x)
-> (forall x. Rep PlacedPlayerSession x -> PlacedPlayerSession)
-> Generic PlacedPlayerSession
forall x. Rep PlacedPlayerSession x -> PlacedPlayerSession
forall x. PlacedPlayerSession -> Rep PlacedPlayerSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlacedPlayerSession x -> PlacedPlayerSession
$cfrom :: forall x. PlacedPlayerSession -> Rep PlacedPlayerSession x
Prelude.Generic)
newPlacedPlayerSession ::
PlacedPlayerSession
newPlacedPlayerSession :: PlacedPlayerSession
newPlacedPlayerSession =
PlacedPlayerSession' :: Maybe Text -> Maybe Text -> PlacedPlayerSession
PlacedPlayerSession'
{ $sel:playerSessionId:PlacedPlayerSession' :: Maybe Text
playerSessionId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:playerId:PlacedPlayerSession' :: Maybe Text
playerId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
placedPlayerSession_playerSessionId :: Lens.Lens' PlacedPlayerSession (Prelude.Maybe Prelude.Text)
placedPlayerSession_playerSessionId :: (Maybe Text -> f (Maybe Text))
-> PlacedPlayerSession -> f PlacedPlayerSession
placedPlayerSession_playerSessionId = (PlacedPlayerSession -> Maybe Text)
-> (PlacedPlayerSession -> Maybe Text -> PlacedPlayerSession)
-> Lens
PlacedPlayerSession PlacedPlayerSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacedPlayerSession' {Maybe Text
playerSessionId :: Maybe Text
$sel:playerSessionId:PlacedPlayerSession' :: PlacedPlayerSession -> Maybe Text
playerSessionId} -> Maybe Text
playerSessionId) (\s :: PlacedPlayerSession
s@PlacedPlayerSession' {} Maybe Text
a -> PlacedPlayerSession
s {$sel:playerSessionId:PlacedPlayerSession' :: Maybe Text
playerSessionId = Maybe Text
a} :: PlacedPlayerSession)
placedPlayerSession_playerId :: Lens.Lens' PlacedPlayerSession (Prelude.Maybe Prelude.Text)
placedPlayerSession_playerId :: (Maybe Text -> f (Maybe Text))
-> PlacedPlayerSession -> f PlacedPlayerSession
placedPlayerSession_playerId = (PlacedPlayerSession -> Maybe Text)
-> (PlacedPlayerSession -> Maybe Text -> PlacedPlayerSession)
-> Lens
PlacedPlayerSession PlacedPlayerSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlacedPlayerSession' {Maybe Text
playerId :: Maybe Text
$sel:playerId:PlacedPlayerSession' :: PlacedPlayerSession -> Maybe Text
playerId} -> Maybe Text
playerId) (\s :: PlacedPlayerSession
s@PlacedPlayerSession' {} Maybe Text
a -> PlacedPlayerSession
s {$sel:playerId:PlacedPlayerSession' :: Maybe Text
playerId = Maybe Text
a} :: PlacedPlayerSession)
instance Core.FromJSON PlacedPlayerSession where
parseJSON :: Value -> Parser PlacedPlayerSession
parseJSON =
String
-> (Object -> Parser PlacedPlayerSession)
-> Value
-> Parser PlacedPlayerSession
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PlacedPlayerSession"
( \Object
x ->
Maybe Text -> Maybe Text -> PlacedPlayerSession
PlacedPlayerSession'
(Maybe Text -> Maybe Text -> PlacedPlayerSession)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> PlacedPlayerSession)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlayerSessionId")
Parser (Maybe Text -> PlacedPlayerSession)
-> Parser (Maybe Text) -> Parser PlacedPlayerSession
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlayerId")
)
instance Prelude.Hashable PlacedPlayerSession
instance Prelude.NFData PlacedPlayerSession