{-# 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.PostCommentReply
(
postCommentReply
, PostCommentReply
, pcrClientRequestToken
, pcrInReplyTo
, pcrContent
, postCommentReplyResponse
, PostCommentReplyResponse
, pcrrsComment
, pcrrsResponseStatus
) 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 PostCommentReply = PostCommentReply'
{ _pcrClientRequestToken :: !(Maybe Text)
, _pcrInReplyTo :: !Text
, _pcrContent :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
postCommentReply
:: Text
-> Text
-> PostCommentReply
postCommentReply pInReplyTo_ pContent_ =
PostCommentReply'
{ _pcrClientRequestToken = Nothing
, _pcrInReplyTo = pInReplyTo_
, _pcrContent = pContent_
}
pcrClientRequestToken :: Lens' PostCommentReply (Maybe Text)
pcrClientRequestToken = lens _pcrClientRequestToken (\ s a -> s{_pcrClientRequestToken = a})
pcrInReplyTo :: Lens' PostCommentReply Text
pcrInReplyTo = lens _pcrInReplyTo (\ s a -> s{_pcrInReplyTo = a})
pcrContent :: Lens' PostCommentReply Text
pcrContent = lens _pcrContent (\ s a -> s{_pcrContent = a})
instance AWSRequest PostCommentReply where
type Rs PostCommentReply = PostCommentReplyResponse
request = postJSON codeCommit
response
= receiveJSON
(\ s h x ->
PostCommentReplyResponse' <$>
(x .?> "comment") <*> (pure (fromEnum s)))
instance Hashable PostCommentReply where
instance NFData PostCommentReply where
instance ToHeaders PostCommentReply where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeCommit_20150413.PostCommentReply" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON PostCommentReply where
toJSON PostCommentReply'{..}
= object
(catMaybes
[("clientRequestToken" .=) <$>
_pcrClientRequestToken,
Just ("inReplyTo" .= _pcrInReplyTo),
Just ("content" .= _pcrContent)])
instance ToPath PostCommentReply where
toPath = const "/"
instance ToQuery PostCommentReply where
toQuery = const mempty
data PostCommentReplyResponse = PostCommentReplyResponse'
{ _pcrrsComment :: !(Maybe Comment)
, _pcrrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
postCommentReplyResponse
:: Int
-> PostCommentReplyResponse
postCommentReplyResponse pResponseStatus_ =
PostCommentReplyResponse'
{_pcrrsComment = Nothing, _pcrrsResponseStatus = pResponseStatus_}
pcrrsComment :: Lens' PostCommentReplyResponse (Maybe Comment)
pcrrsComment = lens _pcrrsComment (\ s a -> s{_pcrrsComment = a})
pcrrsResponseStatus :: Lens' PostCommentReplyResponse Int
pcrrsResponseStatus = lens _pcrrsResponseStatus (\ s a -> s{_pcrrsResponseStatus = a})
instance NFData PostCommentReplyResponse where