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