{-# 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.DeregisterTaskDefinition
(
deregisterTaskDefinition
, DeregisterTaskDefinition
, derTaskDefinition
, deregisterTaskDefinitionResponse
, DeregisterTaskDefinitionResponse
, dtdrsTaskDefinition
, dtdrsResponseStatus
) 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 DeregisterTaskDefinition = DeregisterTaskDefinition'
{ _derTaskDefinition :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deregisterTaskDefinition
:: Text
-> DeregisterTaskDefinition
deregisterTaskDefinition pTaskDefinition_ =
DeregisterTaskDefinition'
{ _derTaskDefinition = pTaskDefinition_
}
derTaskDefinition :: Lens' DeregisterTaskDefinition Text
derTaskDefinition = lens _derTaskDefinition (\ s a -> s{_derTaskDefinition = a});
instance AWSRequest DeregisterTaskDefinition where
type Rs DeregisterTaskDefinition =
DeregisterTaskDefinitionResponse
request = postJSON ecs
response
= receiveJSON
(\ s h x ->
DeregisterTaskDefinitionResponse' <$>
(x .?> "taskDefinition") <*> (pure (fromEnum s)))
instance Hashable DeregisterTaskDefinition
instance NFData DeregisterTaskDefinition
instance ToHeaders DeregisterTaskDefinition where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonEC2ContainerServiceV20141113.DeregisterTaskDefinition"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeregisterTaskDefinition where
toJSON DeregisterTaskDefinition'{..}
= object
(catMaybes
[Just ("taskDefinition" .= _derTaskDefinition)])
instance ToPath DeregisterTaskDefinition where
toPath = const "/"
instance ToQuery DeregisterTaskDefinition where
toQuery = const mempty
data DeregisterTaskDefinitionResponse = DeregisterTaskDefinitionResponse'
{ _dtdrsTaskDefinition :: !(Maybe TaskDefinition)
, _dtdrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deregisterTaskDefinitionResponse
:: Int
-> DeregisterTaskDefinitionResponse
deregisterTaskDefinitionResponse pResponseStatus_ =
DeregisterTaskDefinitionResponse'
{ _dtdrsTaskDefinition = Nothing
, _dtdrsResponseStatus = pResponseStatus_
}
dtdrsTaskDefinition :: Lens' DeregisterTaskDefinitionResponse (Maybe TaskDefinition)
dtdrsTaskDefinition = lens _dtdrsTaskDefinition (\ s a -> s{_dtdrsTaskDefinition = a});
dtdrsResponseStatus :: Lens' DeregisterTaskDefinitionResponse Int
dtdrsResponseStatus = lens _dtdrsResponseStatus (\ s a -> s{_dtdrsResponseStatus = a});
instance NFData DeregisterTaskDefinitionResponse