{-# 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.PutConfigurationAggregator
(
putConfigurationAggregator
, PutConfigurationAggregator
, pcaOrganizationAggregationSource
, pcaAccountAggregationSources
, pcaConfigurationAggregatorName
, putConfigurationAggregatorResponse
, PutConfigurationAggregatorResponse
, pcarsConfigurationAggregator
, pcarsResponseStatus
) 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 PutConfigurationAggregator = PutConfigurationAggregator'
{ _pcaOrganizationAggregationSource :: !(Maybe OrganizationAggregationSource)
, _pcaAccountAggregationSources :: !(Maybe [AccountAggregationSource])
, _pcaConfigurationAggregatorName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putConfigurationAggregator
:: Text
-> PutConfigurationAggregator
putConfigurationAggregator pConfigurationAggregatorName_ =
PutConfigurationAggregator'
{ _pcaOrganizationAggregationSource = Nothing
, _pcaAccountAggregationSources = Nothing
, _pcaConfigurationAggregatorName = pConfigurationAggregatorName_
}
pcaOrganizationAggregationSource :: Lens' PutConfigurationAggregator (Maybe OrganizationAggregationSource)
pcaOrganizationAggregationSource = lens _pcaOrganizationAggregationSource (\ s a -> s{_pcaOrganizationAggregationSource = a})
pcaAccountAggregationSources :: Lens' PutConfigurationAggregator [AccountAggregationSource]
pcaAccountAggregationSources = lens _pcaAccountAggregationSources (\ s a -> s{_pcaAccountAggregationSources = a}) . _Default . _Coerce
pcaConfigurationAggregatorName :: Lens' PutConfigurationAggregator Text
pcaConfigurationAggregatorName = lens _pcaConfigurationAggregatorName (\ s a -> s{_pcaConfigurationAggregatorName = a})
instance AWSRequest PutConfigurationAggregator where
type Rs PutConfigurationAggregator =
PutConfigurationAggregatorResponse
request = postJSON config
response
= receiveJSON
(\ s h x ->
PutConfigurationAggregatorResponse' <$>
(x .?> "ConfigurationAggregator") <*>
(pure (fromEnum s)))
instance Hashable PutConfigurationAggregator where
instance NFData PutConfigurationAggregator where
instance ToHeaders PutConfigurationAggregator where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.PutConfigurationAggregator" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON PutConfigurationAggregator where
toJSON PutConfigurationAggregator'{..}
= object
(catMaybes
[("OrganizationAggregationSource" .=) <$>
_pcaOrganizationAggregationSource,
("AccountAggregationSources" .=) <$>
_pcaAccountAggregationSources,
Just
("ConfigurationAggregatorName" .=
_pcaConfigurationAggregatorName)])
instance ToPath PutConfigurationAggregator where
toPath = const "/"
instance ToQuery PutConfigurationAggregator where
toQuery = const mempty
data PutConfigurationAggregatorResponse = PutConfigurationAggregatorResponse'
{ _pcarsConfigurationAggregator :: !(Maybe ConfigurationAggregator)
, _pcarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putConfigurationAggregatorResponse
:: Int
-> PutConfigurationAggregatorResponse
putConfigurationAggregatorResponse pResponseStatus_ =
PutConfigurationAggregatorResponse'
{ _pcarsConfigurationAggregator = Nothing
, _pcarsResponseStatus = pResponseStatus_
}
pcarsConfigurationAggregator :: Lens' PutConfigurationAggregatorResponse (Maybe ConfigurationAggregator)
pcarsConfigurationAggregator = lens _pcarsConfigurationAggregator (\ s a -> s{_pcarsConfigurationAggregator = a})
pcarsResponseStatus :: Lens' PutConfigurationAggregatorResponse Int
pcarsResponseStatus = lens _pcarsResponseStatus (\ s a -> s{_pcarsResponseStatus = a})
instance NFData PutConfigurationAggregatorResponse
where