module Network.AWS.CodeDeploy.DeleteDeploymentGroup
(
deleteDeploymentGroup
, DeleteDeploymentGroup
, ddgApplicationName
, ddgDeploymentGroupName
, deleteDeploymentGroupResponse
, DeleteDeploymentGroupResponse
, ddgrsHooksNotCleanedUp
, ddgrsStatus
) 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 Sv DeleteDeploymentGroup = CodeDeploy
type Rs DeleteDeploymentGroup =
DeleteDeploymentGroupResponse
request = postJSON
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
["applicationName" .= _ddgApplicationName,
"deploymentGroupName" .= _ddgDeploymentGroupName]
instance ToPath DeleteDeploymentGroup where
toPath = const "/"
instance ToQuery DeleteDeploymentGroup where
toQuery = const mempty
data DeleteDeploymentGroupResponse = DeleteDeploymentGroupResponse'
{ _ddgrsHooksNotCleanedUp :: !(Maybe [AutoScalingGroup])
, _ddgrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteDeploymentGroupResponse
:: Int
-> DeleteDeploymentGroupResponse
deleteDeploymentGroupResponse pStatus_ =
DeleteDeploymentGroupResponse'
{ _ddgrsHooksNotCleanedUp = Nothing
, _ddgrsStatus = pStatus_
}
ddgrsHooksNotCleanedUp :: Lens' DeleteDeploymentGroupResponse [AutoScalingGroup]
ddgrsHooksNotCleanedUp = lens _ddgrsHooksNotCleanedUp (\ s a -> s{_ddgrsHooksNotCleanedUp = a}) . _Default . _Coerce;
ddgrsStatus :: Lens' DeleteDeploymentGroupResponse Int
ddgrsStatus = lens _ddgrsStatus (\ s a -> s{_ddgrsStatus = a});