{-# 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.CodeCommit.UpdatePullRequestDescription
(
updatePullRequestDescription
, UpdatePullRequestDescription
, uprdPullRequestId
, uprdDescription
, updatePullRequestDescriptionResponse
, UpdatePullRequestDescriptionResponse
, uprdrsResponseStatus
, uprdrsPullRequest
) where
import Network.AWS.CodeCommit.Types
import Network.AWS.CodeCommit.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdatePullRequestDescription = UpdatePullRequestDescription'
{ _uprdPullRequestId :: !Text
, _uprdDescription :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updatePullRequestDescription
:: Text
-> Text
-> UpdatePullRequestDescription
updatePullRequestDescription pPullRequestId_ pDescription_ =
UpdatePullRequestDescription'
{_uprdPullRequestId = pPullRequestId_, _uprdDescription = pDescription_}
uprdPullRequestId :: Lens' UpdatePullRequestDescription Text
uprdPullRequestId = lens _uprdPullRequestId (\ s a -> s{_uprdPullRequestId = a})
uprdDescription :: Lens' UpdatePullRequestDescription Text
uprdDescription = lens _uprdDescription (\ s a -> s{_uprdDescription = a})
instance AWSRequest UpdatePullRequestDescription
where
type Rs UpdatePullRequestDescription =
UpdatePullRequestDescriptionResponse
request = postJSON codeCommit
response
= receiveJSON
(\ s h x ->
UpdatePullRequestDescriptionResponse' <$>
(pure (fromEnum s)) <*> (x .:> "pullRequest"))
instance Hashable UpdatePullRequestDescription where
instance NFData UpdatePullRequestDescription where
instance ToHeaders UpdatePullRequestDescription where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeCommit_20150413.UpdatePullRequestDescription"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdatePullRequestDescription where
toJSON UpdatePullRequestDescription'{..}
= object
(catMaybes
[Just ("pullRequestId" .= _uprdPullRequestId),
Just ("description" .= _uprdDescription)])
instance ToPath UpdatePullRequestDescription where
toPath = const "/"
instance ToQuery UpdatePullRequestDescription where
toQuery = const mempty
data UpdatePullRequestDescriptionResponse = UpdatePullRequestDescriptionResponse'
{ _uprdrsResponseStatus :: !Int
, _uprdrsPullRequest :: !PullRequest
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updatePullRequestDescriptionResponse
:: Int
-> PullRequest
-> UpdatePullRequestDescriptionResponse
updatePullRequestDescriptionResponse pResponseStatus_ pPullRequest_ =
UpdatePullRequestDescriptionResponse'
{ _uprdrsResponseStatus = pResponseStatus_
, _uprdrsPullRequest = pPullRequest_
}
uprdrsResponseStatus :: Lens' UpdatePullRequestDescriptionResponse Int
uprdrsResponseStatus = lens _uprdrsResponseStatus (\ s a -> s{_uprdrsResponseStatus = a})
uprdrsPullRequest :: Lens' UpdatePullRequestDescriptionResponse PullRequest
uprdrsPullRequest = lens _uprdrsPullRequest (\ s a -> s{_uprdrsPullRequest = a})
instance NFData UpdatePullRequestDescriptionResponse
where