{-# 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.AcknowledgeThirdPartyJob
(
acknowledgeThirdPartyJob
, AcknowledgeThirdPartyJob
, atpjJobId
, atpjNonce
, atpjClientToken
, acknowledgeThirdPartyJobResponse
, AcknowledgeThirdPartyJobResponse
, atpjrsStatus
, atpjrsResponseStatus
) 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
data AcknowledgeThirdPartyJob = AcknowledgeThirdPartyJob'
{ _atpjJobId :: !Text
, _atpjNonce :: !Text
, _atpjClientToken :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
acknowledgeThirdPartyJob
:: Text
-> Text
-> Text
-> AcknowledgeThirdPartyJob
acknowledgeThirdPartyJob pJobId_ pNonce_ pClientToken_ =
AcknowledgeThirdPartyJob'
{ _atpjJobId = pJobId_
, _atpjNonce = pNonce_
, _atpjClientToken = pClientToken_
}
atpjJobId :: Lens' AcknowledgeThirdPartyJob Text
atpjJobId = lens _atpjJobId (\ s a -> s{_atpjJobId = a})
atpjNonce :: Lens' AcknowledgeThirdPartyJob Text
atpjNonce = lens _atpjNonce (\ s a -> s{_atpjNonce = a})
atpjClientToken :: Lens' AcknowledgeThirdPartyJob Text
atpjClientToken = lens _atpjClientToken (\ s a -> s{_atpjClientToken = a})
instance AWSRequest AcknowledgeThirdPartyJob where
type Rs AcknowledgeThirdPartyJob =
AcknowledgeThirdPartyJobResponse
request = postJSON codePipeline
response
= receiveJSON
(\ s h x ->
AcknowledgeThirdPartyJobResponse' <$>
(x .?> "status") <*> (pure (fromEnum s)))
instance Hashable AcknowledgeThirdPartyJob where
instance NFData AcknowledgeThirdPartyJob where
instance ToHeaders AcknowledgeThirdPartyJob where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodePipeline_20150709.AcknowledgeThirdPartyJob" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AcknowledgeThirdPartyJob where
toJSON AcknowledgeThirdPartyJob'{..}
= object
(catMaybes
[Just ("jobId" .= _atpjJobId),
Just ("nonce" .= _atpjNonce),
Just ("clientToken" .= _atpjClientToken)])
instance ToPath AcknowledgeThirdPartyJob where
toPath = const "/"
instance ToQuery AcknowledgeThirdPartyJob where
toQuery = const mempty
data AcknowledgeThirdPartyJobResponse = AcknowledgeThirdPartyJobResponse'
{ _atpjrsStatus :: !(Maybe JobStatus)
, _atpjrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
acknowledgeThirdPartyJobResponse
:: Int
-> AcknowledgeThirdPartyJobResponse
acknowledgeThirdPartyJobResponse pResponseStatus_ =
AcknowledgeThirdPartyJobResponse'
{_atpjrsStatus = Nothing, _atpjrsResponseStatus = pResponseStatus_}
atpjrsStatus :: Lens' AcknowledgeThirdPartyJobResponse (Maybe JobStatus)
atpjrsStatus = lens _atpjrsStatus (\ s a -> s{_atpjrsStatus = a})
atpjrsResponseStatus :: Lens' AcknowledgeThirdPartyJobResponse Int
atpjrsResponseStatus = lens _atpjrsResponseStatus (\ s a -> s{_atpjrsResponseStatus = a})
instance NFData AcknowledgeThirdPartyJobResponse
where