module Network.AWS.Inspector.UpdateAssessment
(
updateAssessment
, UpdateAssessment
, uaAssessmentARN
, uaDurationInSeconds
, uaAssessmentName
, updateAssessmentResponse
, UpdateAssessmentResponse
, ursMessage
, ursResponseStatus
) 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 UpdateAssessment = UpdateAssessment'
{ _uaAssessmentARN :: !(Maybe Text)
, _uaDurationInSeconds :: !(Maybe Int)
, _uaAssessmentName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateAssessment
:: UpdateAssessment
updateAssessment =
UpdateAssessment'
{ _uaAssessmentARN = Nothing
, _uaDurationInSeconds = Nothing
, _uaAssessmentName = Nothing
}
uaAssessmentARN :: Lens' UpdateAssessment (Maybe Text)
uaAssessmentARN = lens _uaAssessmentARN (\ s a -> s{_uaAssessmentARN = a});
uaDurationInSeconds :: Lens' UpdateAssessment (Maybe Int)
uaDurationInSeconds = lens _uaDurationInSeconds (\ s a -> s{_uaDurationInSeconds = a});
uaAssessmentName :: Lens' UpdateAssessment (Maybe Text)
uaAssessmentName = lens _uaAssessmentName (\ s a -> s{_uaAssessmentName = a});
instance AWSRequest UpdateAssessment where
type Rs UpdateAssessment = UpdateAssessmentResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
UpdateAssessmentResponse' <$>
(x .?> "message") <*> (pure (fromEnum s)))
instance ToHeaders UpdateAssessment where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.UpdateAssessment" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateAssessment where
toJSON UpdateAssessment'{..}
= object
(catMaybes
[("assessmentArn" .=) <$> _uaAssessmentARN,
("durationInSeconds" .=) <$> _uaDurationInSeconds,
("assessmentName" .=) <$> _uaAssessmentName])
instance ToPath UpdateAssessment where
toPath = const "/"
instance ToQuery UpdateAssessment where
toQuery = const mempty
data UpdateAssessmentResponse = UpdateAssessmentResponse'
{ _ursMessage :: !(Maybe Text)
, _ursResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
updateAssessmentResponse
:: Int
-> UpdateAssessmentResponse
updateAssessmentResponse pResponseStatus_ =
UpdateAssessmentResponse'
{ _ursMessage = Nothing
, _ursResponseStatus = pResponseStatus_
}
ursMessage :: Lens' UpdateAssessmentResponse (Maybe Text)
ursMessage = lens _ursMessage (\ s a -> s{_ursMessage = a});
ursResponseStatus :: Lens' UpdateAssessmentResponse Int
ursResponseStatus = lens _ursResponseStatus (\ s a -> s{_ursResponseStatus = a});