{-# 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.ECS.DeleteService
(
deleteService
, DeleteService
, dsCluster
, dsService
, deleteServiceResponse
, DeleteServiceResponse
, dsrsService
, dsrsResponseStatus
) 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
data DeleteService = DeleteService'
{ _dsCluster :: !(Maybe Text)
, _dsService :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteService
:: Text
-> DeleteService
deleteService pService_ =
DeleteService'
{ _dsCluster = Nothing
, _dsService = pService_
}
dsCluster :: Lens' DeleteService (Maybe Text)
dsCluster = lens _dsCluster (\ s a -> s{_dsCluster = a});
dsService :: Lens' DeleteService Text
dsService = lens _dsService (\ s a -> s{_dsService = a});
instance AWSRequest DeleteService where
type Rs DeleteService = DeleteServiceResponse
request = postJSON ecs
response
= receiveJSON
(\ s h x ->
DeleteServiceResponse' <$>
(x .?> "service") <*> (pure (fromEnum s)))
instance Hashable DeleteService
instance NFData DeleteService
instance ToHeaders DeleteService where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonEC2ContainerServiceV20141113.DeleteService"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteService where
toJSON DeleteService'{..}
= object
(catMaybes
[("cluster" .=) <$> _dsCluster,
Just ("service" .= _dsService)])
instance ToPath DeleteService where
toPath = const "/"
instance ToQuery DeleteService where
toQuery = const mempty
data DeleteServiceResponse = DeleteServiceResponse'
{ _dsrsService :: !(Maybe ContainerService)
, _dsrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteServiceResponse
:: Int
-> DeleteServiceResponse
deleteServiceResponse pResponseStatus_ =
DeleteServiceResponse'
{ _dsrsService = Nothing
, _dsrsResponseStatus = pResponseStatus_
}
dsrsService :: Lens' DeleteServiceResponse (Maybe ContainerService)
dsrsService = lens _dsrsService (\ s a -> s{_dsrsService = a});
dsrsResponseStatus :: Lens' DeleteServiceResponse Int
dsrsResponseStatus = lens _dsrsResponseStatus (\ s a -> s{_dsrsResponseStatus = a});
instance NFData DeleteServiceResponse