{-# 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.PostCommentForComparedCommit
(
postCommentForComparedCommit
, PostCommentForComparedCommit
, pcfccLocation
, pcfccBeforeCommitId
, pcfccClientRequestToken
, pcfccRepositoryName
, pcfccAfterCommitId
, pcfccContent
, postCommentForComparedCommitResponse
, PostCommentForComparedCommitResponse
, pcfccrsBeforeBlobId
, pcfccrsLocation
, pcfccrsAfterCommitId
, pcfccrsAfterBlobId
, pcfccrsBeforeCommitId
, pcfccrsRepositoryName
, pcfccrsComment
, pcfccrsResponseStatus
) 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 PostCommentForComparedCommit = PostCommentForComparedCommit'
{ _pcfccLocation :: !(Maybe Location)
, _pcfccBeforeCommitId :: !(Maybe Text)
, _pcfccClientRequestToken :: !(Maybe Text)
, _pcfccRepositoryName :: !Text
, _pcfccAfterCommitId :: !Text
, _pcfccContent :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
postCommentForComparedCommit
:: Text
-> Text
-> Text
-> PostCommentForComparedCommit
postCommentForComparedCommit pRepositoryName_ pAfterCommitId_ pContent_ =
PostCommentForComparedCommit'
{ _pcfccLocation = Nothing
, _pcfccBeforeCommitId = Nothing
, _pcfccClientRequestToken = Nothing
, _pcfccRepositoryName = pRepositoryName_
, _pcfccAfterCommitId = pAfterCommitId_
, _pcfccContent = pContent_
}
pcfccLocation :: Lens' PostCommentForComparedCommit (Maybe Location)
pcfccLocation = lens _pcfccLocation (\ s a -> s{_pcfccLocation = a})
pcfccBeforeCommitId :: Lens' PostCommentForComparedCommit (Maybe Text)
pcfccBeforeCommitId = lens _pcfccBeforeCommitId (\ s a -> s{_pcfccBeforeCommitId = a})
pcfccClientRequestToken :: Lens' PostCommentForComparedCommit (Maybe Text)
pcfccClientRequestToken = lens _pcfccClientRequestToken (\ s a -> s{_pcfccClientRequestToken = a})
pcfccRepositoryName :: Lens' PostCommentForComparedCommit Text
pcfccRepositoryName = lens _pcfccRepositoryName (\ s a -> s{_pcfccRepositoryName = a})
pcfccAfterCommitId :: Lens' PostCommentForComparedCommit Text
pcfccAfterCommitId = lens _pcfccAfterCommitId (\ s a -> s{_pcfccAfterCommitId = a})
pcfccContent :: Lens' PostCommentForComparedCommit Text
pcfccContent = lens _pcfccContent (\ s a -> s{_pcfccContent = a})
instance AWSRequest PostCommentForComparedCommit
where
type Rs PostCommentForComparedCommit =
PostCommentForComparedCommitResponse
request = postJSON codeCommit
response
= receiveJSON
(\ s h x ->
PostCommentForComparedCommitResponse' <$>
(x .?> "beforeBlobId") <*> (x .?> "location") <*>
(x .?> "afterCommitId")
<*> (x .?> "afterBlobId")
<*> (x .?> "beforeCommitId")
<*> (x .?> "repositoryName")
<*> (x .?> "comment")
<*> (pure (fromEnum s)))
instance Hashable PostCommentForComparedCommit where
instance NFData PostCommentForComparedCommit where
instance ToHeaders PostCommentForComparedCommit where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeCommit_20150413.PostCommentForComparedCommit"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON PostCommentForComparedCommit where
toJSON PostCommentForComparedCommit'{..}
= object
(catMaybes
[("location" .=) <$> _pcfccLocation,
("beforeCommitId" .=) <$> _pcfccBeforeCommitId,
("clientRequestToken" .=) <$>
_pcfccClientRequestToken,
Just ("repositoryName" .= _pcfccRepositoryName),
Just ("afterCommitId" .= _pcfccAfterCommitId),
Just ("content" .= _pcfccContent)])
instance ToPath PostCommentForComparedCommit where
toPath = const "/"
instance ToQuery PostCommentForComparedCommit where
toQuery = const mempty
data PostCommentForComparedCommitResponse = PostCommentForComparedCommitResponse'
{ _pcfccrsBeforeBlobId :: !(Maybe Text)
, _pcfccrsLocation :: !(Maybe Location)
, _pcfccrsAfterCommitId :: !(Maybe Text)
, _pcfccrsAfterBlobId :: !(Maybe Text)
, _pcfccrsBeforeCommitId :: !(Maybe Text)
, _pcfccrsRepositoryName :: !(Maybe Text)
, _pcfccrsComment :: !(Maybe Comment)
, _pcfccrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
postCommentForComparedCommitResponse
:: Int
-> PostCommentForComparedCommitResponse
postCommentForComparedCommitResponse pResponseStatus_ =
PostCommentForComparedCommitResponse'
{ _pcfccrsBeforeBlobId = Nothing
, _pcfccrsLocation = Nothing
, _pcfccrsAfterCommitId = Nothing
, _pcfccrsAfterBlobId = Nothing
, _pcfccrsBeforeCommitId = Nothing
, _pcfccrsRepositoryName = Nothing
, _pcfccrsComment = Nothing
, _pcfccrsResponseStatus = pResponseStatus_
}
pcfccrsBeforeBlobId :: Lens' PostCommentForComparedCommitResponse (Maybe Text)
pcfccrsBeforeBlobId = lens _pcfccrsBeforeBlobId (\ s a -> s{_pcfccrsBeforeBlobId = a})
pcfccrsLocation :: Lens' PostCommentForComparedCommitResponse (Maybe Location)
pcfccrsLocation = lens _pcfccrsLocation (\ s a -> s{_pcfccrsLocation = a})
pcfccrsAfterCommitId :: Lens' PostCommentForComparedCommitResponse (Maybe Text)
pcfccrsAfterCommitId = lens _pcfccrsAfterCommitId (\ s a -> s{_pcfccrsAfterCommitId = a})
pcfccrsAfterBlobId :: Lens' PostCommentForComparedCommitResponse (Maybe Text)
pcfccrsAfterBlobId = lens _pcfccrsAfterBlobId (\ s a -> s{_pcfccrsAfterBlobId = a})
pcfccrsBeforeCommitId :: Lens' PostCommentForComparedCommitResponse (Maybe Text)
pcfccrsBeforeCommitId = lens _pcfccrsBeforeCommitId (\ s a -> s{_pcfccrsBeforeCommitId = a})
pcfccrsRepositoryName :: Lens' PostCommentForComparedCommitResponse (Maybe Text)
pcfccrsRepositoryName = lens _pcfccrsRepositoryName (\ s a -> s{_pcfccrsRepositoryName = a})
pcfccrsComment :: Lens' PostCommentForComparedCommitResponse (Maybe Comment)
pcfccrsComment = lens _pcfccrsComment (\ s a -> s{_pcfccrsComment = a})
pcfccrsResponseStatus :: Lens' PostCommentForComparedCommitResponse Int
pcfccrsResponseStatus = lens _pcfccrsResponseStatus (\ s a -> s{_pcfccrsResponseStatus = a})
instance NFData PostCommentForComparedCommitResponse
where