{-# 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.StopGameSessionPlacement
(
StopGameSessionPlacement (..),
newStopGameSessionPlacement,
stopGameSessionPlacement_placementId,
StopGameSessionPlacementResponse (..),
newStopGameSessionPlacementResponse,
stopGameSessionPlacementResponse_gameSessionPlacement,
stopGameSessionPlacementResponse_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 StopGameSessionPlacement = StopGameSessionPlacement'
{
StopGameSessionPlacement -> Text
placementId :: Prelude.Text
}
deriving (StopGameSessionPlacement -> StopGameSessionPlacement -> Bool
(StopGameSessionPlacement -> StopGameSessionPlacement -> Bool)
-> (StopGameSessionPlacement -> StopGameSessionPlacement -> Bool)
-> Eq StopGameSessionPlacement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopGameSessionPlacement -> StopGameSessionPlacement -> Bool
$c/= :: StopGameSessionPlacement -> StopGameSessionPlacement -> Bool
== :: StopGameSessionPlacement -> StopGameSessionPlacement -> Bool
$c== :: StopGameSessionPlacement -> StopGameSessionPlacement -> Bool
Prelude.Eq, ReadPrec [StopGameSessionPlacement]
ReadPrec StopGameSessionPlacement
Int -> ReadS StopGameSessionPlacement
ReadS [StopGameSessionPlacement]
(Int -> ReadS StopGameSessionPlacement)
-> ReadS [StopGameSessionPlacement]
-> ReadPrec StopGameSessionPlacement
-> ReadPrec [StopGameSessionPlacement]
-> Read StopGameSessionPlacement
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopGameSessionPlacement]
$creadListPrec :: ReadPrec [StopGameSessionPlacement]
readPrec :: ReadPrec StopGameSessionPlacement
$creadPrec :: ReadPrec StopGameSessionPlacement
readList :: ReadS [StopGameSessionPlacement]
$creadList :: ReadS [StopGameSessionPlacement]
readsPrec :: Int -> ReadS StopGameSessionPlacement
$creadsPrec :: Int -> ReadS StopGameSessionPlacement
Prelude.Read, Int -> StopGameSessionPlacement -> ShowS
[StopGameSessionPlacement] -> ShowS
StopGameSessionPlacement -> String
(Int -> StopGameSessionPlacement -> ShowS)
-> (StopGameSessionPlacement -> String)
-> ([StopGameSessionPlacement] -> ShowS)
-> Show StopGameSessionPlacement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopGameSessionPlacement] -> ShowS
$cshowList :: [StopGameSessionPlacement] -> ShowS
show :: StopGameSessionPlacement -> String
$cshow :: StopGameSessionPlacement -> String
showsPrec :: Int -> StopGameSessionPlacement -> ShowS
$cshowsPrec :: Int -> StopGameSessionPlacement -> ShowS
Prelude.Show, (forall x.
StopGameSessionPlacement -> Rep StopGameSessionPlacement x)
-> (forall x.
Rep StopGameSessionPlacement x -> StopGameSessionPlacement)
-> Generic StopGameSessionPlacement
forall x.
Rep StopGameSessionPlacement x -> StopGameSessionPlacement
forall x.
StopGameSessionPlacement -> Rep StopGameSessionPlacement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopGameSessionPlacement x -> StopGameSessionPlacement
$cfrom :: forall x.
StopGameSessionPlacement -> Rep StopGameSessionPlacement x
Prelude.Generic)
newStopGameSessionPlacement ::
Prelude.Text ->
StopGameSessionPlacement
newStopGameSessionPlacement :: Text -> StopGameSessionPlacement
newStopGameSessionPlacement Text
pPlacementId_ =
StopGameSessionPlacement' :: Text -> StopGameSessionPlacement
StopGameSessionPlacement'
{ $sel:placementId:StopGameSessionPlacement' :: Text
placementId =
Text
pPlacementId_
}
stopGameSessionPlacement_placementId :: Lens.Lens' StopGameSessionPlacement Prelude.Text
stopGameSessionPlacement_placementId :: (Text -> f Text)
-> StopGameSessionPlacement -> f StopGameSessionPlacement
stopGameSessionPlacement_placementId = (StopGameSessionPlacement -> Text)
-> (StopGameSessionPlacement -> Text -> StopGameSessionPlacement)
-> Lens StopGameSessionPlacement StopGameSessionPlacement Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopGameSessionPlacement' {Text
placementId :: Text
$sel:placementId:StopGameSessionPlacement' :: StopGameSessionPlacement -> Text
placementId} -> Text
placementId) (\s :: StopGameSessionPlacement
s@StopGameSessionPlacement' {} Text
a -> StopGameSessionPlacement
s {$sel:placementId:StopGameSessionPlacement' :: Text
placementId = Text
a} :: StopGameSessionPlacement)
instance Core.AWSRequest StopGameSessionPlacement where
type
AWSResponse StopGameSessionPlacement =
StopGameSessionPlacementResponse
request :: StopGameSessionPlacement -> Request StopGameSessionPlacement
request = Service
-> StopGameSessionPlacement -> Request StopGameSessionPlacement
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopGameSessionPlacement
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopGameSessionPlacement)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopGameSessionPlacement))
-> Logger
-> Service
-> Proxy StopGameSessionPlacement
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopGameSessionPlacement)))
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 -> StopGameSessionPlacementResponse
StopGameSessionPlacementResponse'
(Maybe GameSessionPlacement
-> Int -> StopGameSessionPlacementResponse)
-> Either String (Maybe GameSessionPlacement)
-> Either String (Int -> StopGameSessionPlacementResponse)
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 -> StopGameSessionPlacementResponse)
-> Either String Int
-> Either String StopGameSessionPlacementResponse
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 StopGameSessionPlacement
instance Prelude.NFData StopGameSessionPlacement
instance Core.ToHeaders StopGameSessionPlacement where
toHeaders :: StopGameSessionPlacement -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopGameSessionPlacement -> 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.StopGameSessionPlacement" ::
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 StopGameSessionPlacement where
toJSON :: StopGameSessionPlacement -> Value
toJSON StopGameSessionPlacement' {Text
placementId :: Text
$sel:placementId:StopGameSessionPlacement' :: StopGameSessionPlacement -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[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)]
)
instance Core.ToPath StopGameSessionPlacement where
toPath :: StopGameSessionPlacement -> ByteString
toPath = ByteString -> StopGameSessionPlacement -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopGameSessionPlacement where
toQuery :: StopGameSessionPlacement -> QueryString
toQuery = QueryString -> StopGameSessionPlacement -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopGameSessionPlacementResponse = StopGameSessionPlacementResponse'
{
StopGameSessionPlacementResponse -> Maybe GameSessionPlacement
gameSessionPlacement :: Prelude.Maybe GameSessionPlacement,
StopGameSessionPlacementResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopGameSessionPlacementResponse
-> StopGameSessionPlacementResponse -> Bool
(StopGameSessionPlacementResponse
-> StopGameSessionPlacementResponse -> Bool)
-> (StopGameSessionPlacementResponse
-> StopGameSessionPlacementResponse -> Bool)
-> Eq StopGameSessionPlacementResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopGameSessionPlacementResponse
-> StopGameSessionPlacementResponse -> Bool
$c/= :: StopGameSessionPlacementResponse
-> StopGameSessionPlacementResponse -> Bool
== :: StopGameSessionPlacementResponse
-> StopGameSessionPlacementResponse -> Bool
$c== :: StopGameSessionPlacementResponse
-> StopGameSessionPlacementResponse -> Bool
Prelude.Eq, ReadPrec [StopGameSessionPlacementResponse]
ReadPrec StopGameSessionPlacementResponse
Int -> ReadS StopGameSessionPlacementResponse
ReadS [StopGameSessionPlacementResponse]
(Int -> ReadS StopGameSessionPlacementResponse)
-> ReadS [StopGameSessionPlacementResponse]
-> ReadPrec StopGameSessionPlacementResponse
-> ReadPrec [StopGameSessionPlacementResponse]
-> Read StopGameSessionPlacementResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopGameSessionPlacementResponse]
$creadListPrec :: ReadPrec [StopGameSessionPlacementResponse]
readPrec :: ReadPrec StopGameSessionPlacementResponse
$creadPrec :: ReadPrec StopGameSessionPlacementResponse
readList :: ReadS [StopGameSessionPlacementResponse]
$creadList :: ReadS [StopGameSessionPlacementResponse]
readsPrec :: Int -> ReadS StopGameSessionPlacementResponse
$creadsPrec :: Int -> ReadS StopGameSessionPlacementResponse
Prelude.Read, Int -> StopGameSessionPlacementResponse -> ShowS
[StopGameSessionPlacementResponse] -> ShowS
StopGameSessionPlacementResponse -> String
(Int -> StopGameSessionPlacementResponse -> ShowS)
-> (StopGameSessionPlacementResponse -> String)
-> ([StopGameSessionPlacementResponse] -> ShowS)
-> Show StopGameSessionPlacementResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopGameSessionPlacementResponse] -> ShowS
$cshowList :: [StopGameSessionPlacementResponse] -> ShowS
show :: StopGameSessionPlacementResponse -> String
$cshow :: StopGameSessionPlacementResponse -> String
showsPrec :: Int -> StopGameSessionPlacementResponse -> ShowS
$cshowsPrec :: Int -> StopGameSessionPlacementResponse -> ShowS
Prelude.Show, (forall x.
StopGameSessionPlacementResponse
-> Rep StopGameSessionPlacementResponse x)
-> (forall x.
Rep StopGameSessionPlacementResponse x
-> StopGameSessionPlacementResponse)
-> Generic StopGameSessionPlacementResponse
forall x.
Rep StopGameSessionPlacementResponse x
-> StopGameSessionPlacementResponse
forall x.
StopGameSessionPlacementResponse
-> Rep StopGameSessionPlacementResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopGameSessionPlacementResponse x
-> StopGameSessionPlacementResponse
$cfrom :: forall x.
StopGameSessionPlacementResponse
-> Rep StopGameSessionPlacementResponse x
Prelude.Generic)
newStopGameSessionPlacementResponse ::
Prelude.Int ->
StopGameSessionPlacementResponse
newStopGameSessionPlacementResponse :: Int -> StopGameSessionPlacementResponse
newStopGameSessionPlacementResponse Int
pHttpStatus_ =
StopGameSessionPlacementResponse' :: Maybe GameSessionPlacement
-> Int -> StopGameSessionPlacementResponse
StopGameSessionPlacementResponse'
{ $sel:gameSessionPlacement:StopGameSessionPlacementResponse' :: Maybe GameSessionPlacement
gameSessionPlacement =
Maybe GameSessionPlacement
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopGameSessionPlacementResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopGameSessionPlacementResponse_gameSessionPlacement :: Lens.Lens' StopGameSessionPlacementResponse (Prelude.Maybe GameSessionPlacement)
stopGameSessionPlacementResponse_gameSessionPlacement :: (Maybe GameSessionPlacement -> f (Maybe GameSessionPlacement))
-> StopGameSessionPlacementResponse
-> f StopGameSessionPlacementResponse
stopGameSessionPlacementResponse_gameSessionPlacement = (StopGameSessionPlacementResponse -> Maybe GameSessionPlacement)
-> (StopGameSessionPlacementResponse
-> Maybe GameSessionPlacement -> StopGameSessionPlacementResponse)
-> Lens
StopGameSessionPlacementResponse
StopGameSessionPlacementResponse
(Maybe GameSessionPlacement)
(Maybe GameSessionPlacement)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopGameSessionPlacementResponse' {Maybe GameSessionPlacement
gameSessionPlacement :: Maybe GameSessionPlacement
$sel:gameSessionPlacement:StopGameSessionPlacementResponse' :: StopGameSessionPlacementResponse -> Maybe GameSessionPlacement
gameSessionPlacement} -> Maybe GameSessionPlacement
gameSessionPlacement) (\s :: StopGameSessionPlacementResponse
s@StopGameSessionPlacementResponse' {} Maybe GameSessionPlacement
a -> StopGameSessionPlacementResponse
s {$sel:gameSessionPlacement:StopGameSessionPlacementResponse' :: Maybe GameSessionPlacement
gameSessionPlacement = Maybe GameSessionPlacement
a} :: StopGameSessionPlacementResponse)
stopGameSessionPlacementResponse_httpStatus :: Lens.Lens' StopGameSessionPlacementResponse Prelude.Int
stopGameSessionPlacementResponse_httpStatus :: (Int -> f Int)
-> StopGameSessionPlacementResponse
-> f StopGameSessionPlacementResponse
stopGameSessionPlacementResponse_httpStatus = (StopGameSessionPlacementResponse -> Int)
-> (StopGameSessionPlacementResponse
-> Int -> StopGameSessionPlacementResponse)
-> Lens
StopGameSessionPlacementResponse
StopGameSessionPlacementResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopGameSessionPlacementResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopGameSessionPlacementResponse' :: StopGameSessionPlacementResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopGameSessionPlacementResponse
s@StopGameSessionPlacementResponse' {} Int
a -> StopGameSessionPlacementResponse
s {$sel:httpStatus:StopGameSessionPlacementResponse' :: Int
httpStatus = Int
a} :: StopGameSessionPlacementResponse)
instance
Prelude.NFData
StopGameSessionPlacementResponse