{-# 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.CodeBuild.DeleteWebhook
(
deleteWebhook
, DeleteWebhook
, dwProjectName
, deleteWebhookResponse
, DeleteWebhookResponse
, dwrsResponseStatus
) where
import Network.AWS.CodeBuild.Types
import Network.AWS.CodeBuild.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteWebhook = DeleteWebhook'
{ _dwProjectName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteWebhook
:: Text
-> DeleteWebhook
deleteWebhook pProjectName_ = DeleteWebhook' {_dwProjectName = pProjectName_}
dwProjectName :: Lens' DeleteWebhook Text
dwProjectName = lens _dwProjectName (\ s a -> s{_dwProjectName = a})
instance AWSRequest DeleteWebhook where
type Rs DeleteWebhook = DeleteWebhookResponse
request = postJSON codeBuild
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" =#
("CodeBuild_20161006.DeleteWebhook" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteWebhook where
toJSON DeleteWebhook'{..}
= object
(catMaybes [Just ("projectName" .= _dwProjectName)])
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