module Network.AWS.ECS.DescribeTaskDefinition
(
describeTaskDefinition
, DescribeTaskDefinition
, dtdTaskDefinition
, describeTaskDefinitionResponse
, DescribeTaskDefinitionResponse
, desrsTaskDefinition
, desrsStatus
) where
import Network.AWS.ECS.Types
import Network.AWS.ECS.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeTaskDefinition = DescribeTaskDefinition'
{ _dtdTaskDefinition :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeTaskDefinition
:: Text
-> DescribeTaskDefinition
describeTaskDefinition pTaskDefinition_ =
DescribeTaskDefinition'
{ _dtdTaskDefinition = pTaskDefinition_
}
dtdTaskDefinition :: Lens' DescribeTaskDefinition Text
dtdTaskDefinition = lens _dtdTaskDefinition (\ s a -> s{_dtdTaskDefinition = a});
instance AWSRequest DescribeTaskDefinition where
type Sv DescribeTaskDefinition = ECS
type Rs DescribeTaskDefinition =
DescribeTaskDefinitionResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
DescribeTaskDefinitionResponse' <$>
(x .?> "taskDefinition") <*> (pure (fromEnum s)))
instance ToHeaders DescribeTaskDefinition where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonEC2ContainerServiceV20141113.DescribeTaskDefinition"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeTaskDefinition where
toJSON DescribeTaskDefinition'{..}
= object ["taskDefinition" .= _dtdTaskDefinition]
instance ToPath DescribeTaskDefinition where
toPath = const "/"
instance ToQuery DescribeTaskDefinition where
toQuery = const mempty
data DescribeTaskDefinitionResponse = DescribeTaskDefinitionResponse'
{ _desrsTaskDefinition :: !(Maybe TaskDefinition)
, _desrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeTaskDefinitionResponse
:: Int
-> DescribeTaskDefinitionResponse
describeTaskDefinitionResponse pStatus_ =
DescribeTaskDefinitionResponse'
{ _desrsTaskDefinition = Nothing
, _desrsStatus = pStatus_
}
desrsTaskDefinition :: Lens' DescribeTaskDefinitionResponse (Maybe TaskDefinition)
desrsTaskDefinition = lens _desrsTaskDefinition (\ s a -> s{_desrsTaskDefinition = a});
desrsStatus :: Lens' DescribeTaskDefinitionResponse Int
desrsStatus = lens _desrsStatus (\ s a -> s{_desrsStatus = a});