module Network.AWS.Inspector.ListAttachedAssessments
(
listAttachedAssessments
, ListAttachedAssessments
, laaNextToken
, laaRulesPackageARN
, laaFilter
, laaMaxResults
, listAttachedAssessmentsResponse
, ListAttachedAssessmentsResponse
, laasrsAssessmentARNList
, laasrsNextToken
, laasrsResponseStatus
) 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 ListAttachedAssessments = ListAttachedAssessments'
{ _laaNextToken :: !(Maybe Text)
, _laaRulesPackageARN :: !(Maybe Text)
, _laaFilter :: !(Maybe AssessmentsFilter)
, _laaMaxResults :: !(Maybe Int)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listAttachedAssessments
:: ListAttachedAssessments
listAttachedAssessments =
ListAttachedAssessments'
{ _laaNextToken = Nothing
, _laaRulesPackageARN = Nothing
, _laaFilter = Nothing
, _laaMaxResults = Nothing
}
laaNextToken :: Lens' ListAttachedAssessments (Maybe Text)
laaNextToken = lens _laaNextToken (\ s a -> s{_laaNextToken = a});
laaRulesPackageARN :: Lens' ListAttachedAssessments (Maybe Text)
laaRulesPackageARN = lens _laaRulesPackageARN (\ s a -> s{_laaRulesPackageARN = a});
laaFilter :: Lens' ListAttachedAssessments (Maybe AssessmentsFilter)
laaFilter = lens _laaFilter (\ s a -> s{_laaFilter = a});
laaMaxResults :: Lens' ListAttachedAssessments (Maybe Int)
laaMaxResults = lens _laaMaxResults (\ s a -> s{_laaMaxResults = a});
instance AWSRequest ListAttachedAssessments where
type Rs ListAttachedAssessments =
ListAttachedAssessmentsResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
ListAttachedAssessmentsResponse' <$>
(x .?> "assessmentArnList" .!@ mempty) <*>
(x .?> "nextToken")
<*> (pure (fromEnum s)))
instance ToHeaders ListAttachedAssessments where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.ListAttachedAssessments" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListAttachedAssessments where
toJSON ListAttachedAssessments'{..}
= object
(catMaybes
[("nextToken" .=) <$> _laaNextToken,
("rulesPackageArn" .=) <$> _laaRulesPackageARN,
("filter" .=) <$> _laaFilter,
("maxResults" .=) <$> _laaMaxResults])
instance ToPath ListAttachedAssessments where
toPath = const "/"
instance ToQuery ListAttachedAssessments where
toQuery = const mempty
data ListAttachedAssessmentsResponse = ListAttachedAssessmentsResponse'
{ _laasrsAssessmentARNList :: !(Maybe [Text])
, _laasrsNextToken :: !(Maybe Text)
, _laasrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listAttachedAssessmentsResponse
:: Int
-> ListAttachedAssessmentsResponse
listAttachedAssessmentsResponse pResponseStatus_ =
ListAttachedAssessmentsResponse'
{ _laasrsAssessmentARNList = Nothing
, _laasrsNextToken = Nothing
, _laasrsResponseStatus = pResponseStatus_
}
laasrsAssessmentARNList :: Lens' ListAttachedAssessmentsResponse [Text]
laasrsAssessmentARNList = lens _laasrsAssessmentARNList (\ s a -> s{_laasrsAssessmentARNList = a}) . _Default . _Coerce;
laasrsNextToken :: Lens' ListAttachedAssessmentsResponse (Maybe Text)
laasrsNextToken = lens _laasrsNextToken (\ s a -> s{_laasrsNextToken = a});
laasrsResponseStatus :: Lens' ListAttachedAssessmentsResponse Int
laasrsResponseStatus = lens _laasrsResponseStatus (\ s a -> s{_laasrsResponseStatus = a});