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