{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Config.GetAggregateComplianceDetailsByConfigRule
(
getAggregateComplianceDetailsByConfigRule
, GetAggregateComplianceDetailsByConfigRule
, gacdbcrNextToken
, gacdbcrLimit
, gacdbcrComplianceType
, gacdbcrConfigurationAggregatorName
, gacdbcrConfigRuleName
, gacdbcrAccountId
, gacdbcrAWSRegion
, getAggregateComplianceDetailsByConfigRuleResponse
, GetAggregateComplianceDetailsByConfigRuleResponse
, gacdbcrrsNextToken
, gacdbcrrsAggregateEvaluationResults
, gacdbcrrsResponseStatus
) where
import Network.AWS.Config.Types
import Network.AWS.Config.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetAggregateComplianceDetailsByConfigRule = GetAggregateComplianceDetailsByConfigRule'
{ _gacdbcrNextToken :: !(Maybe Text)
, _gacdbcrLimit :: !(Maybe Nat)
, _gacdbcrComplianceType :: !(Maybe ComplianceType)
, _gacdbcrConfigurationAggregatorName :: !Text
, _gacdbcrConfigRuleName :: !Text
, _gacdbcrAccountId :: !Text
, _gacdbcrAWSRegion :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getAggregateComplianceDetailsByConfigRule
:: Text
-> Text
-> Text
-> Text
-> GetAggregateComplianceDetailsByConfigRule
getAggregateComplianceDetailsByConfigRule pConfigurationAggregatorName_ pConfigRuleName_ pAccountId_ pAWSRegion_ =
GetAggregateComplianceDetailsByConfigRule'
{ _gacdbcrNextToken = Nothing
, _gacdbcrLimit = Nothing
, _gacdbcrComplianceType = Nothing
, _gacdbcrConfigurationAggregatorName = pConfigurationAggregatorName_
, _gacdbcrConfigRuleName = pConfigRuleName_
, _gacdbcrAccountId = pAccountId_
, _gacdbcrAWSRegion = pAWSRegion_
}
gacdbcrNextToken :: Lens' GetAggregateComplianceDetailsByConfigRule (Maybe Text)
gacdbcrNextToken = lens _gacdbcrNextToken (\ s a -> s{_gacdbcrNextToken = a})
gacdbcrLimit :: Lens' GetAggregateComplianceDetailsByConfigRule (Maybe Natural)
gacdbcrLimit = lens _gacdbcrLimit (\ s a -> s{_gacdbcrLimit = a}) . mapping _Nat
gacdbcrComplianceType :: Lens' GetAggregateComplianceDetailsByConfigRule (Maybe ComplianceType)
gacdbcrComplianceType = lens _gacdbcrComplianceType (\ s a -> s{_gacdbcrComplianceType = a})
gacdbcrConfigurationAggregatorName :: Lens' GetAggregateComplianceDetailsByConfigRule Text
gacdbcrConfigurationAggregatorName = lens _gacdbcrConfigurationAggregatorName (\ s a -> s{_gacdbcrConfigurationAggregatorName = a})
gacdbcrConfigRuleName :: Lens' GetAggregateComplianceDetailsByConfigRule Text
gacdbcrConfigRuleName = lens _gacdbcrConfigRuleName (\ s a -> s{_gacdbcrConfigRuleName = a})
gacdbcrAccountId :: Lens' GetAggregateComplianceDetailsByConfigRule Text
gacdbcrAccountId = lens _gacdbcrAccountId (\ s a -> s{_gacdbcrAccountId = a})
gacdbcrAWSRegion :: Lens' GetAggregateComplianceDetailsByConfigRule Text
gacdbcrAWSRegion = lens _gacdbcrAWSRegion (\ s a -> s{_gacdbcrAWSRegion = a})
instance AWSRequest
GetAggregateComplianceDetailsByConfigRule
where
type Rs GetAggregateComplianceDetailsByConfigRule =
GetAggregateComplianceDetailsByConfigRuleResponse
request = postJSON config
response
= receiveJSON
(\ s h x ->
GetAggregateComplianceDetailsByConfigRuleResponse'
<$>
(x .?> "NextToken") <*>
(x .?> "AggregateEvaluationResults" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable
GetAggregateComplianceDetailsByConfigRule
where
instance NFData
GetAggregateComplianceDetailsByConfigRule
where
instance ToHeaders
GetAggregateComplianceDetailsByConfigRule
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.GetAggregateComplianceDetailsByConfigRule"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON
GetAggregateComplianceDetailsByConfigRule
where
toJSON GetAggregateComplianceDetailsByConfigRule'{..}
= object
(catMaybes
[("NextToken" .=) <$> _gacdbcrNextToken,
("Limit" .=) <$> _gacdbcrLimit,
("ComplianceType" .=) <$> _gacdbcrComplianceType,
Just
("ConfigurationAggregatorName" .=
_gacdbcrConfigurationAggregatorName),
Just ("ConfigRuleName" .= _gacdbcrConfigRuleName),
Just ("AccountId" .= _gacdbcrAccountId),
Just ("AwsRegion" .= _gacdbcrAWSRegion)])
instance ToPath
GetAggregateComplianceDetailsByConfigRule
where
toPath = const "/"
instance ToQuery
GetAggregateComplianceDetailsByConfigRule
where
toQuery = const mempty
data GetAggregateComplianceDetailsByConfigRuleResponse = GetAggregateComplianceDetailsByConfigRuleResponse'
{ _gacdbcrrsNextToken :: !(Maybe Text)
, _gacdbcrrsAggregateEvaluationResults :: !(Maybe [AggregateEvaluationResult])
, _gacdbcrrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getAggregateComplianceDetailsByConfigRuleResponse
:: Int
-> GetAggregateComplianceDetailsByConfigRuleResponse
getAggregateComplianceDetailsByConfigRuleResponse pResponseStatus_ =
GetAggregateComplianceDetailsByConfigRuleResponse'
{ _gacdbcrrsNextToken = Nothing
, _gacdbcrrsAggregateEvaluationResults = Nothing
, _gacdbcrrsResponseStatus = pResponseStatus_
}
gacdbcrrsNextToken :: Lens' GetAggregateComplianceDetailsByConfigRuleResponse (Maybe Text)
gacdbcrrsNextToken = lens _gacdbcrrsNextToken (\ s a -> s{_gacdbcrrsNextToken = a})
gacdbcrrsAggregateEvaluationResults :: Lens' GetAggregateComplianceDetailsByConfigRuleResponse [AggregateEvaluationResult]
gacdbcrrsAggregateEvaluationResults = lens _gacdbcrrsAggregateEvaluationResults (\ s a -> s{_gacdbcrrsAggregateEvaluationResults = a}) . _Default . _Coerce
gacdbcrrsResponseStatus :: Lens' GetAggregateComplianceDetailsByConfigRuleResponse Int
gacdbcrrsResponseStatus = lens _gacdbcrrsResponseStatus (\ s a -> s{_gacdbcrrsResponseStatus = a})
instance NFData
GetAggregateComplianceDetailsByConfigRuleResponse
where