{-# 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.Shield.DeleteProtection
(
deleteProtection
, DeleteProtection
, dProtectionId
, deleteProtectionResponse
, DeleteProtectionResponse
, delrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Shield.Types
import Network.AWS.Shield.Types.Product
newtype DeleteProtection = DeleteProtection'
{ _dProtectionId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteProtection
:: Text
-> DeleteProtection
deleteProtection pProtectionId_ =
DeleteProtection' {_dProtectionId = pProtectionId_}
dProtectionId :: Lens' DeleteProtection Text
dProtectionId = lens _dProtectionId (\ s a -> s{_dProtectionId = a})
instance AWSRequest DeleteProtection where
type Rs DeleteProtection = DeleteProtectionResponse
request = postJSON shield
response
= receiveEmpty
(\ s h x ->
DeleteProtectionResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteProtection where
instance NFData DeleteProtection where
instance ToHeaders DeleteProtection where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSShield_20160616.DeleteProtection" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteProtection where
toJSON DeleteProtection'{..}
= object
(catMaybes [Just ("ProtectionId" .= _dProtectionId)])
instance ToPath DeleteProtection where
toPath = const "/"
instance ToQuery DeleteProtection where
toQuery = const mempty
newtype DeleteProtectionResponse = DeleteProtectionResponse'
{ _delrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteProtectionResponse
:: Int
-> DeleteProtectionResponse
deleteProtectionResponse pResponseStatus_ =
DeleteProtectionResponse' {_delrsResponseStatus = pResponseStatus_}
delrsResponseStatus :: Lens' DeleteProtectionResponse Int
delrsResponseStatus = lens _delrsResponseStatus (\ s a -> s{_delrsResponseStatus = a})
instance NFData DeleteProtectionResponse where