{-# 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.ValidateMatchmakingRuleSet
(
validateMatchmakingRuleSet
, ValidateMatchmakingRuleSet
, vmrsRuleSetBody
, validateMatchmakingRuleSetResponse
, ValidateMatchmakingRuleSetResponse
, vmrsrsValid
, vmrsrsResponseStatus
) 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 ValidateMatchmakingRuleSet = ValidateMatchmakingRuleSet'
{ _vmrsRuleSetBody :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
validateMatchmakingRuleSet
:: Text
-> ValidateMatchmakingRuleSet
validateMatchmakingRuleSet pRuleSetBody_ =
ValidateMatchmakingRuleSet' {_vmrsRuleSetBody = pRuleSetBody_}
vmrsRuleSetBody :: Lens' ValidateMatchmakingRuleSet Text
vmrsRuleSetBody = lens _vmrsRuleSetBody (\ s a -> s{_vmrsRuleSetBody = a})
instance AWSRequest ValidateMatchmakingRuleSet where
type Rs ValidateMatchmakingRuleSet =
ValidateMatchmakingRuleSetResponse
request = postJSON gameLift
response
= receiveJSON
(\ s h x ->
ValidateMatchmakingRuleSetResponse' <$>
(x .?> "Valid") <*> (pure (fromEnum s)))
instance Hashable ValidateMatchmakingRuleSet where
instance NFData ValidateMatchmakingRuleSet where
instance ToHeaders ValidateMatchmakingRuleSet where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("GameLift.ValidateMatchmakingRuleSet" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ValidateMatchmakingRuleSet where
toJSON ValidateMatchmakingRuleSet'{..}
= object
(catMaybes
[Just ("RuleSetBody" .= _vmrsRuleSetBody)])
instance ToPath ValidateMatchmakingRuleSet where
toPath = const "/"
instance ToQuery ValidateMatchmakingRuleSet where
toQuery = const mempty
data ValidateMatchmakingRuleSetResponse = ValidateMatchmakingRuleSetResponse'
{ _vmrsrsValid :: !(Maybe Bool)
, _vmrsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
validateMatchmakingRuleSetResponse
:: Int
-> ValidateMatchmakingRuleSetResponse
validateMatchmakingRuleSetResponse pResponseStatus_ =
ValidateMatchmakingRuleSetResponse'
{_vmrsrsValid = Nothing, _vmrsrsResponseStatus = pResponseStatus_}
vmrsrsValid :: Lens' ValidateMatchmakingRuleSetResponse (Maybe Bool)
vmrsrsValid = lens _vmrsrsValid (\ s a -> s{_vmrsrsValid = a})
vmrsrsResponseStatus :: Lens' ValidateMatchmakingRuleSetResponse Int
vmrsrsResponseStatus = lens _vmrsrsResponseStatus (\ s a -> s{_vmrsrsResponseStatus = a})
instance NFData ValidateMatchmakingRuleSetResponse
where