module Network.AWS.Inspector.RunAssessment
(
runAssessment
, RunAssessment
, raAssessmentARN
, raRunName
, runAssessmentResponse
, RunAssessmentResponse
, rarsRunARN
, rarsResponseStatus
) where
import Network.AWS.Inspector.Types
import Network.AWS.Inspector.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data RunAssessment = RunAssessment'
{ _raAssessmentARN :: !(Maybe Text)
, _raRunName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
runAssessment
:: RunAssessment
runAssessment =
RunAssessment'
{ _raAssessmentARN = Nothing
, _raRunName = Nothing
}
raAssessmentARN :: Lens' RunAssessment (Maybe Text)
raAssessmentARN = lens _raAssessmentARN (\ s a -> s{_raAssessmentARN = a});
raRunName :: Lens' RunAssessment (Maybe Text)
raRunName = lens _raRunName (\ s a -> s{_raRunName = a});
instance AWSRequest RunAssessment where
type Rs RunAssessment = RunAssessmentResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
RunAssessmentResponse' <$>
(x .?> "runArn") <*> (pure (fromEnum s)))
instance ToHeaders RunAssessment where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.RunAssessment" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RunAssessment where
toJSON RunAssessment'{..}
= object
(catMaybes
[("assessmentArn" .=) <$> _raAssessmentARN,
("runName" .=) <$> _raRunName])
instance ToPath RunAssessment where
toPath = const "/"
instance ToQuery RunAssessment where
toQuery = const mempty
data RunAssessmentResponse = RunAssessmentResponse'
{ _rarsRunARN :: !(Maybe Text)
, _rarsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
runAssessmentResponse
:: Int
-> RunAssessmentResponse
runAssessmentResponse pResponseStatus_ =
RunAssessmentResponse'
{ _rarsRunARN = Nothing
, _rarsResponseStatus = pResponseStatus_
}
rarsRunARN :: Lens' RunAssessmentResponse (Maybe Text)
rarsRunARN = lens _rarsRunARN (\ s a -> s{_rarsRunARN = a});
rarsResponseStatus :: Lens' RunAssessmentResponse Int
rarsResponseStatus = lens _rarsResponseStatus (\ s a -> s{_rarsResponseStatus = a});