{-# 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.MergePullRequestByFastForward
(
mergePullRequestByFastForward
, MergePullRequestByFastForward
, mprbffSourceCommitId
, mprbffPullRequestId
, mprbffRepositoryName
, mergePullRequestByFastForwardResponse
, MergePullRequestByFastForwardResponse
, mprbffrsPullRequest
, mprbffrsResponseStatus
) 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 MergePullRequestByFastForward = MergePullRequestByFastForward'
{ _mprbffSourceCommitId :: !(Maybe Text)
, _mprbffPullRequestId :: !Text
, _mprbffRepositoryName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
mergePullRequestByFastForward
:: Text
-> Text
-> MergePullRequestByFastForward
mergePullRequestByFastForward pPullRequestId_ pRepositoryName_ =
MergePullRequestByFastForward'
{ _mprbffSourceCommitId = Nothing
, _mprbffPullRequestId = pPullRequestId_
, _mprbffRepositoryName = pRepositoryName_
}
mprbffSourceCommitId :: Lens' MergePullRequestByFastForward (Maybe Text)
mprbffSourceCommitId = lens _mprbffSourceCommitId (\ s a -> s{_mprbffSourceCommitId = a})
mprbffPullRequestId :: Lens' MergePullRequestByFastForward Text
mprbffPullRequestId = lens _mprbffPullRequestId (\ s a -> s{_mprbffPullRequestId = a})
mprbffRepositoryName :: Lens' MergePullRequestByFastForward Text
mprbffRepositoryName = lens _mprbffRepositoryName (\ s a -> s{_mprbffRepositoryName = a})
instance AWSRequest MergePullRequestByFastForward
where
type Rs MergePullRequestByFastForward =
MergePullRequestByFastForwardResponse
request = postJSON codeCommit
response
= receiveJSON
(\ s h x ->
MergePullRequestByFastForwardResponse' <$>
(x .?> "pullRequest") <*> (pure (fromEnum s)))
instance Hashable MergePullRequestByFastForward where
instance NFData MergePullRequestByFastForward where
instance ToHeaders MergePullRequestByFastForward
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeCommit_20150413.MergePullRequestByFastForward"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON MergePullRequestByFastForward where
toJSON MergePullRequestByFastForward'{..}
= object
(catMaybes
[("sourceCommitId" .=) <$> _mprbffSourceCommitId,
Just ("pullRequestId" .= _mprbffPullRequestId),
Just ("repositoryName" .= _mprbffRepositoryName)])
instance ToPath MergePullRequestByFastForward where
toPath = const "/"
instance ToQuery MergePullRequestByFastForward where
toQuery = const mempty
data MergePullRequestByFastForwardResponse = MergePullRequestByFastForwardResponse'
{ _mprbffrsPullRequest :: !(Maybe PullRequest)
, _mprbffrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
mergePullRequestByFastForwardResponse
:: Int
-> MergePullRequestByFastForwardResponse
mergePullRequestByFastForwardResponse pResponseStatus_ =
MergePullRequestByFastForwardResponse'
{_mprbffrsPullRequest = Nothing, _mprbffrsResponseStatus = pResponseStatus_}
mprbffrsPullRequest :: Lens' MergePullRequestByFastForwardResponse (Maybe PullRequest)
mprbffrsPullRequest = lens _mprbffrsPullRequest (\ s a -> s{_mprbffrsPullRequest = a})
mprbffrsResponseStatus :: Lens' MergePullRequestByFastForwardResponse Int
mprbffrsResponseStatus = lens _mprbffrsResponseStatus (\ s a -> s{_mprbffrsResponseStatus = a})
instance NFData MergePullRequestByFastForwardResponse
where