{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.GameLift.CreateGameSession
(
CreateGameSession (..),
newCreateGameSession,
createGameSession_aliasId,
createGameSession_creatorId,
createGameSession_fleetId,
createGameSession_gameProperties,
createGameSession_gameSessionData,
createGameSession_gameSessionId,
createGameSession_idempotencyToken,
createGameSession_location,
createGameSession_name,
createGameSession_maximumPlayerSessionCount,
CreateGameSessionResponse (..),
newCreateGameSessionResponse,
createGameSessionResponse_gameSession,
createGameSessionResponse_httpStatus,
)
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateGameSession = CreateGameSession'
{
CreateGameSession -> Maybe Text
aliasId :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
creatorId :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe [GameProperty]
gameProperties :: Prelude.Maybe [GameProperty],
CreateGameSession -> Maybe Text
gameSessionData :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
gameSessionId :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
idempotencyToken :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Natural
maximumPlayerSessionCount :: Prelude.Natural
}
deriving (CreateGameSession -> CreateGameSession -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGameSession -> CreateGameSession -> Bool
$c/= :: CreateGameSession -> CreateGameSession -> Bool
== :: CreateGameSession -> CreateGameSession -> Bool
$c== :: CreateGameSession -> CreateGameSession -> Bool
Prelude.Eq, ReadPrec [CreateGameSession]
ReadPrec CreateGameSession
Int -> ReadS CreateGameSession
ReadS [CreateGameSession]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGameSession]
$creadListPrec :: ReadPrec [CreateGameSession]
readPrec :: ReadPrec CreateGameSession
$creadPrec :: ReadPrec CreateGameSession
readList :: ReadS [CreateGameSession]
$creadList :: ReadS [CreateGameSession]
readsPrec :: Int -> ReadS CreateGameSession
$creadsPrec :: Int -> ReadS CreateGameSession
Prelude.Read, Int -> CreateGameSession -> ShowS
[CreateGameSession] -> ShowS
CreateGameSession -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGameSession] -> ShowS
$cshowList :: [CreateGameSession] -> ShowS
show :: CreateGameSession -> String
$cshow :: CreateGameSession -> String
showsPrec :: Int -> CreateGameSession -> ShowS
$cshowsPrec :: Int -> CreateGameSession -> ShowS
Prelude.Show, forall x. Rep CreateGameSession x -> CreateGameSession
forall x. CreateGameSession -> Rep CreateGameSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateGameSession x -> CreateGameSession
$cfrom :: forall x. CreateGameSession -> Rep CreateGameSession x
Prelude.Generic)
newCreateGameSession ::
Prelude.Natural ->
CreateGameSession
newCreateGameSession :: Natural -> CreateGameSession
newCreateGameSession Natural
pMaximumPlayerSessionCount_ =
CreateGameSession'
{ $sel:aliasId:CreateGameSession' :: Maybe Text
aliasId = forall a. Maybe a
Prelude.Nothing,
$sel:creatorId:CreateGameSession' :: Maybe Text
creatorId = forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:CreateGameSession' :: Maybe Text
fleetId = forall a. Maybe a
Prelude.Nothing,
$sel:gameProperties:CreateGameSession' :: Maybe [GameProperty]
gameProperties = forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionData:CreateGameSession' :: Maybe Text
gameSessionData = forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionId:CreateGameSession' :: Maybe Text
gameSessionId = forall a. Maybe a
Prelude.Nothing,
$sel:idempotencyToken:CreateGameSession' :: Maybe Text
idempotencyToken = forall a. Maybe a
Prelude.Nothing,
$sel:location:CreateGameSession' :: Maybe Text
location = forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateGameSession' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:maximumPlayerSessionCount:CreateGameSession' :: Natural
maximumPlayerSessionCount =
Natural
pMaximumPlayerSessionCount_
}
createGameSession_aliasId :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_aliasId :: Lens' CreateGameSession (Maybe Text)
createGameSession_aliasId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSession' {Maybe Text
aliasId :: Maybe Text
$sel:aliasId:CreateGameSession' :: CreateGameSession -> Maybe Text
aliasId} -> Maybe Text
aliasId) (\s :: CreateGameSession
s@CreateGameSession' {} Maybe Text
a -> CreateGameSession
s {$sel:aliasId:CreateGameSession' :: Maybe Text
aliasId = Maybe Text
a} :: CreateGameSession)
createGameSession_creatorId :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_creatorId :: Lens' CreateGameSession (Maybe Text)
createGameSession_creatorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSession' {Maybe Text
creatorId :: Maybe Text
$sel:creatorId:CreateGameSession' :: CreateGameSession -> Maybe Text
creatorId} -> Maybe Text
creatorId) (\s :: CreateGameSession
s@CreateGameSession' {} Maybe Text
a -> CreateGameSession
s {$sel:creatorId:CreateGameSession' :: Maybe Text
creatorId = Maybe Text
a} :: CreateGameSession)
createGameSession_fleetId :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_fleetId :: Lens' CreateGameSession (Maybe Text)
createGameSession_fleetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSession' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:CreateGameSession' :: CreateGameSession -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: CreateGameSession
s@CreateGameSession' {} Maybe Text
a -> CreateGameSession
s {$sel:fleetId:CreateGameSession' :: Maybe Text
fleetId = Maybe Text
a} :: CreateGameSession)
createGameSession_gameProperties :: Lens.Lens' CreateGameSession (Prelude.Maybe [GameProperty])
createGameSession_gameProperties :: Lens' CreateGameSession (Maybe [GameProperty])
createGameSession_gameProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSession' {Maybe [GameProperty]
gameProperties :: Maybe [GameProperty]
$sel:gameProperties:CreateGameSession' :: CreateGameSession -> Maybe [GameProperty]
gameProperties} -> Maybe [GameProperty]
gameProperties) (\s :: CreateGameSession
s@CreateGameSession' {} Maybe [GameProperty]
a -> CreateGameSession
s {$sel:gameProperties:CreateGameSession' :: Maybe [GameProperty]
gameProperties = Maybe [GameProperty]
a} :: CreateGameSession) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createGameSession_gameSessionData :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_gameSessionData :: Lens' CreateGameSession (Maybe Text)
createGameSession_gameSessionData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSession' {Maybe Text
gameSessionData :: Maybe Text
$sel:gameSessionData:CreateGameSession' :: CreateGameSession -> Maybe Text
gameSessionData} -> Maybe Text
gameSessionData) (\s :: CreateGameSession
s@CreateGameSession' {} Maybe Text
a -> CreateGameSession
s {$sel:gameSessionData:CreateGameSession' :: Maybe Text
gameSessionData = Maybe Text
a} :: CreateGameSession)
createGameSession_gameSessionId :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_gameSessionId :: Lens' CreateGameSession (Maybe Text)
createGameSession_gameSessionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSession' {Maybe Text
gameSessionId :: Maybe Text
$sel:gameSessionId:CreateGameSession' :: CreateGameSession -> Maybe Text
gameSessionId} -> Maybe Text
gameSessionId) (\s :: CreateGameSession
s@CreateGameSession' {} Maybe Text
a -> CreateGameSession
s {$sel:gameSessionId:CreateGameSession' :: Maybe Text
gameSessionId = Maybe Text
a} :: CreateGameSession)
createGameSession_idempotencyToken :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_idempotencyToken :: Lens' CreateGameSession (Maybe Text)
createGameSession_idempotencyToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSession' {Maybe Text
idempotencyToken :: Maybe Text
$sel:idempotencyToken:CreateGameSession' :: CreateGameSession -> Maybe Text
idempotencyToken} -> Maybe Text
idempotencyToken) (\s :: CreateGameSession
s@CreateGameSession' {} Maybe Text
a -> CreateGameSession
s {$sel:idempotencyToken:CreateGameSession' :: Maybe Text
idempotencyToken = Maybe Text
a} :: CreateGameSession)
createGameSession_location :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_location :: Lens' CreateGameSession (Maybe Text)
createGameSession_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSession' {Maybe Text
location :: Maybe Text
$sel:location:CreateGameSession' :: CreateGameSession -> Maybe Text
location} -> Maybe Text
location) (\s :: CreateGameSession
s@CreateGameSession' {} Maybe Text
a -> CreateGameSession
s {$sel:location:CreateGameSession' :: Maybe Text
location = Maybe Text
a} :: CreateGameSession)
createGameSession_name :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_name :: Lens' CreateGameSession (Maybe Text)
createGameSession_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSession' {Maybe Text
name :: Maybe Text
$sel:name:CreateGameSession' :: CreateGameSession -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateGameSession
s@CreateGameSession' {} Maybe Text
a -> CreateGameSession
s {$sel:name:CreateGameSession' :: Maybe Text
name = Maybe Text
a} :: CreateGameSession)
createGameSession_maximumPlayerSessionCount :: Lens.Lens' CreateGameSession Prelude.Natural
createGameSession_maximumPlayerSessionCount :: Lens' CreateGameSession Natural
createGameSession_maximumPlayerSessionCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSession' {Natural
maximumPlayerSessionCount :: Natural
$sel:maximumPlayerSessionCount:CreateGameSession' :: CreateGameSession -> Natural
maximumPlayerSessionCount} -> Natural
maximumPlayerSessionCount) (\s :: CreateGameSession
s@CreateGameSession' {} Natural
a -> CreateGameSession
s {$sel:maximumPlayerSessionCount:CreateGameSession' :: Natural
maximumPlayerSessionCount = Natural
a} :: CreateGameSession)
instance Core.AWSRequest CreateGameSession where
type
AWSResponse CreateGameSession =
CreateGameSessionResponse
request :: (Service -> Service)
-> CreateGameSession -> Request CreateGameSession
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateGameSession
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateGameSession)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe GameSession -> Int -> CreateGameSessionResponse
CreateGameSessionResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"GameSession")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateGameSession where
hashWithSalt :: Int -> CreateGameSession -> Int
hashWithSalt Int
_salt CreateGameSession' {Natural
Maybe [GameProperty]
Maybe Text
maximumPlayerSessionCount :: Natural
name :: Maybe Text
location :: Maybe Text
idempotencyToken :: Maybe Text
gameSessionId :: Maybe Text
gameSessionData :: Maybe Text
gameProperties :: Maybe [GameProperty]
fleetId :: Maybe Text
creatorId :: Maybe Text
aliasId :: Maybe Text
$sel:maximumPlayerSessionCount:CreateGameSession' :: CreateGameSession -> Natural
$sel:name:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:location:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:idempotencyToken:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameSessionId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameSessionData:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameProperties:CreateGameSession' :: CreateGameSession -> Maybe [GameProperty]
$sel:fleetId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:creatorId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:aliasId:CreateGameSession' :: CreateGameSession -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
aliasId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
creatorId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fleetId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [GameProperty]
gameProperties
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameSessionData
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameSessionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
idempotencyToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
maximumPlayerSessionCount
instance Prelude.NFData CreateGameSession where
rnf :: CreateGameSession -> ()
rnf CreateGameSession' {Natural
Maybe [GameProperty]
Maybe Text
maximumPlayerSessionCount :: Natural
name :: Maybe Text
location :: Maybe Text
idempotencyToken :: Maybe Text
gameSessionId :: Maybe Text
gameSessionData :: Maybe Text
gameProperties :: Maybe [GameProperty]
fleetId :: Maybe Text
creatorId :: Maybe Text
aliasId :: Maybe Text
$sel:maximumPlayerSessionCount:CreateGameSession' :: CreateGameSession -> Natural
$sel:name:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:location:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:idempotencyToken:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameSessionId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameSessionData:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameProperties:CreateGameSession' :: CreateGameSession -> Maybe [GameProperty]
$sel:fleetId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:creatorId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:aliasId:CreateGameSession' :: CreateGameSession -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
aliasId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
creatorId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fleetId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [GameProperty]
gameProperties
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gameSessionData
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gameSessionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
idempotencyToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
maximumPlayerSessionCount
instance Data.ToHeaders CreateGameSession where
toHeaders :: CreateGameSession -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"GameLift.CreateGameSession" :: Prelude.ByteString),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateGameSession where
toJSON :: CreateGameSession -> Value
toJSON CreateGameSession' {Natural
Maybe [GameProperty]
Maybe Text
maximumPlayerSessionCount :: Natural
name :: Maybe Text
location :: Maybe Text
idempotencyToken :: Maybe Text
gameSessionId :: Maybe Text
gameSessionData :: Maybe Text
gameProperties :: Maybe [GameProperty]
fleetId :: Maybe Text
creatorId :: Maybe Text
aliasId :: Maybe Text
$sel:maximumPlayerSessionCount:CreateGameSession' :: CreateGameSession -> Natural
$sel:name:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:location:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:idempotencyToken:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameSessionId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameSessionData:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameProperties:CreateGameSession' :: CreateGameSession -> Maybe [GameProperty]
$sel:fleetId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:creatorId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:aliasId:CreateGameSession' :: CreateGameSession -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AliasId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
aliasId,
(Key
"CreatorId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
creatorId,
(Key
"FleetId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fleetId,
(Key
"GameProperties" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [GameProperty]
gameProperties,
(Key
"GameSessionData" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
gameSessionData,
(Key
"GameSessionId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
gameSessionId,
(Key
"IdempotencyToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
idempotencyToken,
(Key
"Location" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
location,
(Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
forall a. a -> Maybe a
Prelude.Just
( Key
"MaximumPlayerSessionCount"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
maximumPlayerSessionCount
)
]
)
instance Data.ToPath CreateGameSession where
toPath :: CreateGameSession -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateGameSession where
toQuery :: CreateGameSession -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateGameSessionResponse = CreateGameSessionResponse'
{
CreateGameSessionResponse -> Maybe GameSession
gameSession :: Prelude.Maybe GameSession,
CreateGameSessionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateGameSessionResponse -> CreateGameSessionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGameSessionResponse -> CreateGameSessionResponse -> Bool
$c/= :: CreateGameSessionResponse -> CreateGameSessionResponse -> Bool
== :: CreateGameSessionResponse -> CreateGameSessionResponse -> Bool
$c== :: CreateGameSessionResponse -> CreateGameSessionResponse -> Bool
Prelude.Eq, ReadPrec [CreateGameSessionResponse]
ReadPrec CreateGameSessionResponse
Int -> ReadS CreateGameSessionResponse
ReadS [CreateGameSessionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGameSessionResponse]
$creadListPrec :: ReadPrec [CreateGameSessionResponse]
readPrec :: ReadPrec CreateGameSessionResponse
$creadPrec :: ReadPrec CreateGameSessionResponse
readList :: ReadS [CreateGameSessionResponse]
$creadList :: ReadS [CreateGameSessionResponse]
readsPrec :: Int -> ReadS CreateGameSessionResponse
$creadsPrec :: Int -> ReadS CreateGameSessionResponse
Prelude.Read, Int -> CreateGameSessionResponse -> ShowS
[CreateGameSessionResponse] -> ShowS
CreateGameSessionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGameSessionResponse] -> ShowS
$cshowList :: [CreateGameSessionResponse] -> ShowS
show :: CreateGameSessionResponse -> String
$cshow :: CreateGameSessionResponse -> String
showsPrec :: Int -> CreateGameSessionResponse -> ShowS
$cshowsPrec :: Int -> CreateGameSessionResponse -> ShowS
Prelude.Show, forall x.
Rep CreateGameSessionResponse x -> CreateGameSessionResponse
forall x.
CreateGameSessionResponse -> Rep CreateGameSessionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateGameSessionResponse x -> CreateGameSessionResponse
$cfrom :: forall x.
CreateGameSessionResponse -> Rep CreateGameSessionResponse x
Prelude.Generic)
newCreateGameSessionResponse ::
Prelude.Int ->
CreateGameSessionResponse
newCreateGameSessionResponse :: Int -> CreateGameSessionResponse
newCreateGameSessionResponse Int
pHttpStatus_ =
CreateGameSessionResponse'
{ $sel:gameSession:CreateGameSessionResponse' :: Maybe GameSession
gameSession =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateGameSessionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createGameSessionResponse_gameSession :: Lens.Lens' CreateGameSessionResponse (Prelude.Maybe GameSession)
createGameSessionResponse_gameSession :: Lens' CreateGameSessionResponse (Maybe GameSession)
createGameSessionResponse_gameSession = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionResponse' {Maybe GameSession
gameSession :: Maybe GameSession
$sel:gameSession:CreateGameSessionResponse' :: CreateGameSessionResponse -> Maybe GameSession
gameSession} -> Maybe GameSession
gameSession) (\s :: CreateGameSessionResponse
s@CreateGameSessionResponse' {} Maybe GameSession
a -> CreateGameSessionResponse
s {$sel:gameSession:CreateGameSessionResponse' :: Maybe GameSession
gameSession = Maybe GameSession
a} :: CreateGameSessionResponse)
createGameSessionResponse_httpStatus :: Lens.Lens' CreateGameSessionResponse Prelude.Int
createGameSessionResponse_httpStatus :: Lens' CreateGameSessionResponse Int
createGameSessionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGameSessionResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateGameSessionResponse' :: CreateGameSessionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateGameSessionResponse
s@CreateGameSessionResponse' {} Int
a -> CreateGameSessionResponse
s {$sel:httpStatus:CreateGameSessionResponse' :: Int
httpStatus = Int
a} :: CreateGameSessionResponse)
instance Prelude.NFData CreateGameSessionResponse where
rnf :: CreateGameSessionResponse -> ()
rnf CreateGameSessionResponse' {Int
Maybe GameSession
httpStatus :: Int
gameSession :: Maybe GameSession
$sel:httpStatus:CreateGameSessionResponse' :: CreateGameSessionResponse -> Int
$sel:gameSession:CreateGameSessionResponse' :: CreateGameSessionResponse -> 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 Int
httpStatus