{-# 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.StartGameSessionPlacement
(
StartGameSessionPlacement (..),
newStartGameSessionPlacement,
startGameSessionPlacement_desiredPlayerSessions,
startGameSessionPlacement_gameProperties,
startGameSessionPlacement_gameSessionData,
startGameSessionPlacement_gameSessionName,
startGameSessionPlacement_playerLatencies,
startGameSessionPlacement_placementId,
startGameSessionPlacement_gameSessionQueueName,
startGameSessionPlacement_maximumPlayerSessionCount,
StartGameSessionPlacementResponse (..),
newStartGameSessionPlacementResponse,
startGameSessionPlacementResponse_gameSessionPlacement,
startGameSessionPlacementResponse_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 StartGameSessionPlacement = StartGameSessionPlacement'
{
StartGameSessionPlacement -> Maybe [DesiredPlayerSession]
desiredPlayerSessions :: Prelude.Maybe [DesiredPlayerSession],
StartGameSessionPlacement -> Maybe [GameProperty]
gameProperties :: Prelude.Maybe [GameProperty],
StartGameSessionPlacement -> Maybe Text
gameSessionData :: Prelude.Maybe Prelude.Text,
StartGameSessionPlacement -> Maybe Text
gameSessionName :: Prelude.Maybe Prelude.Text,
StartGameSessionPlacement -> Maybe [PlayerLatency]
playerLatencies :: Prelude.Maybe [PlayerLatency],
StartGameSessionPlacement -> Text
placementId :: Prelude.Text,
StartGameSessionPlacement -> Text
gameSessionQueueName :: Prelude.Text,
StartGameSessionPlacement -> Natural
maximumPlayerSessionCount :: Prelude.Natural
}
deriving (StartGameSessionPlacement -> StartGameSessionPlacement -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartGameSessionPlacement -> StartGameSessionPlacement -> Bool
$c/= :: StartGameSessionPlacement -> StartGameSessionPlacement -> Bool
== :: StartGameSessionPlacement -> StartGameSessionPlacement -> Bool
$c== :: StartGameSessionPlacement -> StartGameSessionPlacement -> Bool
Prelude.Eq, ReadPrec [StartGameSessionPlacement]
ReadPrec StartGameSessionPlacement
Int -> ReadS StartGameSessionPlacement
ReadS [StartGameSessionPlacement]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartGameSessionPlacement]
$creadListPrec :: ReadPrec [StartGameSessionPlacement]
readPrec :: ReadPrec StartGameSessionPlacement
$creadPrec :: ReadPrec StartGameSessionPlacement
readList :: ReadS [StartGameSessionPlacement]
$creadList :: ReadS [StartGameSessionPlacement]
readsPrec :: Int -> ReadS StartGameSessionPlacement
$creadsPrec :: Int -> ReadS StartGameSessionPlacement
Prelude.Read, Int -> StartGameSessionPlacement -> ShowS
[StartGameSessionPlacement] -> ShowS
StartGameSessionPlacement -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartGameSessionPlacement] -> ShowS
$cshowList :: [StartGameSessionPlacement] -> ShowS
show :: StartGameSessionPlacement -> String
$cshow :: StartGameSessionPlacement -> String
showsPrec :: Int -> StartGameSessionPlacement -> ShowS
$cshowsPrec :: Int -> StartGameSessionPlacement -> ShowS
Prelude.Show, forall x.
Rep StartGameSessionPlacement x -> StartGameSessionPlacement
forall x.
StartGameSessionPlacement -> Rep StartGameSessionPlacement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartGameSessionPlacement x -> StartGameSessionPlacement
$cfrom :: forall x.
StartGameSessionPlacement -> Rep StartGameSessionPlacement x
Prelude.Generic)
newStartGameSessionPlacement ::
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
StartGameSessionPlacement
newStartGameSessionPlacement :: Text -> Text -> Natural -> StartGameSessionPlacement
newStartGameSessionPlacement
Text
pPlacementId_
Text
pGameSessionQueueName_
Natural
pMaximumPlayerSessionCount_ =
StartGameSessionPlacement'
{ $sel:desiredPlayerSessions:StartGameSessionPlacement' :: Maybe [DesiredPlayerSession]
desiredPlayerSessions =
forall a. Maybe a
Prelude.Nothing,
$sel:gameProperties:StartGameSessionPlacement' :: Maybe [GameProperty]
gameProperties = forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionData:StartGameSessionPlacement' :: Maybe Text
gameSessionData = forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionName:StartGameSessionPlacement' :: Maybe Text
gameSessionName = forall a. Maybe a
Prelude.Nothing,
$sel:playerLatencies:StartGameSessionPlacement' :: Maybe [PlayerLatency]
playerLatencies = forall a. Maybe a
Prelude.Nothing,
$sel:placementId:StartGameSessionPlacement' :: Text
placementId = Text
pPlacementId_,
$sel:gameSessionQueueName:StartGameSessionPlacement' :: Text
gameSessionQueueName = Text
pGameSessionQueueName_,
$sel:maximumPlayerSessionCount:StartGameSessionPlacement' :: Natural
maximumPlayerSessionCount =
Natural
pMaximumPlayerSessionCount_
}
startGameSessionPlacement_desiredPlayerSessions :: Lens.Lens' StartGameSessionPlacement (Prelude.Maybe [DesiredPlayerSession])
startGameSessionPlacement_desiredPlayerSessions :: Lens' StartGameSessionPlacement (Maybe [DesiredPlayerSession])
startGameSessionPlacement_desiredPlayerSessions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartGameSessionPlacement' {Maybe [DesiredPlayerSession]
desiredPlayerSessions :: Maybe [DesiredPlayerSession]
$sel:desiredPlayerSessions:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [DesiredPlayerSession]
desiredPlayerSessions} -> Maybe [DesiredPlayerSession]
desiredPlayerSessions) (\s :: StartGameSessionPlacement
s@StartGameSessionPlacement' {} Maybe [DesiredPlayerSession]
a -> StartGameSessionPlacement
s {$sel:desiredPlayerSessions:StartGameSessionPlacement' :: Maybe [DesiredPlayerSession]
desiredPlayerSessions = Maybe [DesiredPlayerSession]
a} :: StartGameSessionPlacement) 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
startGameSessionPlacement_gameProperties :: Lens.Lens' StartGameSessionPlacement (Prelude.Maybe [GameProperty])
startGameSessionPlacement_gameProperties :: Lens' StartGameSessionPlacement (Maybe [GameProperty])
startGameSessionPlacement_gameProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartGameSessionPlacement' {Maybe [GameProperty]
gameProperties :: Maybe [GameProperty]
$sel:gameProperties:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [GameProperty]
gameProperties} -> Maybe [GameProperty]
gameProperties) (\s :: StartGameSessionPlacement
s@StartGameSessionPlacement' {} Maybe [GameProperty]
a -> StartGameSessionPlacement
s {$sel:gameProperties:StartGameSessionPlacement' :: Maybe [GameProperty]
gameProperties = Maybe [GameProperty]
a} :: StartGameSessionPlacement) 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
startGameSessionPlacement_gameSessionData :: Lens.Lens' StartGameSessionPlacement (Prelude.Maybe Prelude.Text)
startGameSessionPlacement_gameSessionData :: Lens' StartGameSessionPlacement (Maybe Text)
startGameSessionPlacement_gameSessionData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartGameSessionPlacement' {Maybe Text
gameSessionData :: Maybe Text
$sel:gameSessionData:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe Text
gameSessionData} -> Maybe Text
gameSessionData) (\s :: StartGameSessionPlacement
s@StartGameSessionPlacement' {} Maybe Text
a -> StartGameSessionPlacement
s {$sel:gameSessionData:StartGameSessionPlacement' :: Maybe Text
gameSessionData = Maybe Text
a} :: StartGameSessionPlacement)
startGameSessionPlacement_gameSessionName :: Lens.Lens' StartGameSessionPlacement (Prelude.Maybe Prelude.Text)
startGameSessionPlacement_gameSessionName :: Lens' StartGameSessionPlacement (Maybe Text)
startGameSessionPlacement_gameSessionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartGameSessionPlacement' {Maybe Text
gameSessionName :: Maybe Text
$sel:gameSessionName:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe Text
gameSessionName} -> Maybe Text
gameSessionName) (\s :: StartGameSessionPlacement
s@StartGameSessionPlacement' {} Maybe Text
a -> StartGameSessionPlacement
s {$sel:gameSessionName:StartGameSessionPlacement' :: Maybe Text
gameSessionName = Maybe Text
a} :: StartGameSessionPlacement)
startGameSessionPlacement_playerLatencies :: Lens.Lens' StartGameSessionPlacement (Prelude.Maybe [PlayerLatency])
startGameSessionPlacement_playerLatencies :: Lens' StartGameSessionPlacement (Maybe [PlayerLatency])
startGameSessionPlacement_playerLatencies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartGameSessionPlacement' {Maybe [PlayerLatency]
playerLatencies :: Maybe [PlayerLatency]
$sel:playerLatencies:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [PlayerLatency]
playerLatencies} -> Maybe [PlayerLatency]
playerLatencies) (\s :: StartGameSessionPlacement
s@StartGameSessionPlacement' {} Maybe [PlayerLatency]
a -> StartGameSessionPlacement
s {$sel:playerLatencies:StartGameSessionPlacement' :: Maybe [PlayerLatency]
playerLatencies = Maybe [PlayerLatency]
a} :: StartGameSessionPlacement) 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
startGameSessionPlacement_placementId :: Lens.Lens' StartGameSessionPlacement Prelude.Text
startGameSessionPlacement_placementId :: Lens' StartGameSessionPlacement Text
startGameSessionPlacement_placementId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartGameSessionPlacement' {Text
placementId :: Text
$sel:placementId:StartGameSessionPlacement' :: StartGameSessionPlacement -> Text
placementId} -> Text
placementId) (\s :: StartGameSessionPlacement
s@StartGameSessionPlacement' {} Text
a -> StartGameSessionPlacement
s {$sel:placementId:StartGameSessionPlacement' :: Text
placementId = Text
a} :: StartGameSessionPlacement)
startGameSessionPlacement_gameSessionQueueName :: Lens.Lens' StartGameSessionPlacement Prelude.Text
startGameSessionPlacement_gameSessionQueueName :: Lens' StartGameSessionPlacement Text
startGameSessionPlacement_gameSessionQueueName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartGameSessionPlacement' {Text
gameSessionQueueName :: Text
$sel:gameSessionQueueName:StartGameSessionPlacement' :: StartGameSessionPlacement -> Text
gameSessionQueueName} -> Text
gameSessionQueueName) (\s :: StartGameSessionPlacement
s@StartGameSessionPlacement' {} Text
a -> StartGameSessionPlacement
s {$sel:gameSessionQueueName:StartGameSessionPlacement' :: Text
gameSessionQueueName = Text
a} :: StartGameSessionPlacement)
startGameSessionPlacement_maximumPlayerSessionCount :: Lens.Lens' StartGameSessionPlacement Prelude.Natural
startGameSessionPlacement_maximumPlayerSessionCount :: Lens' StartGameSessionPlacement Natural
startGameSessionPlacement_maximumPlayerSessionCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartGameSessionPlacement' {Natural
maximumPlayerSessionCount :: Natural
$sel:maximumPlayerSessionCount:StartGameSessionPlacement' :: StartGameSessionPlacement -> Natural
maximumPlayerSessionCount} -> Natural
maximumPlayerSessionCount) (\s :: StartGameSessionPlacement
s@StartGameSessionPlacement' {} Natural
a -> StartGameSessionPlacement
s {$sel:maximumPlayerSessionCount:StartGameSessionPlacement' :: Natural
maximumPlayerSessionCount = Natural
a} :: StartGameSessionPlacement)
instance Core.AWSRequest StartGameSessionPlacement where
type
AWSResponse StartGameSessionPlacement =
StartGameSessionPlacementResponse
request :: (Service -> Service)
-> StartGameSessionPlacement -> Request StartGameSessionPlacement
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 StartGameSessionPlacement
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartGameSessionPlacement)))
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 GameSessionPlacement
-> Int -> StartGameSessionPlacementResponse
StartGameSessionPlacementResponse'
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
"GameSessionPlacement")
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 StartGameSessionPlacement where
hashWithSalt :: Int -> StartGameSessionPlacement -> Int
hashWithSalt Int
_salt StartGameSessionPlacement' {Natural
Maybe [DesiredPlayerSession]
Maybe [GameProperty]
Maybe [PlayerLatency]
Maybe Text
Text
maximumPlayerSessionCount :: Natural
gameSessionQueueName :: Text
placementId :: Text
playerLatencies :: Maybe [PlayerLatency]
gameSessionName :: Maybe Text
gameSessionData :: Maybe Text
gameProperties :: Maybe [GameProperty]
desiredPlayerSessions :: Maybe [DesiredPlayerSession]
$sel:maximumPlayerSessionCount:StartGameSessionPlacement' :: StartGameSessionPlacement -> Natural
$sel:gameSessionQueueName:StartGameSessionPlacement' :: StartGameSessionPlacement -> Text
$sel:placementId:StartGameSessionPlacement' :: StartGameSessionPlacement -> Text
$sel:playerLatencies:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [PlayerLatency]
$sel:gameSessionName:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe Text
$sel:gameSessionData:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe Text
$sel:gameProperties:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [GameProperty]
$sel:desiredPlayerSessions:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [DesiredPlayerSession]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DesiredPlayerSession]
desiredPlayerSessions
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
gameSessionName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PlayerLatency]
playerLatencies
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
placementId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
gameSessionQueueName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
maximumPlayerSessionCount
instance Prelude.NFData StartGameSessionPlacement where
rnf :: StartGameSessionPlacement -> ()
rnf StartGameSessionPlacement' {Natural
Maybe [DesiredPlayerSession]
Maybe [GameProperty]
Maybe [PlayerLatency]
Maybe Text
Text
maximumPlayerSessionCount :: Natural
gameSessionQueueName :: Text
placementId :: Text
playerLatencies :: Maybe [PlayerLatency]
gameSessionName :: Maybe Text
gameSessionData :: Maybe Text
gameProperties :: Maybe [GameProperty]
desiredPlayerSessions :: Maybe [DesiredPlayerSession]
$sel:maximumPlayerSessionCount:StartGameSessionPlacement' :: StartGameSessionPlacement -> Natural
$sel:gameSessionQueueName:StartGameSessionPlacement' :: StartGameSessionPlacement -> Text
$sel:placementId:StartGameSessionPlacement' :: StartGameSessionPlacement -> Text
$sel:playerLatencies:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [PlayerLatency]
$sel:gameSessionName:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe Text
$sel:gameSessionData:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe Text
$sel:gameProperties:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [GameProperty]
$sel:desiredPlayerSessions:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [DesiredPlayerSession]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [DesiredPlayerSession]
desiredPlayerSessions
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
gameSessionName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PlayerLatency]
playerLatencies
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
placementId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
gameSessionQueueName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
maximumPlayerSessionCount
instance Data.ToHeaders StartGameSessionPlacement where
toHeaders :: StartGameSessionPlacement -> 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.StartGameSessionPlacement" ::
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 StartGameSessionPlacement where
toJSON :: StartGameSessionPlacement -> Value
toJSON StartGameSessionPlacement' {Natural
Maybe [DesiredPlayerSession]
Maybe [GameProperty]
Maybe [PlayerLatency]
Maybe Text
Text
maximumPlayerSessionCount :: Natural
gameSessionQueueName :: Text
placementId :: Text
playerLatencies :: Maybe [PlayerLatency]
gameSessionName :: Maybe Text
gameSessionData :: Maybe Text
gameProperties :: Maybe [GameProperty]
desiredPlayerSessions :: Maybe [DesiredPlayerSession]
$sel:maximumPlayerSessionCount:StartGameSessionPlacement' :: StartGameSessionPlacement -> Natural
$sel:gameSessionQueueName:StartGameSessionPlacement' :: StartGameSessionPlacement -> Text
$sel:placementId:StartGameSessionPlacement' :: StartGameSessionPlacement -> Text
$sel:playerLatencies:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [PlayerLatency]
$sel:gameSessionName:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe Text
$sel:gameSessionData:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe Text
$sel:gameProperties:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [GameProperty]
$sel:desiredPlayerSessions:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [DesiredPlayerSession]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DesiredPlayerSessions" 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 [DesiredPlayerSession]
desiredPlayerSessions,
(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
"GameSessionName" 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
gameSessionName,
(Key
"PlayerLatencies" 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 [PlayerLatency]
playerLatencies,
forall a. a -> Maybe a
Prelude.Just (Key
"PlacementId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
placementId),
forall a. a -> Maybe a
Prelude.Just
( Key
"GameSessionQueueName"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
gameSessionQueueName
),
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 StartGameSessionPlacement where
toPath :: StartGameSessionPlacement -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StartGameSessionPlacement where
toQuery :: StartGameSessionPlacement -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StartGameSessionPlacementResponse = StartGameSessionPlacementResponse'
{
StartGameSessionPlacementResponse -> Maybe GameSessionPlacement
gameSessionPlacement :: Prelude.Maybe GameSessionPlacement,
StartGameSessionPlacementResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartGameSessionPlacementResponse
-> StartGameSessionPlacementResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartGameSessionPlacementResponse
-> StartGameSessionPlacementResponse -> Bool
$c/= :: StartGameSessionPlacementResponse
-> StartGameSessionPlacementResponse -> Bool
== :: StartGameSessionPlacementResponse
-> StartGameSessionPlacementResponse -> Bool
$c== :: StartGameSessionPlacementResponse
-> StartGameSessionPlacementResponse -> Bool
Prelude.Eq, ReadPrec [StartGameSessionPlacementResponse]
ReadPrec StartGameSessionPlacementResponse
Int -> ReadS StartGameSessionPlacementResponse
ReadS [StartGameSessionPlacementResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartGameSessionPlacementResponse]
$creadListPrec :: ReadPrec [StartGameSessionPlacementResponse]
readPrec :: ReadPrec StartGameSessionPlacementResponse
$creadPrec :: ReadPrec StartGameSessionPlacementResponse
readList :: ReadS [StartGameSessionPlacementResponse]
$creadList :: ReadS [StartGameSessionPlacementResponse]
readsPrec :: Int -> ReadS StartGameSessionPlacementResponse
$creadsPrec :: Int -> ReadS StartGameSessionPlacementResponse
Prelude.Read, Int -> StartGameSessionPlacementResponse -> ShowS
[StartGameSessionPlacementResponse] -> ShowS
StartGameSessionPlacementResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartGameSessionPlacementResponse] -> ShowS
$cshowList :: [StartGameSessionPlacementResponse] -> ShowS
show :: StartGameSessionPlacementResponse -> String
$cshow :: StartGameSessionPlacementResponse -> String
showsPrec :: Int -> StartGameSessionPlacementResponse -> ShowS
$cshowsPrec :: Int -> StartGameSessionPlacementResponse -> ShowS
Prelude.Show, forall x.
Rep StartGameSessionPlacementResponse x
-> StartGameSessionPlacementResponse
forall x.
StartGameSessionPlacementResponse
-> Rep StartGameSessionPlacementResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartGameSessionPlacementResponse x
-> StartGameSessionPlacementResponse
$cfrom :: forall x.
StartGameSessionPlacementResponse
-> Rep StartGameSessionPlacementResponse x
Prelude.Generic)
newStartGameSessionPlacementResponse ::
Prelude.Int ->
StartGameSessionPlacementResponse
newStartGameSessionPlacementResponse :: Int -> StartGameSessionPlacementResponse
newStartGameSessionPlacementResponse Int
pHttpStatus_ =
StartGameSessionPlacementResponse'
{ $sel:gameSessionPlacement:StartGameSessionPlacementResponse' :: Maybe GameSessionPlacement
gameSessionPlacement =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartGameSessionPlacementResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startGameSessionPlacementResponse_gameSessionPlacement :: Lens.Lens' StartGameSessionPlacementResponse (Prelude.Maybe GameSessionPlacement)
startGameSessionPlacementResponse_gameSessionPlacement :: Lens'
StartGameSessionPlacementResponse (Maybe GameSessionPlacement)
startGameSessionPlacementResponse_gameSessionPlacement = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartGameSessionPlacementResponse' {Maybe GameSessionPlacement
gameSessionPlacement :: Maybe GameSessionPlacement
$sel:gameSessionPlacement:StartGameSessionPlacementResponse' :: StartGameSessionPlacementResponse -> Maybe GameSessionPlacement
gameSessionPlacement} -> Maybe GameSessionPlacement
gameSessionPlacement) (\s :: StartGameSessionPlacementResponse
s@StartGameSessionPlacementResponse' {} Maybe GameSessionPlacement
a -> StartGameSessionPlacementResponse
s {$sel:gameSessionPlacement:StartGameSessionPlacementResponse' :: Maybe GameSessionPlacement
gameSessionPlacement = Maybe GameSessionPlacement
a} :: StartGameSessionPlacementResponse)
startGameSessionPlacementResponse_httpStatus :: Lens.Lens' StartGameSessionPlacementResponse Prelude.Int
startGameSessionPlacementResponse_httpStatus :: Lens' StartGameSessionPlacementResponse Int
startGameSessionPlacementResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartGameSessionPlacementResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartGameSessionPlacementResponse' :: StartGameSessionPlacementResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartGameSessionPlacementResponse
s@StartGameSessionPlacementResponse' {} Int
a -> StartGameSessionPlacementResponse
s {$sel:httpStatus:StartGameSessionPlacementResponse' :: Int
httpStatus = Int
a} :: StartGameSessionPlacementResponse)
instance
Prelude.NFData
StartGameSessionPlacementResponse
where
rnf :: StartGameSessionPlacementResponse -> ()
rnf StartGameSessionPlacementResponse' {Int
Maybe GameSessionPlacement
httpStatus :: Int
gameSessionPlacement :: Maybe GameSessionPlacement
$sel:httpStatus:StartGameSessionPlacementResponse' :: StartGameSessionPlacementResponse -> Int
$sel:gameSessionPlacement:StartGameSessionPlacementResponse' :: StartGameSessionPlacementResponse -> Maybe GameSessionPlacement
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe GameSessionPlacement
gameSessionPlacement
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus