module Network.AWS.CognitoSync.ListIdentityPoolUsage
(
ListIdentityPoolUsage
, listIdentityPoolUsage
, lipuMaxResults
, lipuNextToken
, ListIdentityPoolUsageResponse
, listIdentityPoolUsageResponse
, lipurCount
, lipurIdentityPoolUsages
, lipurMaxResults
, lipurNextToken
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestJSON
import Network.AWS.CognitoSync.Types
import qualified GHC.Exts
data ListIdentityPoolUsage = ListIdentityPoolUsage
{ _lipuMaxResults :: Maybe Int
, _lipuNextToken :: Maybe Text
} deriving (Eq, Ord, Read, Show)
listIdentityPoolUsage :: ListIdentityPoolUsage
listIdentityPoolUsage = ListIdentityPoolUsage
{ _lipuNextToken = Nothing
, _lipuMaxResults = Nothing
}
lipuMaxResults :: Lens' ListIdentityPoolUsage (Maybe Int)
lipuMaxResults = lens _lipuMaxResults (\s a -> s { _lipuMaxResults = a })
lipuNextToken :: Lens' ListIdentityPoolUsage (Maybe Text)
lipuNextToken = lens _lipuNextToken (\s a -> s { _lipuNextToken = a })
data ListIdentityPoolUsageResponse = ListIdentityPoolUsageResponse
{ _lipurCount :: Maybe Int
, _lipurIdentityPoolUsages :: List "IdentityPoolUsages" IdentityPoolUsage
, _lipurMaxResults :: Maybe Int
, _lipurNextToken :: Maybe Text
} deriving (Eq, Read, Show)
listIdentityPoolUsageResponse :: ListIdentityPoolUsageResponse
listIdentityPoolUsageResponse = ListIdentityPoolUsageResponse
{ _lipurIdentityPoolUsages = mempty
, _lipurMaxResults = Nothing
, _lipurCount = Nothing
, _lipurNextToken = Nothing
}
lipurCount :: Lens' ListIdentityPoolUsageResponse (Maybe Int)
lipurCount = lens _lipurCount (\s a -> s { _lipurCount = a })
lipurIdentityPoolUsages :: Lens' ListIdentityPoolUsageResponse [IdentityPoolUsage]
lipurIdentityPoolUsages =
lens _lipurIdentityPoolUsages (\s a -> s { _lipurIdentityPoolUsages = a })
. _List
lipurMaxResults :: Lens' ListIdentityPoolUsageResponse (Maybe Int)
lipurMaxResults = lens _lipurMaxResults (\s a -> s { _lipurMaxResults = a })
lipurNextToken :: Lens' ListIdentityPoolUsageResponse (Maybe Text)
lipurNextToken = lens _lipurNextToken (\s a -> s { _lipurNextToken = a })
instance ToPath ListIdentityPoolUsage where
toPath = const "/identitypools"
instance ToQuery ListIdentityPoolUsage where
toQuery ListIdentityPoolUsage{..} = mconcat
[ "maxResults" =? _lipuMaxResults
, "nextToken" =? _lipuNextToken
]
instance ToHeaders ListIdentityPoolUsage
instance ToJSON ListIdentityPoolUsage where
toJSON = const (toJSON Empty)
instance AWSRequest ListIdentityPoolUsage where
type Sv ListIdentityPoolUsage = CognitoSync
type Rs ListIdentityPoolUsage = ListIdentityPoolUsageResponse
request = get
response = jsonResponse
instance FromJSON ListIdentityPoolUsageResponse where
parseJSON = withObject "ListIdentityPoolUsageResponse" $ \o -> ListIdentityPoolUsageResponse
<$> o .:? "Count"
<*> o .:? "IdentityPoolUsages" .!= mempty
<*> o .:? "MaxResults"
<*> o .:? "NextToken"