{-# 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.DescribePendingAggregationRequests
(
describePendingAggregationRequests
, DescribePendingAggregationRequests
, dparNextToken
, dparLimit
, describePendingAggregationRequestsResponse
, DescribePendingAggregationRequestsResponse
, dparrsNextToken
, dparrsPendingAggregationRequests
, dparrsResponseStatus
) 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 DescribePendingAggregationRequests = DescribePendingAggregationRequests'
{ _dparNextToken :: !(Maybe Text)
, _dparLimit :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describePendingAggregationRequests
:: DescribePendingAggregationRequests
describePendingAggregationRequests =
DescribePendingAggregationRequests'
{_dparNextToken = Nothing, _dparLimit = Nothing}
dparNextToken :: Lens' DescribePendingAggregationRequests (Maybe Text)
dparNextToken = lens _dparNextToken (\ s a -> s{_dparNextToken = a})
dparLimit :: Lens' DescribePendingAggregationRequests (Maybe Natural)
dparLimit = lens _dparLimit (\ s a -> s{_dparLimit = a}) . mapping _Nat
instance AWSRequest
DescribePendingAggregationRequests
where
type Rs DescribePendingAggregationRequests =
DescribePendingAggregationRequestsResponse
request = postJSON config
response
= receiveJSON
(\ s h x ->
DescribePendingAggregationRequestsResponse' <$>
(x .?> "NextToken") <*>
(x .?> "PendingAggregationRequests" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable DescribePendingAggregationRequests
where
instance NFData DescribePendingAggregationRequests
where
instance ToHeaders DescribePendingAggregationRequests
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.DescribePendingAggregationRequests"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribePendingAggregationRequests
where
toJSON DescribePendingAggregationRequests'{..}
= object
(catMaybes
[("NextToken" .=) <$> _dparNextToken,
("Limit" .=) <$> _dparLimit])
instance ToPath DescribePendingAggregationRequests
where
toPath = const "/"
instance ToQuery DescribePendingAggregationRequests
where
toQuery = const mempty
data DescribePendingAggregationRequestsResponse = DescribePendingAggregationRequestsResponse'
{ _dparrsNextToken :: !(Maybe Text)
, _dparrsPendingAggregationRequests :: !(Maybe [PendingAggregationRequest])
, _dparrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describePendingAggregationRequestsResponse
:: Int
-> DescribePendingAggregationRequestsResponse
describePendingAggregationRequestsResponse pResponseStatus_ =
DescribePendingAggregationRequestsResponse'
{ _dparrsNextToken = Nothing
, _dparrsPendingAggregationRequests = Nothing
, _dparrsResponseStatus = pResponseStatus_
}
dparrsNextToken :: Lens' DescribePendingAggregationRequestsResponse (Maybe Text)
dparrsNextToken = lens _dparrsNextToken (\ s a -> s{_dparrsNextToken = a})
dparrsPendingAggregationRequests :: Lens' DescribePendingAggregationRequestsResponse [PendingAggregationRequest]
dparrsPendingAggregationRequests = lens _dparrsPendingAggregationRequests (\ s a -> s{_dparrsPendingAggregationRequests = a}) . _Default . _Coerce
dparrsResponseStatus :: Lens' DescribePendingAggregationRequestsResponse Int
dparrsResponseStatus = lens _dparrsResponseStatus (\ s a -> s{_dparrsResponseStatus = a})
instance NFData
DescribePendingAggregationRequestsResponse
where