module Network.AWS.Inspector.StartDataCollection
(
startDataCollection
, StartDataCollection
, sdcAssessmentARN
, startDataCollectionResponse
, StartDataCollectionResponse
, srsMessage
, srsResponseStatus
) 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 StartDataCollection = StartDataCollection'
{ _sdcAssessmentARN :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
startDataCollection
:: StartDataCollection
startDataCollection =
StartDataCollection'
{ _sdcAssessmentARN = Nothing
}
sdcAssessmentARN :: Lens' StartDataCollection (Maybe Text)
sdcAssessmentARN = lens _sdcAssessmentARN (\ s a -> s{_sdcAssessmentARN = a});
instance AWSRequest StartDataCollection where
type Rs StartDataCollection =
StartDataCollectionResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
StartDataCollectionResponse' <$>
(x .?> "message") <*> (pure (fromEnum s)))
instance ToHeaders StartDataCollection where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.StartDataCollection" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON StartDataCollection where
toJSON StartDataCollection'{..}
= object
(catMaybes
[("assessmentArn" .=) <$> _sdcAssessmentARN])
instance ToPath StartDataCollection where
toPath = const "/"
instance ToQuery StartDataCollection where
toQuery = const mempty
data StartDataCollectionResponse = StartDataCollectionResponse'
{ _srsMessage :: !(Maybe Text)
, _srsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
startDataCollectionResponse
:: Int
-> StartDataCollectionResponse
startDataCollectionResponse pResponseStatus_ =
StartDataCollectionResponse'
{ _srsMessage = Nothing
, _srsResponseStatus = pResponseStatus_
}
srsMessage :: Lens' StartDataCollectionResponse (Maybe Text)
srsMessage = lens _srsMessage (\ s a -> s{_srsMessage = a});
srsResponseStatus :: Lens' StartDataCollectionResponse Int
srsResponseStatus = lens _srsResponseStatus (\ s a -> s{_srsResponseStatus = a});