{-# 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_gameProperties,
startGameSessionPlacement_gameSessionName,
startGameSessionPlacement_playerLatencies,
startGameSessionPlacement_gameSessionData,
startGameSessionPlacement_desiredPlayerSessions,
startGameSessionPlacement_placementId,
startGameSessionPlacement_gameSessionQueueName,
startGameSessionPlacement_maximumPlayerSessionCount,
StartGameSessionPlacementResponse (..),
newStartGameSessionPlacementResponse,
startGameSessionPlacementResponse_gameSessionPlacement,
startGameSessionPlacementResponse_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 StartGameSessionPlacement = StartGameSessionPlacement'
{
StartGameSessionPlacement -> Maybe [GameProperty]
gameProperties :: Prelude.Maybe [GameProperty],
StartGameSessionPlacement -> Maybe Text
gameSessionName :: Prelude.Maybe Prelude.Text,
StartGameSessionPlacement -> Maybe [PlayerLatency]
playerLatencies :: Prelude.Maybe [PlayerLatency],
StartGameSessionPlacement -> Maybe Text
gameSessionData :: Prelude.Maybe Prelude.Text,
StartGameSessionPlacement -> Maybe [DesiredPlayerSession]
desiredPlayerSessions :: Prelude.Maybe [DesiredPlayerSession],
StartGameSessionPlacement -> Text
placementId :: Prelude.Text,
StartGameSessionPlacement -> Text
gameSessionQueueName :: Prelude.Text,
StartGameSessionPlacement -> Natural
maximumPlayerSessionCount :: Prelude.Natural
}
deriving (StartGameSessionPlacement -> StartGameSessionPlacement -> Bool
(StartGameSessionPlacement -> StartGameSessionPlacement -> Bool)
-> (StartGameSessionPlacement -> StartGameSessionPlacement -> Bool)
-> Eq StartGameSessionPlacement
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]
(Int -> ReadS StartGameSessionPlacement)
-> ReadS [StartGameSessionPlacement]
-> ReadPrec StartGameSessionPlacement
-> ReadPrec [StartGameSessionPlacement]
-> Read 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
(Int -> StartGameSessionPlacement -> ShowS)
-> (StartGameSessionPlacement -> String)
-> ([StartGameSessionPlacement] -> ShowS)
-> Show StartGameSessionPlacement
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.
StartGameSessionPlacement -> Rep StartGameSessionPlacement x)
-> (forall x.
Rep StartGameSessionPlacement x -> StartGameSessionPlacement)
-> Generic StartGameSessionPlacement
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' :: Maybe [GameProperty]
-> Maybe Text
-> Maybe [PlayerLatency]
-> Maybe Text
-> Maybe [DesiredPlayerSession]
-> Text
-> Text
-> Natural
-> StartGameSessionPlacement
StartGameSessionPlacement'
{ $sel:gameProperties:StartGameSessionPlacement' :: Maybe [GameProperty]
gameProperties =
Maybe [GameProperty]
forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionName:StartGameSessionPlacement' :: Maybe Text
gameSessionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:playerLatencies:StartGameSessionPlacement' :: Maybe [PlayerLatency]
playerLatencies = Maybe [PlayerLatency]
forall a. Maybe a
Prelude.Nothing,
$sel:gameSessionData:StartGameSessionPlacement' :: Maybe Text
gameSessionData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:desiredPlayerSessions:StartGameSessionPlacement' :: Maybe [DesiredPlayerSession]
desiredPlayerSessions = Maybe [DesiredPlayerSession]
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_gameProperties :: Lens.Lens' StartGameSessionPlacement (Prelude.Maybe [GameProperty])
startGameSessionPlacement_gameProperties :: (Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> StartGameSessionPlacement -> f StartGameSessionPlacement
startGameSessionPlacement_gameProperties = (StartGameSessionPlacement -> Maybe [GameProperty])
-> (StartGameSessionPlacement
-> Maybe [GameProperty] -> StartGameSessionPlacement)
-> Lens
StartGameSessionPlacement
StartGameSessionPlacement
(Maybe [GameProperty])
(Maybe [GameProperty])
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) ((Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> StartGameSessionPlacement -> f StartGameSessionPlacement)
-> ((Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> (Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> StartGameSessionPlacement
-> f StartGameSessionPlacement
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
startGameSessionPlacement_gameSessionName :: Lens.Lens' StartGameSessionPlacement (Prelude.Maybe Prelude.Text)
startGameSessionPlacement_gameSessionName :: (Maybe Text -> f (Maybe Text))
-> StartGameSessionPlacement -> f StartGameSessionPlacement
startGameSessionPlacement_gameSessionName = (StartGameSessionPlacement -> Maybe Text)
-> (StartGameSessionPlacement
-> Maybe Text -> StartGameSessionPlacement)
-> Lens
StartGameSessionPlacement
StartGameSessionPlacement
(Maybe Text)
(Maybe Text)
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 :: (Maybe [PlayerLatency] -> f (Maybe [PlayerLatency]))
-> StartGameSessionPlacement -> f StartGameSessionPlacement
startGameSessionPlacement_playerLatencies = (StartGameSessionPlacement -> Maybe [PlayerLatency])
-> (StartGameSessionPlacement
-> Maybe [PlayerLatency] -> StartGameSessionPlacement)
-> Lens
StartGameSessionPlacement
StartGameSessionPlacement
(Maybe [PlayerLatency])
(Maybe [PlayerLatency])
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) ((Maybe [PlayerLatency] -> f (Maybe [PlayerLatency]))
-> StartGameSessionPlacement -> f StartGameSessionPlacement)
-> ((Maybe [PlayerLatency] -> f (Maybe [PlayerLatency]))
-> Maybe [PlayerLatency] -> f (Maybe [PlayerLatency]))
-> (Maybe [PlayerLatency] -> f (Maybe [PlayerLatency]))
-> StartGameSessionPlacement
-> f StartGameSessionPlacement
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PlayerLatency] [PlayerLatency] [PlayerLatency] [PlayerLatency]
-> Iso
(Maybe [PlayerLatency])
(Maybe [PlayerLatency])
(Maybe [PlayerLatency])
(Maybe [PlayerLatency])
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
[PlayerLatency] [PlayerLatency] [PlayerLatency] [PlayerLatency]
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 :: (Maybe Text -> f (Maybe Text))
-> StartGameSessionPlacement -> f StartGameSessionPlacement
startGameSessionPlacement_gameSessionData = (StartGameSessionPlacement -> Maybe Text)
-> (StartGameSessionPlacement
-> Maybe Text -> StartGameSessionPlacement)
-> Lens
StartGameSessionPlacement
StartGameSessionPlacement
(Maybe Text)
(Maybe Text)
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_desiredPlayerSessions :: Lens.Lens' StartGameSessionPlacement (Prelude.Maybe [DesiredPlayerSession])
startGameSessionPlacement_desiredPlayerSessions :: (Maybe [DesiredPlayerSession] -> f (Maybe [DesiredPlayerSession]))
-> StartGameSessionPlacement -> f StartGameSessionPlacement
startGameSessionPlacement_desiredPlayerSessions = (StartGameSessionPlacement -> Maybe [DesiredPlayerSession])
-> (StartGameSessionPlacement
-> Maybe [DesiredPlayerSession] -> StartGameSessionPlacement)
-> Lens
StartGameSessionPlacement
StartGameSessionPlacement
(Maybe [DesiredPlayerSession])
(Maybe [DesiredPlayerSession])
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) ((Maybe [DesiredPlayerSession] -> f (Maybe [DesiredPlayerSession]))
-> StartGameSessionPlacement -> f StartGameSessionPlacement)
-> ((Maybe [DesiredPlayerSession]
-> f (Maybe [DesiredPlayerSession]))
-> Maybe [DesiredPlayerSession]
-> f (Maybe [DesiredPlayerSession]))
-> (Maybe [DesiredPlayerSession]
-> f (Maybe [DesiredPlayerSession]))
-> StartGameSessionPlacement
-> f StartGameSessionPlacement
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DesiredPlayerSession]
[DesiredPlayerSession]
[DesiredPlayerSession]
[DesiredPlayerSession]
-> Iso
(Maybe [DesiredPlayerSession])
(Maybe [DesiredPlayerSession])
(Maybe [DesiredPlayerSession])
(Maybe [DesiredPlayerSession])
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
[DesiredPlayerSession]
[DesiredPlayerSession]
[DesiredPlayerSession]
[DesiredPlayerSession]
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 :: (Text -> f Text)
-> StartGameSessionPlacement -> f StartGameSessionPlacement
startGameSessionPlacement_placementId = (StartGameSessionPlacement -> Text)
-> (StartGameSessionPlacement -> Text -> StartGameSessionPlacement)
-> Lens
StartGameSessionPlacement StartGameSessionPlacement Text Text
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 :: (Text -> f Text)
-> StartGameSessionPlacement -> f StartGameSessionPlacement
startGameSessionPlacement_gameSessionQueueName = (StartGameSessionPlacement -> Text)
-> (StartGameSessionPlacement -> Text -> StartGameSessionPlacement)
-> Lens
StartGameSessionPlacement StartGameSessionPlacement Text Text
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 :: (Natural -> f Natural)
-> StartGameSessionPlacement -> f StartGameSessionPlacement
startGameSessionPlacement_maximumPlayerSessionCount = (StartGameSessionPlacement -> Natural)
-> (StartGameSessionPlacement
-> Natural -> StartGameSessionPlacement)
-> Lens
StartGameSessionPlacement StartGameSessionPlacement Natural Natural
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 :: StartGameSessionPlacement -> Request StartGameSessionPlacement
request = Service
-> StartGameSessionPlacement -> Request StartGameSessionPlacement
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartGameSessionPlacement
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartGameSessionPlacement)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartGameSessionPlacement))
-> Logger
-> Service
-> Proxy StartGameSessionPlacement
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartGameSessionPlacement)))
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 GameSessionPlacement
-> Int -> StartGameSessionPlacementResponse
StartGameSessionPlacementResponse'
(Maybe GameSessionPlacement
-> Int -> StartGameSessionPlacementResponse)
-> Either String (Maybe GameSessionPlacement)
-> Either String (Int -> StartGameSessionPlacementResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe GameSessionPlacement)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GameSessionPlacement")
Either String (Int -> StartGameSessionPlacementResponse)
-> Either String Int
-> Either String StartGameSessionPlacementResponse
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 StartGameSessionPlacement
instance Prelude.NFData StartGameSessionPlacement
instance Core.ToHeaders StartGameSessionPlacement where
toHeaders :: StartGameSessionPlacement -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartGameSessionPlacement -> 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.StartGameSessionPlacement" ::
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 StartGameSessionPlacement where
toJSON :: StartGameSessionPlacement -> Value
toJSON StartGameSessionPlacement' {Natural
Maybe [DesiredPlayerSession]
Maybe [GameProperty]
Maybe [PlayerLatency]
Maybe Text
Text
maximumPlayerSessionCount :: Natural
gameSessionQueueName :: Text
placementId :: Text
desiredPlayerSessions :: Maybe [DesiredPlayerSession]
gameSessionData :: Maybe Text
playerLatencies :: Maybe [PlayerLatency]
gameSessionName :: Maybe Text
gameProperties :: Maybe [GameProperty]
$sel:maximumPlayerSessionCount:StartGameSessionPlacement' :: StartGameSessionPlacement -> Natural
$sel:gameSessionQueueName:StartGameSessionPlacement' :: StartGameSessionPlacement -> Text
$sel:placementId:StartGameSessionPlacement' :: StartGameSessionPlacement -> Text
$sel:desiredPlayerSessions:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [DesiredPlayerSession]
$sel:gameSessionData:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe Text
$sel:playerLatencies:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [PlayerLatency]
$sel:gameSessionName:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe Text
$sel:gameProperties:StartGameSessionPlacement' :: StartGameSessionPlacement -> Maybe [GameProperty]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
"GameSessionName" 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
gameSessionName,
(Text
"PlayerLatencies" Text -> [PlayerLatency] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([PlayerLatency] -> Pair) -> Maybe [PlayerLatency] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlayerLatency]
playerLatencies,
(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
"DesiredPlayerSessions" Text -> [DesiredPlayerSession] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([DesiredPlayerSession] -> Pair)
-> Maybe [DesiredPlayerSession] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DesiredPlayerSession]
desiredPlayerSessions,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PlacementId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
placementId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"GameSessionQueueName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
gameSessionQueueName
),
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 StartGameSessionPlacement where
toPath :: StartGameSessionPlacement -> ByteString
toPath = ByteString -> StartGameSessionPlacement -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StartGameSessionPlacement where
toQuery :: StartGameSessionPlacement -> QueryString
toQuery = QueryString -> StartGameSessionPlacement -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(StartGameSessionPlacementResponse
-> StartGameSessionPlacementResponse -> Bool)
-> (StartGameSessionPlacementResponse
-> StartGameSessionPlacementResponse -> Bool)
-> Eq StartGameSessionPlacementResponse
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]
(Int -> ReadS StartGameSessionPlacementResponse)
-> ReadS [StartGameSessionPlacementResponse]
-> ReadPrec StartGameSessionPlacementResponse
-> ReadPrec [StartGameSessionPlacementResponse]
-> Read 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
(Int -> StartGameSessionPlacementResponse -> ShowS)
-> (StartGameSessionPlacementResponse -> String)
-> ([StartGameSessionPlacementResponse] -> ShowS)
-> Show StartGameSessionPlacementResponse
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.
StartGameSessionPlacementResponse
-> Rep StartGameSessionPlacementResponse x)
-> (forall x.
Rep StartGameSessionPlacementResponse x
-> StartGameSessionPlacementResponse)
-> Generic StartGameSessionPlacementResponse
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' :: Maybe GameSessionPlacement
-> Int -> StartGameSessionPlacementResponse
StartGameSessionPlacementResponse'
{ $sel:gameSessionPlacement:StartGameSessionPlacementResponse' :: Maybe GameSessionPlacement
gameSessionPlacement =
Maybe GameSessionPlacement
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartGameSessionPlacementResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startGameSessionPlacementResponse_gameSessionPlacement :: Lens.Lens' StartGameSessionPlacementResponse (Prelude.Maybe GameSessionPlacement)
startGameSessionPlacementResponse_gameSessionPlacement :: (Maybe GameSessionPlacement -> f (Maybe GameSessionPlacement))
-> StartGameSessionPlacementResponse
-> f StartGameSessionPlacementResponse
startGameSessionPlacementResponse_gameSessionPlacement = (StartGameSessionPlacementResponse -> Maybe GameSessionPlacement)
-> (StartGameSessionPlacementResponse
-> Maybe GameSessionPlacement -> StartGameSessionPlacementResponse)
-> Lens
StartGameSessionPlacementResponse
StartGameSessionPlacementResponse
(Maybe GameSessionPlacement)
(Maybe 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 :: (Int -> f Int)
-> StartGameSessionPlacementResponse
-> f StartGameSessionPlacementResponse
startGameSessionPlacementResponse_httpStatus = (StartGameSessionPlacementResponse -> Int)
-> (StartGameSessionPlacementResponse
-> Int -> StartGameSessionPlacementResponse)
-> Lens
StartGameSessionPlacementResponse
StartGameSessionPlacementResponse
Int
Int
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