{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.GameLift.StopGameSessionPlacement
(
stopGameSessionPlacement
, StopGameSessionPlacement
, sPlacementId
, stopGameSessionPlacementResponse
, StopGameSessionPlacementResponse
, storsGameSessionPlacement
, storsResponseStatus
) where
import Network.AWS.GameLift.Types
import Network.AWS.GameLift.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype StopGameSessionPlacement = StopGameSessionPlacement'
{ _sPlacementId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopGameSessionPlacement
:: Text
-> StopGameSessionPlacement
stopGameSessionPlacement pPlacementId_ =
StopGameSessionPlacement' {_sPlacementId = pPlacementId_}
sPlacementId :: Lens' StopGameSessionPlacement Text
sPlacementId = lens _sPlacementId (\ s a -> s{_sPlacementId = a})
instance AWSRequest StopGameSessionPlacement where
type Rs StopGameSessionPlacement =
StopGameSessionPlacementResponse
request = postJSON gameLift
response
= receiveJSON
(\ s h x ->
StopGameSessionPlacementResponse' <$>
(x .?> "GameSessionPlacement") <*>
(pure (fromEnum s)))
instance Hashable StopGameSessionPlacement where
instance NFData StopGameSessionPlacement where
instance ToHeaders StopGameSessionPlacement where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.StopGameSessionPlacement" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StopGameSessionPlacement where
toJSON StopGameSessionPlacement'{..}
= object
(catMaybes [Just ("PlacementId" .= _sPlacementId)])
instance ToPath StopGameSessionPlacement where
toPath = const "/"
instance ToQuery StopGameSessionPlacement where
toQuery = const mempty
data StopGameSessionPlacementResponse = StopGameSessionPlacementResponse'
{ _storsGameSessionPlacement :: !(Maybe GameSessionPlacement)
, _storsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
stopGameSessionPlacementResponse
:: Int
-> StopGameSessionPlacementResponse
stopGameSessionPlacementResponse pResponseStatus_ =
StopGameSessionPlacementResponse'
{ _storsGameSessionPlacement = Nothing
, _storsResponseStatus = pResponseStatus_
}
storsGameSessionPlacement :: Lens' StopGameSessionPlacementResponse (Maybe GameSessionPlacement)
storsGameSessionPlacement = lens _storsGameSessionPlacement (\ s a -> s{_storsGameSessionPlacement = a})
storsResponseStatus :: Lens' StopGameSessionPlacementResponse Int
storsResponseStatus = lens _storsResponseStatus (\ s a -> s{_storsResponseStatus = a})
instance NFData StopGameSessionPlacementResponse
where