{-# 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.CodePipeline.DeleteWebhook
(
deleteWebhook
, DeleteWebhook
, dwName
, deleteWebhookResponse
, DeleteWebhookResponse
, dwrsResponseStatus
) where
import Network.AWS.CodePipeline.Types
import Network.AWS.CodePipeline.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteWebhook = DeleteWebhook'
{ _dwName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteWebhook
:: Text
-> DeleteWebhook
deleteWebhook pName_ = DeleteWebhook' {_dwName = pName_}
dwName :: Lens' DeleteWebhook Text
dwName = lens _dwName (\ s a -> s{_dwName = a})
instance AWSRequest DeleteWebhook where
type Rs DeleteWebhook = DeleteWebhookResponse
request = postJSON codePipeline
response
= receiveEmpty
(\ s h x ->
DeleteWebhookResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteWebhook where
instance NFData DeleteWebhook where
instance ToHeaders DeleteWebhook where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodePipeline_20150709.DeleteWebhook" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteWebhook where
toJSON DeleteWebhook'{..}
= object (catMaybes [Just ("name" .= _dwName)])
instance ToPath DeleteWebhook where
toPath = const "/"
instance ToQuery DeleteWebhook where
toQuery = const mempty
newtype DeleteWebhookResponse = DeleteWebhookResponse'
{ _dwrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteWebhookResponse
:: Int
-> DeleteWebhookResponse
deleteWebhookResponse pResponseStatus_ =
DeleteWebhookResponse' {_dwrsResponseStatus = pResponseStatus_}
dwrsResponseStatus :: Lens' DeleteWebhookResponse Int
dwrsResponseStatus = lens _dwrsResponseStatus (\ s a -> s{_dwrsResponseStatus = a})
instance NFData DeleteWebhookResponse where