{-# 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.GameSessionDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GameLift.Types.GameSession
import Amazonka.GameLift.Types.ProtectionPolicy
import qualified Amazonka.Prelude as Prelude
data GameSessionDetail = GameSessionDetail'
{
GameSessionDetail -> Maybe GameSession
gameSession :: Prelude.Maybe GameSession,
GameSessionDetail -> Maybe ProtectionPolicy
protectionPolicy :: Prelude.Maybe ProtectionPolicy
}
deriving (GameSessionDetail -> GameSessionDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GameSessionDetail -> GameSessionDetail -> Bool
$c/= :: GameSessionDetail -> GameSessionDetail -> Bool
== :: GameSessionDetail -> GameSessionDetail -> Bool
$c== :: GameSessionDetail -> GameSessionDetail -> Bool
Prelude.Eq, ReadPrec [GameSessionDetail]
ReadPrec GameSessionDetail
Int -> ReadS GameSessionDetail
ReadS [GameSessionDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GameSessionDetail]
$creadListPrec :: ReadPrec [GameSessionDetail]
readPrec :: ReadPrec GameSessionDetail
$creadPrec :: ReadPrec GameSessionDetail
readList :: ReadS [GameSessionDetail]
$creadList :: ReadS [GameSessionDetail]
readsPrec :: Int -> ReadS GameSessionDetail
$creadsPrec :: Int -> ReadS GameSessionDetail
Prelude.Read, Int -> GameSessionDetail -> ShowS
[GameSessionDetail] -> ShowS
GameSessionDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GameSessionDetail] -> ShowS
$cshowList :: [GameSessionDetail] -> ShowS
show :: GameSessionDetail -> String
$cshow :: GameSessionDetail -> String
showsPrec :: Int -> GameSessionDetail -> ShowS
$cshowsPrec :: Int -> GameSessionDetail -> ShowS
Prelude.Show, forall x. Rep GameSessionDetail x -> GameSessionDetail
forall x. GameSessionDetail -> Rep GameSessionDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GameSessionDetail x -> GameSessionDetail
$cfrom :: forall x. GameSessionDetail -> Rep GameSessionDetail x
Prelude.Generic)
newGameSessionDetail ::
GameSessionDetail
newGameSessionDetail :: GameSessionDetail
newGameSessionDetail =
GameSessionDetail'
{ $sel:gameSession:GameSessionDetail' :: Maybe GameSession
gameSession = forall a. Maybe a
Prelude.Nothing,
$sel:protectionPolicy:GameSessionDetail' :: Maybe ProtectionPolicy
protectionPolicy = forall a. Maybe a
Prelude.Nothing
}
gameSessionDetail_gameSession :: Lens.Lens' GameSessionDetail (Prelude.Maybe GameSession)
gameSessionDetail_gameSession :: Lens' GameSessionDetail (Maybe GameSession)
gameSessionDetail_gameSession = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionDetail' {Maybe GameSession
gameSession :: Maybe GameSession
$sel:gameSession:GameSessionDetail' :: GameSessionDetail -> Maybe GameSession
gameSession} -> Maybe GameSession
gameSession) (\s :: GameSessionDetail
s@GameSessionDetail' {} Maybe GameSession
a -> GameSessionDetail
s {$sel:gameSession:GameSessionDetail' :: Maybe GameSession
gameSession = Maybe GameSession
a} :: GameSessionDetail)
gameSessionDetail_protectionPolicy :: Lens.Lens' GameSessionDetail (Prelude.Maybe ProtectionPolicy)
gameSessionDetail_protectionPolicy :: Lens' GameSessionDetail (Maybe ProtectionPolicy)
gameSessionDetail_protectionPolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionDetail' {Maybe ProtectionPolicy
protectionPolicy :: Maybe ProtectionPolicy
$sel:protectionPolicy:GameSessionDetail' :: GameSessionDetail -> Maybe ProtectionPolicy
protectionPolicy} -> Maybe ProtectionPolicy
protectionPolicy) (\s :: GameSessionDetail
s@GameSessionDetail' {} Maybe ProtectionPolicy
a -> GameSessionDetail
s {$sel:protectionPolicy:GameSessionDetail' :: Maybe ProtectionPolicy
protectionPolicy = Maybe ProtectionPolicy
a} :: GameSessionDetail)
instance Data.FromJSON GameSessionDetail where
parseJSON :: Value -> Parser GameSessionDetail
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GameSessionDetail"
( \Object
x ->
Maybe GameSession -> Maybe ProtectionPolicy -> GameSessionDetail
GameSessionDetail'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"GameSession")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ProtectionPolicy")
)
instance Prelude.Hashable GameSessionDetail where
hashWithSalt :: Int -> GameSessionDetail -> Int
hashWithSalt Int
_salt GameSessionDetail' {Maybe GameSession
Maybe ProtectionPolicy
protectionPolicy :: Maybe ProtectionPolicy
gameSession :: Maybe GameSession
$sel:protectionPolicy:GameSessionDetail' :: GameSessionDetail -> Maybe ProtectionPolicy
$sel:gameSession:GameSessionDetail' :: GameSessionDetail -> Maybe GameSession
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GameSession
gameSession
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProtectionPolicy
protectionPolicy
instance Prelude.NFData GameSessionDetail where
rnf :: GameSessionDetail -> ()
rnf GameSessionDetail' {Maybe GameSession
Maybe ProtectionPolicy
protectionPolicy :: Maybe ProtectionPolicy
gameSession :: Maybe GameSession
$sel:protectionPolicy:GameSessionDetail' :: GameSessionDetail -> Maybe ProtectionPolicy
$sel:gameSession:GameSessionDetail' :: GameSessionDetail -> Maybe GameSession
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe GameSession
gameSession
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProtectionPolicy
protectionPolicy