{-# 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.RegisterWebhookWithThirdParty
(
registerWebhookWithThirdParty
, RegisterWebhookWithThirdParty
, rwwtpWebhookName
, registerWebhookWithThirdPartyResponse
, RegisterWebhookWithThirdPartyResponse
, rwwtprsResponseStatus
) 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 RegisterWebhookWithThirdParty = RegisterWebhookWithThirdParty'
{ _rwwtpWebhookName :: Maybe Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
registerWebhookWithThirdParty
:: RegisterWebhookWithThirdParty
registerWebhookWithThirdParty =
RegisterWebhookWithThirdParty' {_rwwtpWebhookName = Nothing}
rwwtpWebhookName :: Lens' RegisterWebhookWithThirdParty (Maybe Text)
rwwtpWebhookName = lens _rwwtpWebhookName (\ s a -> s{_rwwtpWebhookName = a})
instance AWSRequest RegisterWebhookWithThirdParty
where
type Rs RegisterWebhookWithThirdParty =
RegisterWebhookWithThirdPartyResponse
request = postJSON codePipeline
response
= receiveEmpty
(\ s h x ->
RegisterWebhookWithThirdPartyResponse' <$>
(pure (fromEnum s)))
instance Hashable RegisterWebhookWithThirdParty where
instance NFData RegisterWebhookWithThirdParty where
instance ToHeaders RegisterWebhookWithThirdParty
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodePipeline_20150709.RegisterWebhookWithThirdParty"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RegisterWebhookWithThirdParty where
toJSON RegisterWebhookWithThirdParty'{..}
= object
(catMaybes
[("webhookName" .=) <$> _rwwtpWebhookName])
instance ToPath RegisterWebhookWithThirdParty where
toPath = const "/"
instance ToQuery RegisterWebhookWithThirdParty where
toQuery = const mempty
newtype RegisterWebhookWithThirdPartyResponse = RegisterWebhookWithThirdPartyResponse'
{ _rwwtprsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
registerWebhookWithThirdPartyResponse
:: Int
-> RegisterWebhookWithThirdPartyResponse
registerWebhookWithThirdPartyResponse pResponseStatus_ =
RegisterWebhookWithThirdPartyResponse'
{_rwwtprsResponseStatus = pResponseStatus_}
rwwtprsResponseStatus :: Lens' RegisterWebhookWithThirdPartyResponse Int
rwwtprsResponseStatus = lens _rwwtprsResponseStatus (\ s a -> s{_rwwtprsResponseStatus = a})
instance NFData RegisterWebhookWithThirdPartyResponse
where