module Network.AWS.Inspector.ListAssessments
(
listAssessments
, ListAssessments
, laApplicationARNs
, laNextToken
, laFilter
, laMaxResults
, listAssessmentsResponse
, ListAssessmentsResponse
, larsAssessmentARNList
, larsNextToken
, larsResponseStatus
) 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 ListAssessments = ListAssessments'
{ _laApplicationARNs :: !(Maybe [Text])
, _laNextToken :: !(Maybe Text)
, _laFilter :: !(Maybe AssessmentsFilter)
, _laMaxResults :: !(Maybe Int)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listAssessments
:: ListAssessments
listAssessments =
ListAssessments'
{ _laApplicationARNs = Nothing
, _laNextToken = Nothing
, _laFilter = Nothing
, _laMaxResults = Nothing
}
laApplicationARNs :: Lens' ListAssessments [Text]
laApplicationARNs = lens _laApplicationARNs (\ s a -> s{_laApplicationARNs = a}) . _Default . _Coerce;
laNextToken :: Lens' ListAssessments (Maybe Text)
laNextToken = lens _laNextToken (\ s a -> s{_laNextToken = a});
laFilter :: Lens' ListAssessments (Maybe AssessmentsFilter)
laFilter = lens _laFilter (\ s a -> s{_laFilter = a});
laMaxResults :: Lens' ListAssessments (Maybe Int)
laMaxResults = lens _laMaxResults (\ s a -> s{_laMaxResults = a});
instance AWSRequest ListAssessments where
type Rs ListAssessments = ListAssessmentsResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
ListAssessmentsResponse' <$>
(x .?> "assessmentArnList" .!@ mempty) <*>
(x .?> "nextToken")
<*> (pure (fromEnum s)))
instance ToHeaders ListAssessments where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.ListAssessments" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListAssessments where
toJSON ListAssessments'{..}
= object
(catMaybes
[("applicationArns" .=) <$> _laApplicationARNs,
("nextToken" .=) <$> _laNextToken,
("filter" .=) <$> _laFilter,
("maxResults" .=) <$> _laMaxResults])
instance ToPath ListAssessments where
toPath = const "/"
instance ToQuery ListAssessments where
toQuery = const mempty
data ListAssessmentsResponse = ListAssessmentsResponse'
{ _larsAssessmentARNList :: !(Maybe [Text])
, _larsNextToken :: !(Maybe Text)
, _larsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listAssessmentsResponse
:: Int
-> ListAssessmentsResponse
listAssessmentsResponse pResponseStatus_ =
ListAssessmentsResponse'
{ _larsAssessmentARNList = Nothing
, _larsNextToken = Nothing
, _larsResponseStatus = pResponseStatus_
}
larsAssessmentARNList :: Lens' ListAssessmentsResponse [Text]
larsAssessmentARNList = lens _larsAssessmentARNList (\ s a -> s{_larsAssessmentARNList = a}) . _Default . _Coerce;
larsNextToken :: Lens' ListAssessmentsResponse (Maybe Text)
larsNextToken = lens _larsNextToken (\ s a -> s{_larsNextToken = a});
larsResponseStatus :: Lens' ListAssessmentsResponse Int
larsResponseStatus = lens _larsResponseStatus (\ s a -> s{_larsResponseStatus = a});