{-# 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_idempotencyToken,
createGameSession_gameProperties,
createGameSession_location,
createGameSession_gameSessionId,
createGameSession_aliasId,
createGameSession_name,
createGameSession_gameSessionData,
createGameSession_fleetId,
createGameSession_creatorId,
createGameSession_maximumPlayerSessionCount,
CreateGameSessionResponse (..),
newCreateGameSessionResponse,
createGameSessionResponse_gameSession,
createGameSessionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateGameSession = CreateGameSession'
{
CreateGameSession -> Maybe Text
idempotencyToken :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe [GameProperty]
gameProperties :: Prelude.Maybe [GameProperty],
CreateGameSession -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
gameSessionId :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
aliasId :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
gameSessionData :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Maybe Text
creatorId :: Prelude.Maybe Prelude.Text,
CreateGameSession -> Natural
maximumPlayerSessionCount :: Prelude.Natural
}
deriving (CreateGameSession -> CreateGameSession -> Bool
(CreateGameSession -> CreateGameSession -> Bool)
-> (CreateGameSession -> CreateGameSession -> Bool)
-> Eq CreateGameSession
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]
(Int -> ReadS CreateGameSession)
-> ReadS [CreateGameSession]
-> ReadPrec CreateGameSession
-> ReadPrec [CreateGameSession]
-> Read 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
(Int -> CreateGameSession -> ShowS)
-> (CreateGameSession -> String)
-> ([CreateGameSession] -> ShowS)
-> Show CreateGameSession
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. CreateGameSession -> Rep CreateGameSession x)
-> (forall x. Rep CreateGameSession x -> CreateGameSession)
-> Generic CreateGameSession
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' :: Maybe Text
-> Maybe [GameProperty]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Natural
-> CreateGameSession
CreateGameSession'
{ $sel:idempotencyToken:CreateGameSession' :: Maybe Text
idempotencyToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gameProperties:CreateGameSession' :: Maybe [GameProperty]
gameProperties = Maybe [GameProperty]
forall a. Maybe a
Prelude.Nothing,
$sel:location:CreateGameSession' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionId:CreateGameSession' :: Maybe Text
gameSessionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:aliasId:CreateGameSession' :: Maybe Text
aliasId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateGameSession' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionData:CreateGameSession' :: Maybe Text
gameSessionData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:CreateGameSession' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creatorId:CreateGameSession' :: Maybe Text
creatorId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maximumPlayerSessionCount:CreateGameSession' :: Natural
maximumPlayerSessionCount =
Natural
pMaximumPlayerSessionCount_
}
createGameSession_idempotencyToken :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_idempotencyToken :: (Maybe Text -> f (Maybe Text))
-> CreateGameSession -> f CreateGameSession
createGameSession_idempotencyToken = (CreateGameSession -> Maybe Text)
-> (CreateGameSession -> Maybe Text -> CreateGameSession)
-> Lens
CreateGameSession CreateGameSession (Maybe Text) (Maybe Text)
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_gameProperties :: Lens.Lens' CreateGameSession (Prelude.Maybe [GameProperty])
createGameSession_gameProperties :: (Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> CreateGameSession -> f CreateGameSession
createGameSession_gameProperties = (CreateGameSession -> Maybe [GameProperty])
-> (CreateGameSession -> Maybe [GameProperty] -> CreateGameSession)
-> Lens
CreateGameSession
CreateGameSession
(Maybe [GameProperty])
(Maybe [GameProperty])
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) ((Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> CreateGameSession -> f CreateGameSession)
-> ((Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> (Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> CreateGameSession
-> f CreateGameSession
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [GameProperty] [GameProperty] [GameProperty] [GameProperty]
-> Iso
(Maybe [GameProperty])
(Maybe [GameProperty])
(Maybe [GameProperty])
(Maybe [GameProperty])
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 AnIso [GameProperty] [GameProperty] [GameProperty] [GameProperty]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createGameSession_location :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_location :: (Maybe Text -> f (Maybe Text))
-> CreateGameSession -> f CreateGameSession
createGameSession_location = (CreateGameSession -> Maybe Text)
-> (CreateGameSession -> Maybe Text -> CreateGameSession)
-> Lens
CreateGameSession CreateGameSession (Maybe Text) (Maybe Text)
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_gameSessionId :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_gameSessionId :: (Maybe Text -> f (Maybe Text))
-> CreateGameSession -> f CreateGameSession
createGameSession_gameSessionId = (CreateGameSession -> Maybe Text)
-> (CreateGameSession -> Maybe Text -> CreateGameSession)
-> Lens
CreateGameSession CreateGameSession (Maybe Text) (Maybe Text)
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_aliasId :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_aliasId :: (Maybe Text -> f (Maybe Text))
-> CreateGameSession -> f CreateGameSession
createGameSession_aliasId = (CreateGameSession -> Maybe Text)
-> (CreateGameSession -> Maybe Text -> CreateGameSession)
-> Lens
CreateGameSession CreateGameSession (Maybe Text) (Maybe Text)
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_name :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_name :: (Maybe Text -> f (Maybe Text))
-> CreateGameSession -> f CreateGameSession
createGameSession_name = (CreateGameSession -> Maybe Text)
-> (CreateGameSession -> Maybe Text -> CreateGameSession)
-> Lens
CreateGameSession CreateGameSession (Maybe Text) (Maybe Text)
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_gameSessionData :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_gameSessionData :: (Maybe Text -> f (Maybe Text))
-> CreateGameSession -> f CreateGameSession
createGameSession_gameSessionData = (CreateGameSession -> Maybe Text)
-> (CreateGameSession -> Maybe Text -> CreateGameSession)
-> Lens
CreateGameSession CreateGameSession (Maybe Text) (Maybe Text)
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_fleetId :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_fleetId :: (Maybe Text -> f (Maybe Text))
-> CreateGameSession -> f CreateGameSession
createGameSession_fleetId = (CreateGameSession -> Maybe Text)
-> (CreateGameSession -> Maybe Text -> CreateGameSession)
-> Lens
CreateGameSession CreateGameSession (Maybe Text) (Maybe Text)
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_creatorId :: Lens.Lens' CreateGameSession (Prelude.Maybe Prelude.Text)
createGameSession_creatorId :: (Maybe Text -> f (Maybe Text))
-> CreateGameSession -> f CreateGameSession
createGameSession_creatorId = (CreateGameSession -> Maybe Text)
-> (CreateGameSession -> Maybe Text -> CreateGameSession)
-> Lens
CreateGameSession CreateGameSession (Maybe Text) (Maybe Text)
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_maximumPlayerSessionCount :: Lens.Lens' CreateGameSession Prelude.Natural
createGameSession_maximumPlayerSessionCount :: (Natural -> f Natural) -> CreateGameSession -> f CreateGameSession
createGameSession_maximumPlayerSessionCount = (CreateGameSession -> Natural)
-> (CreateGameSession -> Natural -> CreateGameSession)
-> Lens CreateGameSession CreateGameSession Natural Natural
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 :: CreateGameSession -> Request CreateGameSession
request = Service -> CreateGameSession -> Request CreateGameSession
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateGameSession
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateGameSession)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateGameSession))
-> Logger
-> Service
-> Proxy CreateGameSession
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateGameSession)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe GameSession -> Int -> CreateGameSessionResponse
CreateGameSessionResponse'
(Maybe GameSession -> Int -> CreateGameSessionResponse)
-> Either String (Maybe GameSession)
-> Either String (Int -> CreateGameSessionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe GameSession)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GameSession")
Either String (Int -> CreateGameSessionResponse)
-> Either String Int -> Either String CreateGameSessionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable CreateGameSession
instance Prelude.NFData CreateGameSession
instance Core.ToHeaders CreateGameSession where
toHeaders :: CreateGameSession -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateGameSession -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"GameLift.CreateGameSession" :: Prelude.ByteString),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateGameSession where
toJSON :: CreateGameSession -> Value
toJSON CreateGameSession' {Natural
Maybe [GameProperty]
Maybe Text
maximumPlayerSessionCount :: Natural
creatorId :: Maybe Text
fleetId :: Maybe Text
gameSessionData :: Maybe Text
name :: Maybe Text
aliasId :: Maybe Text
gameSessionId :: Maybe Text
location :: Maybe Text
gameProperties :: Maybe [GameProperty]
idempotencyToken :: Maybe Text
$sel:maximumPlayerSessionCount:CreateGameSession' :: CreateGameSession -> Natural
$sel:creatorId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:fleetId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameSessionData:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:name:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:aliasId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameSessionId:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:location:CreateGameSession' :: CreateGameSession -> Maybe Text
$sel:gameProperties:CreateGameSession' :: CreateGameSession -> Maybe [GameProperty]
$sel:idempotencyToken:CreateGameSession' :: CreateGameSession -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IdempotencyToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
idempotencyToken,
(Text
"GameProperties" Text -> [GameProperty] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([GameProperty] -> Pair) -> Maybe [GameProperty] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [GameProperty]
gameProperties,
(Text
"Location" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
location,
(Text
"GameSessionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
gameSessionId,
(Text
"AliasId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
aliasId,
(Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"GameSessionData" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
gameSessionData,
(Text
"FleetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fleetId,
(Text
"CreatorId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
creatorId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"MaximumPlayerSessionCount"
Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
maximumPlayerSessionCount
)
]
)
instance Core.ToPath CreateGameSession where
toPath :: CreateGameSession -> ByteString
toPath = ByteString -> CreateGameSession -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateGameSession where
toQuery :: CreateGameSession -> QueryString
toQuery = QueryString -> CreateGameSession -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateGameSessionResponse -> CreateGameSessionResponse -> Bool)
-> (CreateGameSessionResponse -> CreateGameSessionResponse -> Bool)
-> Eq CreateGameSessionResponse
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]
(Int -> ReadS CreateGameSessionResponse)
-> ReadS [CreateGameSessionResponse]
-> ReadPrec CreateGameSessionResponse
-> ReadPrec [CreateGameSessionResponse]
-> Read 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
(Int -> CreateGameSessionResponse -> ShowS)
-> (CreateGameSessionResponse -> String)
-> ([CreateGameSessionResponse] -> ShowS)
-> Show CreateGameSessionResponse
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.
CreateGameSessionResponse -> Rep CreateGameSessionResponse x)
-> (forall x.
Rep CreateGameSessionResponse x -> CreateGameSessionResponse)
-> Generic CreateGameSessionResponse
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' :: Maybe GameSession -> Int -> CreateGameSessionResponse
CreateGameSessionResponse'
{ $sel:gameSession:CreateGameSessionResponse' :: Maybe GameSession
gameSession =
Maybe GameSession
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateGameSessionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createGameSessionResponse_gameSession :: Lens.Lens' CreateGameSessionResponse (Prelude.Maybe GameSession)
createGameSessionResponse_gameSession :: (Maybe GameSession -> f (Maybe GameSession))
-> CreateGameSessionResponse -> f CreateGameSessionResponse
createGameSessionResponse_gameSession = (CreateGameSessionResponse -> Maybe GameSession)
-> (CreateGameSessionResponse
-> Maybe GameSession -> CreateGameSessionResponse)
-> Lens
CreateGameSessionResponse
CreateGameSessionResponse
(Maybe GameSession)
(Maybe 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 :: (Int -> f Int)
-> CreateGameSessionResponse -> f CreateGameSessionResponse
createGameSessionResponse_httpStatus = (CreateGameSessionResponse -> Int)
-> (CreateGameSessionResponse -> Int -> CreateGameSessionResponse)
-> Lens CreateGameSessionResponse CreateGameSessionResponse Int Int
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