module Network.AWS.Inspector.ListAttachedRulesPackages
(
listAttachedRulesPackages
, ListAttachedRulesPackages
, larpAssessmentARN
, larpNextToken
, larpMaxResults
, listAttachedRulesPackagesResponse
, ListAttachedRulesPackagesResponse
, larprsNextToken
, larprsRulesPackageARNList
, larprsResponseStatus
) 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 ListAttachedRulesPackages = ListAttachedRulesPackages'
{ _larpAssessmentARN :: !(Maybe Text)
, _larpNextToken :: !(Maybe Text)
, _larpMaxResults :: !(Maybe Int)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listAttachedRulesPackages
:: ListAttachedRulesPackages
listAttachedRulesPackages =
ListAttachedRulesPackages'
{ _larpAssessmentARN = Nothing
, _larpNextToken = Nothing
, _larpMaxResults = Nothing
}
larpAssessmentARN :: Lens' ListAttachedRulesPackages (Maybe Text)
larpAssessmentARN = lens _larpAssessmentARN (\ s a -> s{_larpAssessmentARN = a});
larpNextToken :: Lens' ListAttachedRulesPackages (Maybe Text)
larpNextToken = lens _larpNextToken (\ s a -> s{_larpNextToken = a});
larpMaxResults :: Lens' ListAttachedRulesPackages (Maybe Int)
larpMaxResults = lens _larpMaxResults (\ s a -> s{_larpMaxResults = a});
instance AWSRequest ListAttachedRulesPackages where
type Rs ListAttachedRulesPackages =
ListAttachedRulesPackagesResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
ListAttachedRulesPackagesResponse' <$>
(x .?> "nextToken") <*>
(x .?> "rulesPackageArnList" .!@ mempty)
<*> (pure (fromEnum s)))
instance ToHeaders ListAttachedRulesPackages where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.ListAttachedRulesPackages" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListAttachedRulesPackages where
toJSON ListAttachedRulesPackages'{..}
= object
(catMaybes
[("assessmentArn" .=) <$> _larpAssessmentARN,
("nextToken" .=) <$> _larpNextToken,
("maxResults" .=) <$> _larpMaxResults])
instance ToPath ListAttachedRulesPackages where
toPath = const "/"
instance ToQuery ListAttachedRulesPackages where
toQuery = const mempty
data ListAttachedRulesPackagesResponse = ListAttachedRulesPackagesResponse'
{ _larprsNextToken :: !(Maybe Text)
, _larprsRulesPackageARNList :: !(Maybe [Text])
, _larprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listAttachedRulesPackagesResponse
:: Int
-> ListAttachedRulesPackagesResponse
listAttachedRulesPackagesResponse pResponseStatus_ =
ListAttachedRulesPackagesResponse'
{ _larprsNextToken = Nothing
, _larprsRulesPackageARNList = Nothing
, _larprsResponseStatus = pResponseStatus_
}
larprsNextToken :: Lens' ListAttachedRulesPackagesResponse (Maybe Text)
larprsNextToken = lens _larprsNextToken (\ s a -> s{_larprsNextToken = a});
larprsRulesPackageARNList :: Lens' ListAttachedRulesPackagesResponse [Text]
larprsRulesPackageARNList = lens _larprsRulesPackageARNList (\ s a -> s{_larprsRulesPackageARNList = a}) . _Default . _Coerce;
larprsResponseStatus :: Lens' ListAttachedRulesPackagesResponse Int
larprsResponseStatus = lens _larprsResponseStatus (\ s a -> s{_larprsResponseStatus = a});