module Network.AWS.CodeDeploy.DeleteDeploymentGroup
(
deleteDeploymentGroup
, DeleteDeploymentGroup
, ddgApplicationName
, ddgDeploymentGroupName
, deleteDeploymentGroupResponse
, DeleteDeploymentGroupResponse
, ddgrsHooksNotCleanedUp
, ddgrsResponseStatus
) where
import Network.AWS.CodeDeploy.Types
import Network.AWS.CodeDeploy.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DeleteDeploymentGroup = DeleteDeploymentGroup'
{ _ddgApplicationName :: !Text
, _ddgDeploymentGroupName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteDeploymentGroup
:: Text
-> Text
-> DeleteDeploymentGroup
deleteDeploymentGroup pApplicationName_ pDeploymentGroupName_ =
DeleteDeploymentGroup'
{ _ddgApplicationName = pApplicationName_
, _ddgDeploymentGroupName = pDeploymentGroupName_
}
ddgApplicationName :: Lens' DeleteDeploymentGroup Text
ddgApplicationName = lens _ddgApplicationName (\ s a -> s{_ddgApplicationName = a});
ddgDeploymentGroupName :: Lens' DeleteDeploymentGroup Text
ddgDeploymentGroupName = lens _ddgDeploymentGroupName (\ s a -> s{_ddgDeploymentGroupName = a});
instance AWSRequest DeleteDeploymentGroup where
type Rs DeleteDeploymentGroup =
DeleteDeploymentGroupResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
DeleteDeploymentGroupResponse' <$>
(x .?> "hooksNotCleanedUp" .!@ mempty) <*>
(pure (fromEnum s)))
instance ToHeaders DeleteDeploymentGroup where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.DeleteDeploymentGroup" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteDeploymentGroup where
toJSON DeleteDeploymentGroup'{..}
= object
(catMaybes
[Just ("applicationName" .= _ddgApplicationName),
Just
("deploymentGroupName" .= _ddgDeploymentGroupName)])
instance ToPath DeleteDeploymentGroup where
toPath = const "/"
instance ToQuery DeleteDeploymentGroup where
toQuery = const mempty
data DeleteDeploymentGroupResponse = DeleteDeploymentGroupResponse'
{ _ddgrsHooksNotCleanedUp :: !(Maybe [AutoScalingGroup])
, _ddgrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteDeploymentGroupResponse
:: Int
-> DeleteDeploymentGroupResponse
deleteDeploymentGroupResponse pResponseStatus_ =
DeleteDeploymentGroupResponse'
{ _ddgrsHooksNotCleanedUp = Nothing
, _ddgrsResponseStatus = pResponseStatus_
}
ddgrsHooksNotCleanedUp :: Lens' DeleteDeploymentGroupResponse [AutoScalingGroup]
ddgrsHooksNotCleanedUp = lens _ddgrsHooksNotCleanedUp (\ s a -> s{_ddgrsHooksNotCleanedUp = a}) . _Default . _Coerce;
ddgrsResponseStatus :: Lens' DeleteDeploymentGroupResponse Int
ddgrsResponseStatus = lens _ddgrsResponseStatus (\ s a -> s{_ddgrsResponseStatus = a});