module Network.AWS.CognitoSync.ListIdentityPoolUsage
(
listIdentityPoolUsage
, ListIdentityPoolUsage
, lipuNextToken
, lipuMaxResults
, listIdentityPoolUsageResponse
, ListIdentityPoolUsageResponse
, lipursIdentityPoolUsages
, lipursCount
, lipursNextToken
, lipursMaxResults
, lipursResponseStatus
) where
import Network.AWS.CognitoSync.Types
import Network.AWS.CognitoSync.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data ListIdentityPoolUsage = ListIdentityPoolUsage'
{ _lipuNextToken :: !(Maybe Text)
, _lipuMaxResults :: !(Maybe Int)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listIdentityPoolUsage
:: ListIdentityPoolUsage
listIdentityPoolUsage =
ListIdentityPoolUsage'
{ _lipuNextToken = Nothing
, _lipuMaxResults = Nothing
}
lipuNextToken :: Lens' ListIdentityPoolUsage (Maybe Text)
lipuNextToken = lens _lipuNextToken (\ s a -> s{_lipuNextToken = a});
lipuMaxResults :: Lens' ListIdentityPoolUsage (Maybe Int)
lipuMaxResults = lens _lipuMaxResults (\ s a -> s{_lipuMaxResults = a});
instance AWSRequest ListIdentityPoolUsage where
type Rs ListIdentityPoolUsage =
ListIdentityPoolUsageResponse
request = get cognitoSync
response
= receiveJSON
(\ s h x ->
ListIdentityPoolUsageResponse' <$>
(x .?> "IdentityPoolUsages" .!@ mempty) <*>
(x .?> "Count")
<*> (x .?> "NextToken")
<*> (x .?> "MaxResults")
<*> (pure (fromEnum s)))
instance ToHeaders ListIdentityPoolUsage where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath ListIdentityPoolUsage where
toPath = const "/identitypools"
instance ToQuery ListIdentityPoolUsage where
toQuery ListIdentityPoolUsage'{..}
= mconcat
["nextToken" =: _lipuNextToken,
"maxResults" =: _lipuMaxResults]
data ListIdentityPoolUsageResponse = ListIdentityPoolUsageResponse'
{ _lipursIdentityPoolUsages :: !(Maybe [IdentityPoolUsage])
, _lipursCount :: !(Maybe Int)
, _lipursNextToken :: !(Maybe Text)
, _lipursMaxResults :: !(Maybe Int)
, _lipursResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
listIdentityPoolUsageResponse
:: Int
-> ListIdentityPoolUsageResponse
listIdentityPoolUsageResponse pResponseStatus_ =
ListIdentityPoolUsageResponse'
{ _lipursIdentityPoolUsages = Nothing
, _lipursCount = Nothing
, _lipursNextToken = Nothing
, _lipursMaxResults = Nothing
, _lipursResponseStatus = pResponseStatus_
}
lipursIdentityPoolUsages :: Lens' ListIdentityPoolUsageResponse [IdentityPoolUsage]
lipursIdentityPoolUsages = lens _lipursIdentityPoolUsages (\ s a -> s{_lipursIdentityPoolUsages = a}) . _Default . _Coerce;
lipursCount :: Lens' ListIdentityPoolUsageResponse (Maybe Int)
lipursCount = lens _lipursCount (\ s a -> s{_lipursCount = a});
lipursNextToken :: Lens' ListIdentityPoolUsageResponse (Maybe Text)
lipursNextToken = lens _lipursNextToken (\ s a -> s{_lipursNextToken = a});
lipursMaxResults :: Lens' ListIdentityPoolUsageResponse (Maybe Int)
lipursMaxResults = lens _lipursMaxResults (\ s a -> s{_lipursMaxResults = a});
lipursResponseStatus :: Lens' ListIdentityPoolUsageResponse Int
lipursResponseStatus = lens _lipursResponseStatus (\ s a -> s{_lipursResponseStatus = a});