{-# 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.PutAggregationAuthorization
(
putAggregationAuthorization
, PutAggregationAuthorization
, paaAuthorizedAccountId
, paaAuthorizedAWSRegion
, putAggregationAuthorizationResponse
, PutAggregationAuthorizationResponse
, paarsAggregationAuthorization
, paarsResponseStatus
) 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 PutAggregationAuthorization = PutAggregationAuthorization'
{ _paaAuthorizedAccountId :: !Text
, _paaAuthorizedAWSRegion :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putAggregationAuthorization
:: Text
-> Text
-> PutAggregationAuthorization
putAggregationAuthorization pAuthorizedAccountId_ pAuthorizedAWSRegion_ =
PutAggregationAuthorization'
{ _paaAuthorizedAccountId = pAuthorizedAccountId_
, _paaAuthorizedAWSRegion = pAuthorizedAWSRegion_
}
paaAuthorizedAccountId :: Lens' PutAggregationAuthorization Text
paaAuthorizedAccountId = lens _paaAuthorizedAccountId (\ s a -> s{_paaAuthorizedAccountId = a})
paaAuthorizedAWSRegion :: Lens' PutAggregationAuthorization Text
paaAuthorizedAWSRegion = lens _paaAuthorizedAWSRegion (\ s a -> s{_paaAuthorizedAWSRegion = a})
instance AWSRequest PutAggregationAuthorization where
type Rs PutAggregationAuthorization =
PutAggregationAuthorizationResponse
request = postJSON config
response
= receiveJSON
(\ s h x ->
PutAggregationAuthorizationResponse' <$>
(x .?> "AggregationAuthorization") <*>
(pure (fromEnum s)))
instance Hashable PutAggregationAuthorization where
instance NFData PutAggregationAuthorization where
instance ToHeaders PutAggregationAuthorization where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.PutAggregationAuthorization" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON PutAggregationAuthorization where
toJSON PutAggregationAuthorization'{..}
= object
(catMaybes
[Just
("AuthorizedAccountId" .= _paaAuthorizedAccountId),
Just
("AuthorizedAwsRegion" .= _paaAuthorizedAWSRegion)])
instance ToPath PutAggregationAuthorization where
toPath = const "/"
instance ToQuery PutAggregationAuthorization where
toQuery = const mempty
data PutAggregationAuthorizationResponse = PutAggregationAuthorizationResponse'
{ _paarsAggregationAuthorization :: !(Maybe AggregationAuthorization)
, _paarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
putAggregationAuthorizationResponse
:: Int
-> PutAggregationAuthorizationResponse
putAggregationAuthorizationResponse pResponseStatus_ =
PutAggregationAuthorizationResponse'
{ _paarsAggregationAuthorization = Nothing
, _paarsResponseStatus = pResponseStatus_
}
paarsAggregationAuthorization :: Lens' PutAggregationAuthorizationResponse (Maybe AggregationAuthorization)
paarsAggregationAuthorization = lens _paarsAggregationAuthorization (\ s a -> s{_paarsAggregationAuthorization = a})
paarsResponseStatus :: Lens' PutAggregationAuthorizationResponse Int
paarsResponseStatus = lens _paarsResponseStatus (\ s a -> s{_paarsResponseStatus = a})
instance NFData PutAggregationAuthorizationResponse
where