module Network.AWS.Inspector.ListRulesPackages
(
listRulesPackages
, ListRulesPackages
, lrpNextToken
, lrpMaxResults
, listRulesPackagesResponse
, ListRulesPackagesResponse
, lrprsNextToken
, lrprsRulesPackageARNList
, lrprsResponseStatus
) 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 ListRulesPackages = ListRulesPackages'
{ _lrpNextToken :: !(Maybe Text)
, _lrpMaxResults :: !(Maybe Int)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listRulesPackages
:: ListRulesPackages
listRulesPackages =
ListRulesPackages'
{ _lrpNextToken = Nothing
, _lrpMaxResults = Nothing
}
lrpNextToken :: Lens' ListRulesPackages (Maybe Text)
lrpNextToken = lens _lrpNextToken (\ s a -> s{_lrpNextToken = a});
lrpMaxResults :: Lens' ListRulesPackages (Maybe Int)
lrpMaxResults = lens _lrpMaxResults (\ s a -> s{_lrpMaxResults = a});
instance AWSRequest ListRulesPackages where
type Rs ListRulesPackages = ListRulesPackagesResponse
request = postJSON inspector
response
= receiveJSON
(\ s h x ->
ListRulesPackagesResponse' <$>
(x .?> "nextToken") <*>
(x .?> "rulesPackageArnList" .!@ mempty)
<*> (pure (fromEnum s)))
instance ToHeaders ListRulesPackages where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("InspectorService.ListRulesPackages" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON ListRulesPackages where
toJSON ListRulesPackages'{..}
= object
(catMaybes
[("nextToken" .=) <$> _lrpNextToken,
("maxResults" .=) <$> _lrpMaxResults])
instance ToPath ListRulesPackages where
toPath = const "/"
instance ToQuery ListRulesPackages where
toQuery = const mempty
data ListRulesPackagesResponse = ListRulesPackagesResponse'
{ _lrprsNextToken :: !(Maybe Text)
, _lrprsRulesPackageARNList :: !(Maybe [Text])
, _lrprsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listRulesPackagesResponse
:: Int
-> ListRulesPackagesResponse
listRulesPackagesResponse pResponseStatus_ =
ListRulesPackagesResponse'
{ _lrprsNextToken = Nothing
, _lrprsRulesPackageARNList = Nothing
, _lrprsResponseStatus = pResponseStatus_
}
lrprsNextToken :: Lens' ListRulesPackagesResponse (Maybe Text)
lrprsNextToken = lens _lrprsNextToken (\ s a -> s{_lrprsNextToken = a});
lrprsRulesPackageARNList :: Lens' ListRulesPackagesResponse [Text]
lrprsRulesPackageARNList = lens _lrprsRulesPackageARNList (\ s a -> s{_lrprsRulesPackageARNList = a}) . _Default . _Coerce;
lrprsResponseStatus :: Lens' ListRulesPackagesResponse Int
lrprsResponseStatus = lens _lrprsResponseStatus (\ s a -> s{_lrprsResponseStatus = a});