{-# 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 Amazonka.GameLift.Types.GameSession
import Amazonka.GameLift.Types.ProtectionPolicy
import qualified Amazonka.Lens as Lens
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
(GameSessionDetail -> GameSessionDetail -> Bool)
-> (GameSessionDetail -> GameSessionDetail -> Bool)
-> Eq GameSessionDetail
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]
(Int -> ReadS GameSessionDetail)
-> ReadS [GameSessionDetail]
-> ReadPrec GameSessionDetail
-> ReadPrec [GameSessionDetail]
-> Read 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
(Int -> GameSessionDetail -> ShowS)
-> (GameSessionDetail -> String)
-> ([GameSessionDetail] -> ShowS)
-> Show GameSessionDetail
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. GameSessionDetail -> Rep GameSessionDetail x)
-> (forall x. Rep GameSessionDetail x -> GameSessionDetail)
-> Generic GameSessionDetail
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' :: Maybe GameSession -> Maybe ProtectionPolicy -> GameSessionDetail
GameSessionDetail'
{ $sel:gameSession:GameSessionDetail' :: Maybe GameSession
gameSession = Maybe GameSession
forall a. Maybe a
Prelude.Nothing,
$sel:protectionPolicy:GameSessionDetail' :: Maybe ProtectionPolicy
protectionPolicy = Maybe ProtectionPolicy
forall a. Maybe a
Prelude.Nothing
}
gameSessionDetail_gameSession :: Lens.Lens' GameSessionDetail (Prelude.Maybe GameSession)
gameSessionDetail_gameSession :: (Maybe GameSession -> f (Maybe GameSession))
-> GameSessionDetail -> f GameSessionDetail
gameSessionDetail_gameSession = (GameSessionDetail -> Maybe GameSession)
-> (GameSessionDetail -> Maybe GameSession -> GameSessionDetail)
-> Lens
GameSessionDetail
GameSessionDetail
(Maybe GameSession)
(Maybe 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 :: (Maybe ProtectionPolicy -> f (Maybe ProtectionPolicy))
-> GameSessionDetail -> f GameSessionDetail
gameSessionDetail_protectionPolicy = (GameSessionDetail -> Maybe ProtectionPolicy)
-> (GameSessionDetail
-> Maybe ProtectionPolicy -> GameSessionDetail)
-> Lens
GameSessionDetail
GameSessionDetail
(Maybe ProtectionPolicy)
(Maybe 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 Core.FromJSON GameSessionDetail where
parseJSON :: Value -> Parser GameSessionDetail
parseJSON =
String
-> (Object -> Parser GameSessionDetail)
-> Value
-> Parser GameSessionDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GameSessionDetail"
( \Object
x ->
Maybe GameSession -> Maybe ProtectionPolicy -> GameSessionDetail
GameSessionDetail'
(Maybe GameSession -> Maybe ProtectionPolicy -> GameSessionDetail)
-> Parser (Maybe GameSession)
-> Parser (Maybe ProtectionPolicy -> GameSessionDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe GameSession)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GameSession")
Parser (Maybe ProtectionPolicy -> GameSessionDetail)
-> Parser (Maybe ProtectionPolicy) -> Parser GameSessionDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProtectionPolicy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProtectionPolicy")
)
instance Prelude.Hashable GameSessionDetail
instance Prelude.NFData GameSessionDetail