{-# 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.DeleteRepository
(
deleteRepository
, DeleteRepository
, drRepositoryName
, deleteRepositoryResponse
, DeleteRepositoryResponse
, drrsRepositoryId
, drrsResponseStatus
) 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 DeleteRepository = DeleteRepository'
{ _drRepositoryName :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteRepository
:: Text
-> DeleteRepository
deleteRepository pRepositoryName_ =
DeleteRepository'
{ _drRepositoryName = pRepositoryName_
}
drRepositoryName :: Lens' DeleteRepository Text
drRepositoryName = lens _drRepositoryName (\ s a -> s{_drRepositoryName = a});
instance AWSRequest DeleteRepository where
type Rs DeleteRepository = DeleteRepositoryResponse
request = postJSON codeCommit
response
= receiveJSON
(\ s h x ->
DeleteRepositoryResponse' <$>
(x .?> "repositoryId") <*> (pure (fromEnum s)))
instance Hashable DeleteRepository
instance NFData DeleteRepository
instance ToHeaders DeleteRepository where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeCommit_20150413.DeleteRepository" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteRepository where
toJSON DeleteRepository'{..}
= object
(catMaybes
[Just ("repositoryName" .= _drRepositoryName)])
instance ToPath DeleteRepository where
toPath = const "/"
instance ToQuery DeleteRepository where
toQuery = const mempty
data DeleteRepositoryResponse = DeleteRepositoryResponse'
{ _drrsRepositoryId :: !(Maybe Text)
, _drrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteRepositoryResponse
:: Int
-> DeleteRepositoryResponse
deleteRepositoryResponse pResponseStatus_ =
DeleteRepositoryResponse'
{ _drrsRepositoryId = Nothing
, _drrsResponseStatus = pResponseStatus_
}
drrsRepositoryId :: Lens' DeleteRepositoryResponse (Maybe Text)
drrsRepositoryId = lens _drrsRepositoryId (\ s a -> s{_drrsRepositoryId = a});
drrsResponseStatus :: Lens' DeleteRepositoryResponse Int
drrsResponseStatus = lens _drrsResponseStatus (\ s a -> s{_drrsResponseStatus = a});
instance NFData DeleteRepositoryResponse