{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CognitoIdentityProvider.ListIdentityProviders
(
ListIdentityProviders (..),
newListIdentityProviders,
listIdentityProviders_maxResults,
listIdentityProviders_nextToken,
listIdentityProviders_userPoolId,
ListIdentityProvidersResponse (..),
newListIdentityProvidersResponse,
listIdentityProvidersResponse_nextToken,
listIdentityProvidersResponse_httpStatus,
listIdentityProvidersResponse_providers,
)
where
import Amazonka.CognitoIdentityProvider.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListIdentityProviders = ListIdentityProviders'
{
ListIdentityProviders -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListIdentityProviders -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListIdentityProviders -> Text
userPoolId :: Prelude.Text
}
deriving (ListIdentityProviders -> ListIdentityProviders -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIdentityProviders -> ListIdentityProviders -> Bool
$c/= :: ListIdentityProviders -> ListIdentityProviders -> Bool
== :: ListIdentityProviders -> ListIdentityProviders -> Bool
$c== :: ListIdentityProviders -> ListIdentityProviders -> Bool
Prelude.Eq, ReadPrec [ListIdentityProviders]
ReadPrec ListIdentityProviders
Int -> ReadS ListIdentityProviders
ReadS [ListIdentityProviders]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIdentityProviders]
$creadListPrec :: ReadPrec [ListIdentityProviders]
readPrec :: ReadPrec ListIdentityProviders
$creadPrec :: ReadPrec ListIdentityProviders
readList :: ReadS [ListIdentityProviders]
$creadList :: ReadS [ListIdentityProviders]
readsPrec :: Int -> ReadS ListIdentityProviders
$creadsPrec :: Int -> ReadS ListIdentityProviders
Prelude.Read, Int -> ListIdentityProviders -> ShowS
[ListIdentityProviders] -> ShowS
ListIdentityProviders -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIdentityProviders] -> ShowS
$cshowList :: [ListIdentityProviders] -> ShowS
show :: ListIdentityProviders -> String
$cshow :: ListIdentityProviders -> String
showsPrec :: Int -> ListIdentityProviders -> ShowS
$cshowsPrec :: Int -> ListIdentityProviders -> ShowS
Prelude.Show, forall x. Rep ListIdentityProviders x -> ListIdentityProviders
forall x. ListIdentityProviders -> Rep ListIdentityProviders x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIdentityProviders x -> ListIdentityProviders
$cfrom :: forall x. ListIdentityProviders -> Rep ListIdentityProviders x
Prelude.Generic)
newListIdentityProviders ::
Prelude.Text ->
ListIdentityProviders
newListIdentityProviders :: Text -> ListIdentityProviders
newListIdentityProviders Text
pUserPoolId_ =
ListIdentityProviders'
{ $sel:maxResults:ListIdentityProviders' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListIdentityProviders' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:userPoolId:ListIdentityProviders' :: Text
userPoolId = Text
pUserPoolId_
}
listIdentityProviders_maxResults :: Lens.Lens' ListIdentityProviders (Prelude.Maybe Prelude.Natural)
listIdentityProviders_maxResults :: Lens' ListIdentityProviders (Maybe Natural)
listIdentityProviders_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProviders' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListIdentityProviders' :: ListIdentityProviders -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListIdentityProviders
s@ListIdentityProviders' {} Maybe Natural
a -> ListIdentityProviders
s {$sel:maxResults:ListIdentityProviders' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListIdentityProviders)
listIdentityProviders_nextToken :: Lens.Lens' ListIdentityProviders (Prelude.Maybe Prelude.Text)
listIdentityProviders_nextToken :: Lens' ListIdentityProviders (Maybe Text)
listIdentityProviders_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProviders' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIdentityProviders' :: ListIdentityProviders -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIdentityProviders
s@ListIdentityProviders' {} Maybe Text
a -> ListIdentityProviders
s {$sel:nextToken:ListIdentityProviders' :: Maybe Text
nextToken = Maybe Text
a} :: ListIdentityProviders)
listIdentityProviders_userPoolId :: Lens.Lens' ListIdentityProviders Prelude.Text
listIdentityProviders_userPoolId :: Lens' ListIdentityProviders Text
listIdentityProviders_userPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProviders' {Text
userPoolId :: Text
$sel:userPoolId:ListIdentityProviders' :: ListIdentityProviders -> Text
userPoolId} -> Text
userPoolId) (\s :: ListIdentityProviders
s@ListIdentityProviders' {} Text
a -> ListIdentityProviders
s {$sel:userPoolId:ListIdentityProviders' :: Text
userPoolId = Text
a} :: ListIdentityProviders)
instance Core.AWSPager ListIdentityProviders where
page :: ListIdentityProviders
-> AWSResponse ListIdentityProviders -> Maybe ListIdentityProviders
page ListIdentityProviders
rq AWSResponse ListIdentityProviders
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListIdentityProviders
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListIdentityProvidersResponse (Maybe Text)
listIdentityProvidersResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
(AWSResponse ListIdentityProviders
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListIdentityProvidersResponse [ProviderDescription]
listIdentityProvidersResponse_providers) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListIdentityProviders
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListIdentityProviders (Maybe Text)
listIdentityProviders_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListIdentityProviders
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListIdentityProvidersResponse (Maybe Text)
listIdentityProvidersResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListIdentityProviders where
type
AWSResponse ListIdentityProviders =
ListIdentityProvidersResponse
request :: (Service -> Service)
-> ListIdentityProviders -> Request ListIdentityProviders
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListIdentityProviders
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListIdentityProviders)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Int -> [ProviderDescription] -> ListIdentityProvidersResponse
ListIdentityProvidersResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Providers" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListIdentityProviders where
hashWithSalt :: Int -> ListIdentityProviders -> Int
hashWithSalt Int
_salt ListIdentityProviders' {Maybe Natural
Maybe Text
Text
userPoolId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:userPoolId:ListIdentityProviders' :: ListIdentityProviders -> Text
$sel:nextToken:ListIdentityProviders' :: ListIdentityProviders -> Maybe Text
$sel:maxResults:ListIdentityProviders' :: ListIdentityProviders -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userPoolId
instance Prelude.NFData ListIdentityProviders where
rnf :: ListIdentityProviders -> ()
rnf ListIdentityProviders' {Maybe Natural
Maybe Text
Text
userPoolId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:userPoolId:ListIdentityProviders' :: ListIdentityProviders -> Text
$sel:nextToken:ListIdentityProviders' :: ListIdentityProviders -> Maybe Text
$sel:maxResults:ListIdentityProviders' :: ListIdentityProviders -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userPoolId
instance Data.ToHeaders ListIdentityProviders where
toHeaders :: ListIdentityProviders -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSCognitoIdentityProviderService.ListIdentityProviders" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListIdentityProviders where
toJSON :: ListIdentityProviders -> Value
toJSON ListIdentityProviders' {Maybe Natural
Maybe Text
Text
userPoolId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:userPoolId:ListIdentityProviders' :: ListIdentityProviders -> Text
$sel:nextToken:ListIdentityProviders' :: ListIdentityProviders -> Maybe Text
$sel:maxResults:ListIdentityProviders' :: ListIdentityProviders -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
forall a. a -> Maybe a
Prelude.Just (Key
"UserPoolId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
userPoolId)
]
)
instance Data.ToPath ListIdentityProviders where
toPath :: ListIdentityProviders -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListIdentityProviders where
toQuery :: ListIdentityProviders -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListIdentityProvidersResponse = ListIdentityProvidersResponse'
{
ListIdentityProvidersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListIdentityProvidersResponse -> Int
httpStatus :: Prelude.Int,
ListIdentityProvidersResponse -> [ProviderDescription]
providers :: [ProviderDescription]
}
deriving (ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
$c/= :: ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
== :: ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
$c== :: ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
Prelude.Eq, ReadPrec [ListIdentityProvidersResponse]
ReadPrec ListIdentityProvidersResponse
Int -> ReadS ListIdentityProvidersResponse
ReadS [ListIdentityProvidersResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIdentityProvidersResponse]
$creadListPrec :: ReadPrec [ListIdentityProvidersResponse]
readPrec :: ReadPrec ListIdentityProvidersResponse
$creadPrec :: ReadPrec ListIdentityProvidersResponse
readList :: ReadS [ListIdentityProvidersResponse]
$creadList :: ReadS [ListIdentityProvidersResponse]
readsPrec :: Int -> ReadS ListIdentityProvidersResponse
$creadsPrec :: Int -> ReadS ListIdentityProvidersResponse
Prelude.Read, Int -> ListIdentityProvidersResponse -> ShowS
[ListIdentityProvidersResponse] -> ShowS
ListIdentityProvidersResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIdentityProvidersResponse] -> ShowS
$cshowList :: [ListIdentityProvidersResponse] -> ShowS
show :: ListIdentityProvidersResponse -> String
$cshow :: ListIdentityProvidersResponse -> String
showsPrec :: Int -> ListIdentityProvidersResponse -> ShowS
$cshowsPrec :: Int -> ListIdentityProvidersResponse -> ShowS
Prelude.Show, forall x.
Rep ListIdentityProvidersResponse x
-> ListIdentityProvidersResponse
forall x.
ListIdentityProvidersResponse
-> Rep ListIdentityProvidersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListIdentityProvidersResponse x
-> ListIdentityProvidersResponse
$cfrom :: forall x.
ListIdentityProvidersResponse
-> Rep ListIdentityProvidersResponse x
Prelude.Generic)
newListIdentityProvidersResponse ::
Prelude.Int ->
ListIdentityProvidersResponse
newListIdentityProvidersResponse :: Int -> ListIdentityProvidersResponse
newListIdentityProvidersResponse Int
pHttpStatus_ =
ListIdentityProvidersResponse'
{ $sel:nextToken:ListIdentityProvidersResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListIdentityProvidersResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:providers:ListIdentityProvidersResponse' :: [ProviderDescription]
providers = forall a. Monoid a => a
Prelude.mempty
}
listIdentityProvidersResponse_nextToken :: Lens.Lens' ListIdentityProvidersResponse (Prelude.Maybe Prelude.Text)
listIdentityProvidersResponse_nextToken :: Lens' ListIdentityProvidersResponse (Maybe Text)
listIdentityProvidersResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProvidersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListIdentityProvidersResponse
s@ListIdentityProvidersResponse' {} Maybe Text
a -> ListIdentityProvidersResponse
s {$sel:nextToken:ListIdentityProvidersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListIdentityProvidersResponse)
listIdentityProvidersResponse_httpStatus :: Lens.Lens' ListIdentityProvidersResponse Prelude.Int
listIdentityProvidersResponse_httpStatus :: Lens' ListIdentityProvidersResponse Int
listIdentityProvidersResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProvidersResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListIdentityProvidersResponse
s@ListIdentityProvidersResponse' {} Int
a -> ListIdentityProvidersResponse
s {$sel:httpStatus:ListIdentityProvidersResponse' :: Int
httpStatus = Int
a} :: ListIdentityProvidersResponse)
listIdentityProvidersResponse_providers :: Lens.Lens' ListIdentityProvidersResponse [ProviderDescription]
listIdentityProvidersResponse_providers :: Lens' ListIdentityProvidersResponse [ProviderDescription]
listIdentityProvidersResponse_providers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIdentityProvidersResponse' {[ProviderDescription]
providers :: [ProviderDescription]
$sel:providers:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> [ProviderDescription]
providers} -> [ProviderDescription]
providers) (\s :: ListIdentityProvidersResponse
s@ListIdentityProvidersResponse' {} [ProviderDescription]
a -> ListIdentityProvidersResponse
s {$sel:providers:ListIdentityProvidersResponse' :: [ProviderDescription]
providers = [ProviderDescription]
a} :: ListIdentityProvidersResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListIdentityProvidersResponse where
rnf :: ListIdentityProvidersResponse -> ()
rnf ListIdentityProvidersResponse' {Int
[ProviderDescription]
Maybe Text
providers :: [ProviderDescription]
httpStatus :: Int
nextToken :: Maybe Text
$sel:providers:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> [ProviderDescription]
$sel:httpStatus:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> Int
$sel:nextToken:ListIdentityProvidersResponse' :: ListIdentityProvidersResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ProviderDescription]
providers