{-# 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.DeleteCommentContent
(
deleteCommentContent
, DeleteCommentContent
, dccCommentId
, deleteCommentContentResponse
, DeleteCommentContentResponse
, dccrsComment
, dccrsResponseStatus
) 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
newtype DeleteCommentContent = DeleteCommentContent'
{ _dccCommentId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteCommentContent
:: Text
-> DeleteCommentContent
deleteCommentContent pCommentId_ =
DeleteCommentContent' {_dccCommentId = pCommentId_}
dccCommentId :: Lens' DeleteCommentContent Text
dccCommentId = lens _dccCommentId (\ s a -> s{_dccCommentId = a})
instance AWSRequest DeleteCommentContent where
type Rs DeleteCommentContent =
DeleteCommentContentResponse
request = postJSON codeCommit
response
= receiveJSON
(\ s h x ->
DeleteCommentContentResponse' <$>
(x .?> "comment") <*> (pure (fromEnum s)))
instance Hashable DeleteCommentContent where
instance NFData DeleteCommentContent where
instance ToHeaders DeleteCommentContent where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeCommit_20150413.DeleteCommentContent" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteCommentContent where
toJSON DeleteCommentContent'{..}
= object
(catMaybes [Just ("commentId" .= _dccCommentId)])
instance ToPath DeleteCommentContent where
toPath = const "/"
instance ToQuery DeleteCommentContent where
toQuery = const mempty
data DeleteCommentContentResponse = DeleteCommentContentResponse'
{ _dccrsComment :: !(Maybe Comment)
, _dccrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteCommentContentResponse
:: Int
-> DeleteCommentContentResponse
deleteCommentContentResponse pResponseStatus_ =
DeleteCommentContentResponse'
{_dccrsComment = Nothing, _dccrsResponseStatus = pResponseStatus_}
dccrsComment :: Lens' DeleteCommentContentResponse (Maybe Comment)
dccrsComment = lens _dccrsComment (\ s a -> s{_dccrsComment = a})
dccrsResponseStatus :: Lens' DeleteCommentContentResponse Int
dccrsResponseStatus = lens _dccrsResponseStatus (\ s a -> s{_dccrsResponseStatus = a})
instance NFData DeleteCommentContentResponse where