module Network.AWS.CognitoIdentity.ListIdentityPools
(
ListIdentityPools
, listIdentityPools
, lipMaxResults
, lipNextToken
, ListIdentityPoolsResponse
, listIdentityPoolsResponse
, liprIdentityPools
, liprNextToken
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CognitoIdentity.Types
import qualified GHC.Exts
data ListIdentityPools = ListIdentityPools
{ _lipMaxResults :: Nat
, _lipNextToken :: Maybe Text
} deriving (Eq, Ord, Show)
listIdentityPools :: Natural
-> ListIdentityPools
listIdentityPools p1 = ListIdentityPools
{ _lipMaxResults = withIso _Nat (const id) p1
, _lipNextToken = Nothing
}
lipMaxResults :: Lens' ListIdentityPools Natural
lipMaxResults = lens _lipMaxResults (\s a -> s { _lipMaxResults = a }) . _Nat
lipNextToken :: Lens' ListIdentityPools (Maybe Text)
lipNextToken = lens _lipNextToken (\s a -> s { _lipNextToken = a })
data ListIdentityPoolsResponse = ListIdentityPoolsResponse
{ _liprIdentityPools :: List "IdentityPools" IdentityPoolShortDescription
, _liprNextToken :: Maybe Text
} deriving (Eq, Show)
listIdentityPoolsResponse :: ListIdentityPoolsResponse
listIdentityPoolsResponse = ListIdentityPoolsResponse
{ _liprIdentityPools = mempty
, _liprNextToken = Nothing
}
liprIdentityPools :: Lens' ListIdentityPoolsResponse [IdentityPoolShortDescription]
liprIdentityPools =
lens _liprIdentityPools (\s a -> s { _liprIdentityPools = a })
. _List
liprNextToken :: Lens' ListIdentityPoolsResponse (Maybe Text)
liprNextToken = lens _liprNextToken (\s a -> s { _liprNextToken = a })
instance ToPath ListIdentityPools where
toPath = const "/"
instance ToQuery ListIdentityPools where
toQuery = const mempty
instance ToHeaders ListIdentityPools
instance ToJSON ListIdentityPools where
toJSON ListIdentityPools{..} = object
[ "MaxResults" .= _lipMaxResults
, "NextToken" .= _lipNextToken
]
instance AWSRequest ListIdentityPools where
type Sv ListIdentityPools = CognitoIdentity
type Rs ListIdentityPools = ListIdentityPoolsResponse
request = post "ListIdentityPools"
response = jsonResponse
instance FromJSON ListIdentityPoolsResponse where
parseJSON = withObject "ListIdentityPoolsResponse" $ \o -> ListIdentityPoolsResponse
<$> o .: "IdentityPools"
<*> o .:? "NextToken"