module Network.AWS.Inspector.GetAssessmentTelemetry
(
getAssessmentTelemetry
, GetAssessmentTelemetry
, gatAssessmentARN
, getAssessmentTelemetryResponse
, GetAssessmentTelemetryResponse
, gatrsTelemetry
, gatrsResponseStatus
) 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 GetAssessmentTelemetry = GetAssessmentTelemetry'
{ _gatAssessmentARN :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getAssessmentTelemetry
:: GetAssessmentTelemetry
getAssessmentTelemetry =
GetAssessmentTelemetry'
{ _gatAssessmentARN = Nothing
}
gatAssessmentARN :: Lens' GetAssessmentTelemetry (Maybe Text)
gatAssessmentARN = lens _gatAssessmentARN (\ s a -> s{_gatAssessmentARN = a});
instance AWSRequest GetAssessmentTelemetry where
type Rs GetAssessmentTelemetry =
GetAssessmentTelemetryResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
GetAssessmentTelemetryResponse' <$>
(x .?> "telemetry" .!@ mempty) <*>
(pure (fromEnum s)))
instance ToHeaders GetAssessmentTelemetry where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.GetAssessmentTelemetry" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetAssessmentTelemetry where
toJSON GetAssessmentTelemetry'{..}
= object
(catMaybes
[("assessmentArn" .=) <$> _gatAssessmentARN])
instance ToPath GetAssessmentTelemetry where
toPath = const "/"
instance ToQuery GetAssessmentTelemetry where
toQuery = const mempty
data GetAssessmentTelemetryResponse = GetAssessmentTelemetryResponse'
{ _gatrsTelemetry :: !(Maybe [Telemetry])
, _gatrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getAssessmentTelemetryResponse
:: Int
-> GetAssessmentTelemetryResponse
getAssessmentTelemetryResponse pResponseStatus_ =
GetAssessmentTelemetryResponse'
{ _gatrsTelemetry = Nothing
, _gatrsResponseStatus = pResponseStatus_
}
gatrsTelemetry :: Lens' GetAssessmentTelemetryResponse [Telemetry]
gatrsTelemetry = lens _gatrsTelemetry (\ s a -> s{_gatrsTelemetry = a}) . _Default . _Coerce;
gatrsResponseStatus :: Lens' GetAssessmentTelemetryResponse Int
gatrsResponseStatus = lens _gatrsResponseStatus (\ s a -> s{_gatrsResponseStatus = a});