module Network.AWS.Inspector.DescribeRun
(
describeRun
, DescribeRun
, drRunARN
, describeRunResponse
, DescribeRunResponse
, drrsRun
, drrsResponseStatus
) where
import Network.AWS.Inspector.Types
import Network.AWS.Inspector.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype DescribeRun = DescribeRun'
{ _drRunARN :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeRun
:: DescribeRun
describeRun =
DescribeRun'
{ _drRunARN = Nothing
}
drRunARN :: Lens' DescribeRun (Maybe Text)
drRunARN = lens _drRunARN (\ s a -> s{_drRunARN = a});
instance AWSRequest DescribeRun where
type Rs DescribeRun = DescribeRunResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
DescribeRunResponse' <$>
(x .?> "run") <*> (pure (fromEnum s)))
instance ToHeaders DescribeRun where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.DescribeRun" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeRun where
toJSON DescribeRun'{..}
= object (catMaybes [("runArn" .=) <$> _drRunARN])
instance ToPath DescribeRun where
toPath = const "/"
instance ToQuery DescribeRun where
toQuery = const mempty
data DescribeRunResponse = DescribeRunResponse'
{ _drrsRun :: !(Maybe Run)
, _drrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeRunResponse
:: Int
-> DescribeRunResponse
describeRunResponse pResponseStatus_ =
DescribeRunResponse'
{ _drrsRun = Nothing
, _drrsResponseStatus = pResponseStatus_
}
drrsRun :: Lens' DescribeRunResponse (Maybe Run)
drrsRun = lens _drrsRun (\ s a -> s{_drrsRun = a});
drrsResponseStatus :: Lens' DescribeRunResponse Int
drrsResponseStatus = lens _drrsResponseStatus (\ s a -> s{_drrsResponseStatus = a});