module Network.AWS.Config.GetComplianceDetailsByConfigRule
(
getComplianceDetailsByConfigRule
, GetComplianceDetailsByConfigRule
, gcdbcrComplianceTypes
, gcdbcrNextToken
, gcdbcrLimit
, gcdbcrConfigRuleName
, getComplianceDetailsByConfigRuleResponse
, GetComplianceDetailsByConfigRuleResponse
, gcdbcrrsEvaluationResults
, gcdbcrrsNextToken
, gcdbcrrsResponseStatus
) 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 GetComplianceDetailsByConfigRule = GetComplianceDetailsByConfigRule'
{ _gcdbcrComplianceTypes :: !(Maybe [ComplianceType])
, _gcdbcrNextToken :: !(Maybe Text)
, _gcdbcrLimit :: !(Maybe Nat)
, _gcdbcrConfigRuleName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getComplianceDetailsByConfigRule
:: Text
-> GetComplianceDetailsByConfigRule
getComplianceDetailsByConfigRule pConfigRuleName_ =
GetComplianceDetailsByConfigRule'
{ _gcdbcrComplianceTypes = Nothing
, _gcdbcrNextToken = Nothing
, _gcdbcrLimit = Nothing
, _gcdbcrConfigRuleName = pConfigRuleName_
}
gcdbcrComplianceTypes :: Lens' GetComplianceDetailsByConfigRule [ComplianceType]
gcdbcrComplianceTypes = lens _gcdbcrComplianceTypes (\ s a -> s{_gcdbcrComplianceTypes = a}) . _Default . _Coerce;
gcdbcrNextToken :: Lens' GetComplianceDetailsByConfigRule (Maybe Text)
gcdbcrNextToken = lens _gcdbcrNextToken (\ s a -> s{_gcdbcrNextToken = a});
gcdbcrLimit :: Lens' GetComplianceDetailsByConfigRule (Maybe Natural)
gcdbcrLimit = lens _gcdbcrLimit (\ s a -> s{_gcdbcrLimit = a}) . mapping _Nat;
gcdbcrConfigRuleName :: Lens' GetComplianceDetailsByConfigRule Text
gcdbcrConfigRuleName = lens _gcdbcrConfigRuleName (\ s a -> s{_gcdbcrConfigRuleName = a});
instance AWSRequest GetComplianceDetailsByConfigRule
where
type Rs GetComplianceDetailsByConfigRule =
GetComplianceDetailsByConfigRuleResponse
request = postJSON config
response
= receiveJSON
(\ s h x ->
GetComplianceDetailsByConfigRuleResponse' <$>
(x .?> "EvaluationResults" .!@ mempty) <*>
(x .?> "NextToken")
<*> (pure (fromEnum s)))
instance ToHeaders GetComplianceDetailsByConfigRule
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.GetComplianceDetailsByConfigRule"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetComplianceDetailsByConfigRule
where
toJSON GetComplianceDetailsByConfigRule'{..}
= object
(catMaybes
[("ComplianceTypes" .=) <$> _gcdbcrComplianceTypes,
("NextToken" .=) <$> _gcdbcrNextToken,
("Limit" .=) <$> _gcdbcrLimit,
Just ("ConfigRuleName" .= _gcdbcrConfigRuleName)])
instance ToPath GetComplianceDetailsByConfigRule
where
toPath = const "/"
instance ToQuery GetComplianceDetailsByConfigRule
where
toQuery = const mempty
data GetComplianceDetailsByConfigRuleResponse = GetComplianceDetailsByConfigRuleResponse'
{ _gcdbcrrsEvaluationResults :: !(Maybe [EvaluationResult])
, _gcdbcrrsNextToken :: !(Maybe Text)
, _gcdbcrrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
getComplianceDetailsByConfigRuleResponse
:: Int
-> GetComplianceDetailsByConfigRuleResponse
getComplianceDetailsByConfigRuleResponse pResponseStatus_ =
GetComplianceDetailsByConfigRuleResponse'
{ _gcdbcrrsEvaluationResults = Nothing
, _gcdbcrrsNextToken = Nothing
, _gcdbcrrsResponseStatus = pResponseStatus_
}
gcdbcrrsEvaluationResults :: Lens' GetComplianceDetailsByConfigRuleResponse [EvaluationResult]
gcdbcrrsEvaluationResults = lens _gcdbcrrsEvaluationResults (\ s a -> s{_gcdbcrrsEvaluationResults = a}) . _Default . _Coerce;
gcdbcrrsNextToken :: Lens' GetComplianceDetailsByConfigRuleResponse (Maybe Text)
gcdbcrrsNextToken = lens _gcdbcrrsNextToken (\ s a -> s{_gcdbcrrsNextToken = a});
gcdbcrrsResponseStatus :: Lens' GetComplianceDetailsByConfigRuleResponse Int
gcdbcrrsResponseStatus = lens _gcdbcrrsResponseStatus (\ s a -> s{_gcdbcrrsResponseStatus = a});