module Network.AWS.Config.DescribeComplianceByConfigRule
(
describeComplianceByConfigRule
, DescribeComplianceByConfigRule
, dcbcrConfigRuleNames
, dcbcrComplianceTypes
, dcbcrNextToken
, describeComplianceByConfigRuleResponse
, DescribeComplianceByConfigRuleResponse
, dcbcrrsComplianceByConfigRules
, dcbcrrsNextToken
, dcbcrrsResponseStatus
) where
import Network.AWS.Config.Types
import Network.AWS.Config.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data DescribeComplianceByConfigRule = DescribeComplianceByConfigRule'
{ _dcbcrConfigRuleNames :: !(Maybe [Text])
, _dcbcrComplianceTypes :: !(Maybe [ComplianceType])
, _dcbcrNextToken :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeComplianceByConfigRule
:: DescribeComplianceByConfigRule
describeComplianceByConfigRule =
DescribeComplianceByConfigRule'
{ _dcbcrConfigRuleNames = Nothing
, _dcbcrComplianceTypes = Nothing
, _dcbcrNextToken = Nothing
}
dcbcrConfigRuleNames :: Lens' DescribeComplianceByConfigRule [Text]
dcbcrConfigRuleNames = lens _dcbcrConfigRuleNames (\ s a -> s{_dcbcrConfigRuleNames = a}) . _Default . _Coerce;
dcbcrComplianceTypes :: Lens' DescribeComplianceByConfigRule [ComplianceType]
dcbcrComplianceTypes = lens _dcbcrComplianceTypes (\ s a -> s{_dcbcrComplianceTypes = a}) . _Default . _Coerce;
dcbcrNextToken :: Lens' DescribeComplianceByConfigRule (Maybe Text)
dcbcrNextToken = lens _dcbcrNextToken (\ s a -> s{_dcbcrNextToken = a});
instance AWSRequest DescribeComplianceByConfigRule
where
type Rs DescribeComplianceByConfigRule =
DescribeComplianceByConfigRuleResponse
request = postJSON config
response
= receiveJSON
(\ s h x ->
DescribeComplianceByConfigRuleResponse' <$>
(x .?> "ComplianceByConfigRules" .!@ mempty) <*>
(x .?> "NextToken")
<*> (pure (fromEnum s)))
instance ToHeaders DescribeComplianceByConfigRule
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.DescribeComplianceByConfigRule"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeComplianceByConfigRule where
toJSON DescribeComplianceByConfigRule'{..}
= object
(catMaybes
[("ConfigRuleNames" .=) <$> _dcbcrConfigRuleNames,
("ComplianceTypes" .=) <$> _dcbcrComplianceTypes,
("NextToken" .=) <$> _dcbcrNextToken])
instance ToPath DescribeComplianceByConfigRule where
toPath = const "/"
instance ToQuery DescribeComplianceByConfigRule where
toQuery = const mempty
data DescribeComplianceByConfigRuleResponse = DescribeComplianceByConfigRuleResponse'
{ _dcbcrrsComplianceByConfigRules :: !(Maybe [ComplianceByConfigRule])
, _dcbcrrsNextToken :: !(Maybe Text)
, _dcbcrrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
describeComplianceByConfigRuleResponse
:: Int
-> DescribeComplianceByConfigRuleResponse
describeComplianceByConfigRuleResponse pResponseStatus_ =
DescribeComplianceByConfigRuleResponse'
{ _dcbcrrsComplianceByConfigRules = Nothing
, _dcbcrrsNextToken = Nothing
, _dcbcrrsResponseStatus = pResponseStatus_
}
dcbcrrsComplianceByConfigRules :: Lens' DescribeComplianceByConfigRuleResponse [ComplianceByConfigRule]
dcbcrrsComplianceByConfigRules = lens _dcbcrrsComplianceByConfigRules (\ s a -> s{_dcbcrrsComplianceByConfigRules = a}) . _Default . _Coerce;
dcbcrrsNextToken :: Lens' DescribeComplianceByConfigRuleResponse (Maybe Text)
dcbcrrsNextToken = lens _dcbcrrsNextToken (\ s a -> s{_dcbcrrsNextToken = a});
dcbcrrsResponseStatus :: Lens' DescribeComplianceByConfigRuleResponse Int
dcbcrrsResponseStatus = lens _dcbcrrsResponseStatus (\ s a -> s{_dcbcrrsResponseStatus = a});