{-# 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.CodeBuild.DeleteProject
(
deleteProject
, DeleteProject
, dpName
, deleteProjectResponse
, DeleteProjectResponse
, dprsResponseStatus
) where
import Network.AWS.CodeBuild.Types
import Network.AWS.CodeBuild.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteProject = DeleteProject'
{ _dpName :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteProject
:: Text
-> DeleteProject
deleteProject pName_ = DeleteProject' {_dpName = pName_}
dpName :: Lens' DeleteProject Text
dpName = lens _dpName (\ s a -> s{_dpName = a})
instance AWSRequest DeleteProject where
type Rs DeleteProject = DeleteProjectResponse
request = postJSON codeBuild
response
= receiveEmpty
(\ s h x ->
DeleteProjectResponse' <$> (pure (fromEnum s)))
instance Hashable DeleteProject where
instance NFData DeleteProject where
instance ToHeaders DeleteProject where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeBuild_20161006.DeleteProject" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteProject where
toJSON DeleteProject'{..}
= object (catMaybes [Just ("name" .= _dpName)])
instance ToPath DeleteProject where
toPath = const "/"
instance ToQuery DeleteProject where
toQuery = const mempty
newtype DeleteProjectResponse = DeleteProjectResponse'
{ _dprsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteProjectResponse
:: Int
-> DeleteProjectResponse
deleteProjectResponse pResponseStatus_ =
DeleteProjectResponse' {_dprsResponseStatus = pResponseStatus_}
dprsResponseStatus :: Lens' DeleteProjectResponse Int
dprsResponseStatus = lens _dprsResponseStatus (\ s a -> s{_dprsResponseStatus = a})
instance NFData DeleteProjectResponse where