module Network.AWS.GameLift.UpdateGameSession
(
updateGameSession
, UpdateGameSession
, ugsMaximumPlayerSessionCount
, ugsPlayerSessionCreationPolicy
, ugsName
, ugsProtectionPolicy
, ugsGameSessionId
, updateGameSessionResponse
, UpdateGameSessionResponse
, ugsrsGameSession
, ugsrsResponseStatus
) 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
data UpdateGameSession = UpdateGameSession'
{ _ugsMaximumPlayerSessionCount :: !(Maybe Nat)
, _ugsPlayerSessionCreationPolicy :: !(Maybe PlayerSessionCreationPolicy)
, _ugsName :: !(Maybe Text)
, _ugsProtectionPolicy :: !(Maybe ProtectionPolicy)
, _ugsGameSessionId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateGameSession
:: Text
-> UpdateGameSession
updateGameSession pGameSessionId_ =
UpdateGameSession'
{ _ugsMaximumPlayerSessionCount = Nothing
, _ugsPlayerSessionCreationPolicy = Nothing
, _ugsName = Nothing
, _ugsProtectionPolicy = Nothing
, _ugsGameSessionId = pGameSessionId_
}
ugsMaximumPlayerSessionCount :: Lens' UpdateGameSession (Maybe Natural)
ugsMaximumPlayerSessionCount = lens _ugsMaximumPlayerSessionCount (\ s a -> s{_ugsMaximumPlayerSessionCount = a}) . mapping _Nat;
ugsPlayerSessionCreationPolicy :: Lens' UpdateGameSession (Maybe PlayerSessionCreationPolicy)
ugsPlayerSessionCreationPolicy = lens _ugsPlayerSessionCreationPolicy (\ s a -> s{_ugsPlayerSessionCreationPolicy = a});
ugsName :: Lens' UpdateGameSession (Maybe Text)
ugsName = lens _ugsName (\ s a -> s{_ugsName = a});
ugsProtectionPolicy :: Lens' UpdateGameSession (Maybe ProtectionPolicy)
ugsProtectionPolicy = lens _ugsProtectionPolicy (\ s a -> s{_ugsProtectionPolicy = a});
ugsGameSessionId :: Lens' UpdateGameSession Text
ugsGameSessionId = lens _ugsGameSessionId (\ s a -> s{_ugsGameSessionId = a});
instance AWSRequest UpdateGameSession where
type Rs UpdateGameSession = UpdateGameSessionResponse
request = postJSON gameLift
response
= receiveJSON
(\ s h x ->
UpdateGameSessionResponse' <$>
(x .?> "GameSession") <*> (pure (fromEnum s)))
instance Hashable UpdateGameSession
instance NFData UpdateGameSession
instance ToHeaders UpdateGameSession where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.UpdateGameSession" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateGameSession where
toJSON UpdateGameSession'{..}
= object
(catMaybes
[("MaximumPlayerSessionCount" .=) <$>
_ugsMaximumPlayerSessionCount,
("PlayerSessionCreationPolicy" .=) <$>
_ugsPlayerSessionCreationPolicy,
("Name" .=) <$> _ugsName,
("ProtectionPolicy" .=) <$> _ugsProtectionPolicy,
Just ("GameSessionId" .= _ugsGameSessionId)])
instance ToPath UpdateGameSession where
toPath = const "/"
instance ToQuery UpdateGameSession where
toQuery = const mempty
data UpdateGameSessionResponse = UpdateGameSessionResponse'
{ _ugsrsGameSession :: !(Maybe GameSession)
, _ugsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateGameSessionResponse
:: Int
-> UpdateGameSessionResponse
updateGameSessionResponse pResponseStatus_ =
UpdateGameSessionResponse'
{ _ugsrsGameSession = Nothing
, _ugsrsResponseStatus = pResponseStatus_
}
ugsrsGameSession :: Lens' UpdateGameSessionResponse (Maybe GameSession)
ugsrsGameSession = lens _ugsrsGameSession (\ s a -> s{_ugsrsGameSession = a});
ugsrsResponseStatus :: Lens' UpdateGameSessionResponse Int
ugsrsResponseStatus = lens _ugsrsResponseStatus (\ s a -> s{_ugsrsResponseStatus = a});
instance NFData UpdateGameSessionResponse