{-# 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.DescribeAggregationAuthorizations
(
describeAggregationAuthorizations
, DescribeAggregationAuthorizations
, daaNextToken
, daaLimit
, describeAggregationAuthorizationsResponse
, DescribeAggregationAuthorizationsResponse
, daarsAggregationAuthorizations
, daarsNextToken
, daarsResponseStatus
) 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 DescribeAggregationAuthorizations = DescribeAggregationAuthorizations'
{ _daaNextToken :: !(Maybe Text)
, _daaLimit :: !(Maybe Nat)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeAggregationAuthorizations
:: DescribeAggregationAuthorizations
describeAggregationAuthorizations =
DescribeAggregationAuthorizations'
{_daaNextToken = Nothing, _daaLimit = Nothing}
daaNextToken :: Lens' DescribeAggregationAuthorizations (Maybe Text)
daaNextToken = lens _daaNextToken (\ s a -> s{_daaNextToken = a})
daaLimit :: Lens' DescribeAggregationAuthorizations (Maybe Natural)
daaLimit = lens _daaLimit (\ s a -> s{_daaLimit = a}) . mapping _Nat
instance AWSRequest DescribeAggregationAuthorizations
where
type Rs DescribeAggregationAuthorizations =
DescribeAggregationAuthorizationsResponse
request = postJSON config
response
= receiveJSON
(\ s h x ->
DescribeAggregationAuthorizationsResponse' <$>
(x .?> "AggregationAuthorizations" .!@ mempty) <*>
(x .?> "NextToken")
<*> (pure (fromEnum s)))
instance Hashable DescribeAggregationAuthorizations
where
instance NFData DescribeAggregationAuthorizations
where
instance ToHeaders DescribeAggregationAuthorizations
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("StarlingDoveService.DescribeAggregationAuthorizations"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DescribeAggregationAuthorizations
where
toJSON DescribeAggregationAuthorizations'{..}
= object
(catMaybes
[("NextToken" .=) <$> _daaNextToken,
("Limit" .=) <$> _daaLimit])
instance ToPath DescribeAggregationAuthorizations
where
toPath = const "/"
instance ToQuery DescribeAggregationAuthorizations
where
toQuery = const mempty
data DescribeAggregationAuthorizationsResponse = DescribeAggregationAuthorizationsResponse'
{ _daarsAggregationAuthorizations :: !(Maybe [AggregationAuthorization])
, _daarsNextToken :: !(Maybe Text)
, _daarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeAggregationAuthorizationsResponse
:: Int
-> DescribeAggregationAuthorizationsResponse
describeAggregationAuthorizationsResponse pResponseStatus_ =
DescribeAggregationAuthorizationsResponse'
{ _daarsAggregationAuthorizations = Nothing
, _daarsNextToken = Nothing
, _daarsResponseStatus = pResponseStatus_
}
daarsAggregationAuthorizations :: Lens' DescribeAggregationAuthorizationsResponse [AggregationAuthorization]
daarsAggregationAuthorizations = lens _daarsAggregationAuthorizations (\ s a -> s{_daarsAggregationAuthorizations = a}) . _Default . _Coerce
daarsNextToken :: Lens' DescribeAggregationAuthorizationsResponse (Maybe Text)
daarsNextToken = lens _daarsNextToken (\ s a -> s{_daarsNextToken = a})
daarsResponseStatus :: Lens' DescribeAggregationAuthorizationsResponse Int
daarsResponseStatus = lens _daarsResponseStatus (\ s a -> s{_daarsResponseStatus = a})
instance NFData
DescribeAggregationAuthorizationsResponse
where