module Network.AWS.CloudFormation.UpdateTerminationProtection
(
updateTerminationProtection
, UpdateTerminationProtection
, utpEnableTerminationProtection
, utpStackName
, updateTerminationProtectionResponse
, UpdateTerminationProtectionResponse
, utprsStackId
, utprsResponseStatus
) where
import Network.AWS.CloudFormation.Types
import Network.AWS.CloudFormation.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateTerminationProtection = UpdateTerminationProtection'
{ _utpEnableTerminationProtection :: !Bool
, _utpStackName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateTerminationProtection
:: Bool
-> Text
-> UpdateTerminationProtection
updateTerminationProtection pEnableTerminationProtection_ pStackName_ =
UpdateTerminationProtection'
{ _utpEnableTerminationProtection = pEnableTerminationProtection_
, _utpStackName = pStackName_
}
utpEnableTerminationProtection :: Lens' UpdateTerminationProtection Bool
utpEnableTerminationProtection = lens _utpEnableTerminationProtection (\ s a -> s{_utpEnableTerminationProtection = a});
utpStackName :: Lens' UpdateTerminationProtection Text
utpStackName = lens _utpStackName (\ s a -> s{_utpStackName = a});
instance AWSRequest UpdateTerminationProtection where
type Rs UpdateTerminationProtection =
UpdateTerminationProtectionResponse
request = postQuery cloudFormation
response
= receiveXMLWrapper
"UpdateTerminationProtectionResult"
(\ s h x ->
UpdateTerminationProtectionResponse' <$>
(x .@? "StackId") <*> (pure (fromEnum s)))
instance Hashable UpdateTerminationProtection where
instance NFData UpdateTerminationProtection where
instance ToHeaders UpdateTerminationProtection where
toHeaders = const mempty
instance ToPath UpdateTerminationProtection where
toPath = const "/"
instance ToQuery UpdateTerminationProtection where
toQuery UpdateTerminationProtection'{..}
= mconcat
["Action" =:
("UpdateTerminationProtection" :: ByteString),
"Version" =: ("2010-05-15" :: ByteString),
"EnableTerminationProtection" =:
_utpEnableTerminationProtection,
"StackName" =: _utpStackName]
data UpdateTerminationProtectionResponse = UpdateTerminationProtectionResponse'
{ _utprsStackId :: !(Maybe Text)
, _utprsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateTerminationProtectionResponse
:: Int
-> UpdateTerminationProtectionResponse
updateTerminationProtectionResponse pResponseStatus_ =
UpdateTerminationProtectionResponse'
{_utprsStackId = Nothing, _utprsResponseStatus = pResponseStatus_}
utprsStackId :: Lens' UpdateTerminationProtectionResponse (Maybe Text)
utprsStackId = lens _utprsStackId (\ s a -> s{_utprsStackId = a});
utprsResponseStatus :: Lens' UpdateTerminationProtectionResponse Int
utprsResponseStatus = lens _utprsResponseStatus (\ s a -> s{_utprsResponseStatus = a});
instance NFData UpdateTerminationProtectionResponse
where