module Network.AWS.ECS.DeleteCluster
(
deleteCluster
, DeleteCluster
, dcCluster
, deleteClusterResponse
, DeleteClusterResponse
, drsCluster
, drsResponseStatus
) where
import Network.AWS.ECS.Types
import Network.AWS.ECS.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DeleteCluster = DeleteCluster'
{ _dcCluster :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteCluster
:: Text
-> DeleteCluster
deleteCluster pCluster_ =
DeleteCluster'
{ _dcCluster = pCluster_
}
dcCluster :: Lens' DeleteCluster Text
dcCluster = lens _dcCluster (\ s a -> s{_dcCluster = a});
instance AWSRequest DeleteCluster where
type Rs DeleteCluster = DeleteClusterResponse
request = postJSON ecs
response
= receiveJSON
(\ s h x ->
DeleteClusterResponse' <$>
(x .?> "cluster") <*> (pure (fromEnum s)))
instance Hashable DeleteCluster
instance NFData DeleteCluster
instance ToHeaders DeleteCluster where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonEC2ContainerServiceV20141113.DeleteCluster"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteCluster where
toJSON DeleteCluster'{..}
= object (catMaybes [Just ("cluster" .= _dcCluster)])
instance ToPath DeleteCluster where
toPath = const "/"
instance ToQuery DeleteCluster where
toQuery = const mempty
data DeleteClusterResponse = DeleteClusterResponse'
{ _drsCluster :: !(Maybe Cluster)
, _drsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteClusterResponse
:: Int
-> DeleteClusterResponse
deleteClusterResponse pResponseStatus_ =
DeleteClusterResponse'
{ _drsCluster = Nothing
, _drsResponseStatus = pResponseStatus_
}
drsCluster :: Lens' DeleteClusterResponse (Maybe Cluster)
drsCluster = lens _drsCluster (\ s a -> s{_drsCluster = a});
drsResponseStatus :: Lens' DeleteClusterResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a});
instance NFData DeleteClusterResponse