{-# 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.DescribeConfigurationAggregators
(
describeConfigurationAggregators
, DescribeConfigurationAggregators
, dcaNextToken
, dcaLimit
, dcaConfigurationAggregatorNames
, describeConfigurationAggregatorsResponse
, DescribeConfigurationAggregatorsResponse
, dcarsNextToken
, dcarsConfigurationAggregators
, dcarsResponseStatus
) 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 DescribeConfigurationAggregators = DescribeConfigurationAggregators'
{ _dcaNextToken :: !(Maybe Text)
, _dcaLimit :: !(Maybe Nat)
, _dcaConfigurationAggregatorNames :: !(Maybe [Text])
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeConfigurationAggregators
:: DescribeConfigurationAggregators
describeConfigurationAggregators =
DescribeConfigurationAggregators'
{ _dcaNextToken = Nothing
, _dcaLimit = Nothing
, _dcaConfigurationAggregatorNames = Nothing
}
dcaNextToken :: Lens' DescribeConfigurationAggregators (Maybe Text)
dcaNextToken = lens _dcaNextToken (\ s a -> s{_dcaNextToken = a})
dcaLimit :: Lens' DescribeConfigurationAggregators (Maybe Natural)
dcaLimit = lens _dcaLimit (\ s a -> s{_dcaLimit = a}) . mapping _Nat
dcaConfigurationAggregatorNames :: Lens' DescribeConfigurationAggregators [Text]
dcaConfigurationAggregatorNames = lens _dcaConfigurationAggregatorNames (\ s a -> s{_dcaConfigurationAggregatorNames = a}) . _Default . _Coerce
instance AWSRequest DescribeConfigurationAggregators
where
type Rs DescribeConfigurationAggregators =
DescribeConfigurationAggregatorsResponse
request = postJSON config
response
= receiveJSON
(\ s h x ->
DescribeConfigurationAggregatorsResponse' <$>
(x .?> "NextToken") <*>
(x .?> "ConfigurationAggregators" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribeConfigurationAggregators
where
instance NFData DescribeConfigurationAggregators
where
instance ToHeaders DescribeConfigurationAggregators
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.DescribeConfigurationAggregators"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeConfigurationAggregators
where
toJSON DescribeConfigurationAggregators'{..}
= object
(catMaybes
[("NextToken" .=) <$> _dcaNextToken,
("Limit" .=) <$> _dcaLimit,
("ConfigurationAggregatorNames" .=) <$>
_dcaConfigurationAggregatorNames])
instance ToPath DescribeConfigurationAggregators
where
toPath = const "/"
instance ToQuery DescribeConfigurationAggregators
where
toQuery = const mempty
data DescribeConfigurationAggregatorsResponse = DescribeConfigurationAggregatorsResponse'
{ _dcarsNextToken :: !(Maybe Text)
, _dcarsConfigurationAggregators :: !(Maybe [ConfigurationAggregator])
, _dcarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeConfigurationAggregatorsResponse
:: Int
-> DescribeConfigurationAggregatorsResponse
describeConfigurationAggregatorsResponse pResponseStatus_ =
DescribeConfigurationAggregatorsResponse'
{ _dcarsNextToken = Nothing
, _dcarsConfigurationAggregators = Nothing
, _dcarsResponseStatus = pResponseStatus_
}
dcarsNextToken :: Lens' DescribeConfigurationAggregatorsResponse (Maybe Text)
dcarsNextToken = lens _dcarsNextToken (\ s a -> s{_dcarsNextToken = a})
dcarsConfigurationAggregators :: Lens' DescribeConfigurationAggregatorsResponse [ConfigurationAggregator]
dcarsConfigurationAggregators = lens _dcarsConfigurationAggregators (\ s a -> s{_dcarsConfigurationAggregators = a}) . _Default . _Coerce
dcarsResponseStatus :: Lens' DescribeConfigurationAggregatorsResponse Int
dcarsResponseStatus = lens _dcarsResponseStatus (\ s a -> s{_dcarsResponseStatus = a})
instance NFData
DescribeConfigurationAggregatorsResponse
where