{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CognitoIdentityProvider.ListIdentityProviders
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists information about all identity providers for a user pool.
--
-- This operation returns paginated results.
module Amazonka.CognitoIdentityProvider.ListIdentityProviders
  ( -- * Creating a Request
    ListIdentityProviders (..),
    newListIdentityProviders,

    -- * Request Lenses
    listIdentityProviders_nextToken,
    listIdentityProviders_maxResults,
    listIdentityProviders_userPoolId,

    -- * Destructuring the Response
    ListIdentityProvidersResponse (..),
    newListIdentityProvidersResponse,

    -- * Response Lenses
    listIdentityProvidersResponse_nextToken,
    listIdentityProvidersResponse_httpStatus,
    listIdentityProvidersResponse_providers,
  )
where

import Amazonka.CognitoIdentityProvider.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListIdentityProviders' smart constructor.
data ListIdentityProviders = ListIdentityProviders'
  { -- | A pagination token.
    ListIdentityProviders -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of identity providers to return.
    ListIdentityProviders -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The user pool ID.
    ListIdentityProviders -> Text
userPoolId :: Prelude.Text
  }
  deriving (ListIdentityProviders -> ListIdentityProviders -> Bool
(ListIdentityProviders -> ListIdentityProviders -> Bool)
-> (ListIdentityProviders -> ListIdentityProviders -> Bool)
-> Eq ListIdentityProviders
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]
(Int -> ReadS ListIdentityProviders)
-> ReadS [ListIdentityProviders]
-> ReadPrec ListIdentityProviders
-> ReadPrec [ListIdentityProviders]
-> Read 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
(Int -> ListIdentityProviders -> ShowS)
-> (ListIdentityProviders -> String)
-> ([ListIdentityProviders] -> ShowS)
-> Show ListIdentityProviders
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. ListIdentityProviders -> Rep ListIdentityProviders x)
-> (forall x. Rep ListIdentityProviders x -> ListIdentityProviders)
-> Generic ListIdentityProviders
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)

-- |
-- Create a value of 'ListIdentityProviders' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listIdentityProviders_nextToken' - A pagination token.
--
-- 'maxResults', 'listIdentityProviders_maxResults' - The maximum number of identity providers to return.
--
-- 'userPoolId', 'listIdentityProviders_userPoolId' - The user pool ID.
newListIdentityProviders ::
  -- | 'userPoolId'
  Prelude.Text ->
  ListIdentityProviders
newListIdentityProviders :: Text -> ListIdentityProviders
newListIdentityProviders Text
pUserPoolId_ =
  ListIdentityProviders' :: Maybe Text -> Maybe Natural -> Text -> ListIdentityProviders
ListIdentityProviders'
    { $sel:nextToken:ListIdentityProviders' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListIdentityProviders' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:ListIdentityProviders' :: Text
userPoolId = Text
pUserPoolId_
    }

-- | A pagination token.
listIdentityProviders_nextToken :: Lens.Lens' ListIdentityProviders (Prelude.Maybe Prelude.Text)
listIdentityProviders_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListIdentityProviders -> f ListIdentityProviders
listIdentityProviders_nextToken = (ListIdentityProviders -> Maybe Text)
-> (ListIdentityProviders -> Maybe Text -> ListIdentityProviders)
-> Lens
     ListIdentityProviders
     ListIdentityProviders
     (Maybe Text)
     (Maybe Text)
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)

-- | The maximum number of identity providers to return.
listIdentityProviders_maxResults :: Lens.Lens' ListIdentityProviders (Prelude.Maybe Prelude.Natural)
listIdentityProviders_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListIdentityProviders -> f ListIdentityProviders
listIdentityProviders_maxResults = (ListIdentityProviders -> Maybe Natural)
-> (ListIdentityProviders
    -> Maybe Natural -> ListIdentityProviders)
-> Lens
     ListIdentityProviders
     ListIdentityProviders
     (Maybe Natural)
     (Maybe Natural)
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)

-- | The user pool ID.
listIdentityProviders_userPoolId :: Lens.Lens' ListIdentityProviders Prelude.Text
listIdentityProviders_userPoolId :: (Text -> f Text)
-> ListIdentityProviders -> f ListIdentityProviders
listIdentityProviders_userPoolId = (ListIdentityProviders -> Text)
-> (ListIdentityProviders -> Text -> ListIdentityProviders)
-> Lens ListIdentityProviders ListIdentityProviders Text Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListIdentityProviders
ListIdentityProvidersResponse
rs
            ListIdentityProvidersResponse
-> Getting (First Text) ListIdentityProvidersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListIdentityProvidersResponse
-> Const (First Text) ListIdentityProvidersResponse
Lens' ListIdentityProvidersResponse (Maybe Text)
listIdentityProvidersResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListIdentityProvidersResponse
 -> Const (First Text) ListIdentityProvidersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListIdentityProvidersResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListIdentityProviders
forall a. Maybe a
Prelude.Nothing
    | [ProviderDescription] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListIdentityProviders
ListIdentityProvidersResponse
rs ListIdentityProvidersResponse
-> Getting
     [ProviderDescription]
     ListIdentityProvidersResponse
     [ProviderDescription]
-> [ProviderDescription]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [ProviderDescription]
  ListIdentityProvidersResponse
  [ProviderDescription]
Lens' ListIdentityProvidersResponse [ProviderDescription]
listIdentityProvidersResponse_providers) =
      Maybe ListIdentityProviders
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListIdentityProviders -> Maybe ListIdentityProviders
forall a. a -> Maybe a
Prelude.Just (ListIdentityProviders -> Maybe ListIdentityProviders)
-> ListIdentityProviders -> Maybe ListIdentityProviders
forall a b. (a -> b) -> a -> b
Prelude.$
        ListIdentityProviders
rq
          ListIdentityProviders
-> (ListIdentityProviders -> ListIdentityProviders)
-> ListIdentityProviders
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListIdentityProviders -> Identity ListIdentityProviders
Lens
  ListIdentityProviders
  ListIdentityProviders
  (Maybe Text)
  (Maybe Text)
listIdentityProviders_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListIdentityProviders -> Identity ListIdentityProviders)
-> Maybe Text -> ListIdentityProviders -> ListIdentityProviders
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListIdentityProviders
ListIdentityProvidersResponse
rs
          ListIdentityProvidersResponse
-> Getting (First Text) ListIdentityProvidersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListIdentityProvidersResponse
-> Const (First Text) ListIdentityProvidersResponse
Lens' ListIdentityProvidersResponse (Maybe Text)
listIdentityProvidersResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListIdentityProvidersResponse
 -> Const (First Text) ListIdentityProvidersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListIdentityProvidersResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListIdentityProviders where
  type
    AWSResponse ListIdentityProviders =
      ListIdentityProvidersResponse
  request :: ListIdentityProviders -> Request ListIdentityProviders
request = Service -> ListIdentityProviders -> Request ListIdentityProviders
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListIdentityProviders
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListIdentityProviders)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListIdentityProviders))
-> Logger
-> Service
-> Proxy ListIdentityProviders
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListIdentityProviders)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> 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'
            (Maybe Text
 -> Int -> [ProviderDescription] -> ListIdentityProvidersResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> [ProviderDescription] -> ListIdentityProvidersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Int -> [ProviderDescription] -> ListIdentityProvidersResponse)
-> Either String Int
-> Either
     String ([ProviderDescription] -> ListIdentityProvidersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String ([ProviderDescription] -> ListIdentityProvidersResponse)
-> Either String [ProviderDescription]
-> Either String ListIdentityProvidersResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [ProviderDescription])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Providers" Either String (Maybe [ProviderDescription])
-> [ProviderDescription] -> Either String [ProviderDescription]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [ProviderDescription]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListIdentityProviders

instance Prelude.NFData ListIdentityProviders

instance Core.ToHeaders ListIdentityProviders where
  toHeaders :: ListIdentityProviders -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListIdentityProviders -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSCognitoIdentityProviderService.ListIdentityProviders" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListIdentityProviders where
  toJSON :: ListIdentityProviders -> Value
toJSON ListIdentityProviders' {Maybe Natural
Maybe Text
Text
userPoolId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:userPoolId:ListIdentityProviders' :: ListIdentityProviders -> Text
$sel:maxResults:ListIdentityProviders' :: ListIdentityProviders -> Maybe Natural
$sel:nextToken:ListIdentityProviders' :: ListIdentityProviders -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPoolId)
          ]
      )

instance Core.ToPath ListIdentityProviders where
  toPath :: ListIdentityProviders -> ByteString
toPath = ByteString -> ListIdentityProviders -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListIdentityProviders where
  toQuery :: ListIdentityProviders -> QueryString
toQuery = QueryString -> ListIdentityProviders -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListIdentityProvidersResponse' smart constructor.
data ListIdentityProvidersResponse = ListIdentityProvidersResponse'
  { -- | A pagination token.
    ListIdentityProvidersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListIdentityProvidersResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of identity provider objects.
    ListIdentityProvidersResponse -> [ProviderDescription]
providers :: [ProviderDescription]
  }
  deriving (ListIdentityProvidersResponse
-> ListIdentityProvidersResponse -> Bool
(ListIdentityProvidersResponse
 -> ListIdentityProvidersResponse -> Bool)
-> (ListIdentityProvidersResponse
    -> ListIdentityProvidersResponse -> Bool)
-> Eq ListIdentityProvidersResponse
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]
(Int -> ReadS ListIdentityProvidersResponse)
-> ReadS [ListIdentityProvidersResponse]
-> ReadPrec ListIdentityProvidersResponse
-> ReadPrec [ListIdentityProvidersResponse]
-> Read 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
(Int -> ListIdentityProvidersResponse -> ShowS)
-> (ListIdentityProvidersResponse -> String)
-> ([ListIdentityProvidersResponse] -> ShowS)
-> Show ListIdentityProvidersResponse
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.
 ListIdentityProvidersResponse
 -> Rep ListIdentityProvidersResponse x)
-> (forall x.
    Rep ListIdentityProvidersResponse x
    -> ListIdentityProvidersResponse)
-> Generic ListIdentityProvidersResponse
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)

-- |
-- Create a value of 'ListIdentityProvidersResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listIdentityProvidersResponse_nextToken' - A pagination token.
--
-- 'httpStatus', 'listIdentityProvidersResponse_httpStatus' - The response's http status code.
--
-- 'providers', 'listIdentityProvidersResponse_providers' - A list of identity provider objects.
newListIdentityProvidersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListIdentityProvidersResponse
newListIdentityProvidersResponse :: Int -> ListIdentityProvidersResponse
newListIdentityProvidersResponse Int
pHttpStatus_ =
  ListIdentityProvidersResponse' :: Maybe Text
-> Int -> [ProviderDescription] -> ListIdentityProvidersResponse
ListIdentityProvidersResponse'
    { $sel:nextToken:ListIdentityProvidersResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListIdentityProvidersResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:providers:ListIdentityProvidersResponse' :: [ProviderDescription]
providers = [ProviderDescription]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A pagination token.
listIdentityProvidersResponse_nextToken :: Lens.Lens' ListIdentityProvidersResponse (Prelude.Maybe Prelude.Text)
listIdentityProvidersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListIdentityProvidersResponse -> f ListIdentityProvidersResponse
listIdentityProvidersResponse_nextToken = (ListIdentityProvidersResponse -> Maybe Text)
-> (ListIdentityProvidersResponse
    -> Maybe Text -> ListIdentityProvidersResponse)
-> Lens' ListIdentityProvidersResponse (Maybe Text)
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)

-- | The response's http status code.
listIdentityProvidersResponse_httpStatus :: Lens.Lens' ListIdentityProvidersResponse Prelude.Int
listIdentityProvidersResponse_httpStatus :: (Int -> f Int)
-> ListIdentityProvidersResponse -> f ListIdentityProvidersResponse
listIdentityProvidersResponse_httpStatus = (ListIdentityProvidersResponse -> Int)
-> (ListIdentityProvidersResponse
    -> Int -> ListIdentityProvidersResponse)
-> Lens
     ListIdentityProvidersResponse ListIdentityProvidersResponse Int Int
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)

-- | A list of identity provider objects.
listIdentityProvidersResponse_providers :: Lens.Lens' ListIdentityProvidersResponse [ProviderDescription]
listIdentityProvidersResponse_providers :: ([ProviderDescription] -> f [ProviderDescription])
-> ListIdentityProvidersResponse -> f ListIdentityProvidersResponse
listIdentityProvidersResponse_providers = (ListIdentityProvidersResponse -> [ProviderDescription])
-> (ListIdentityProvidersResponse
    -> [ProviderDescription] -> ListIdentityProvidersResponse)
-> Lens' ListIdentityProvidersResponse [ProviderDescription]
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) (([ProviderDescription] -> f [ProviderDescription])
 -> ListIdentityProvidersResponse
 -> f ListIdentityProvidersResponse)
-> (([ProviderDescription] -> f [ProviderDescription])
    -> [ProviderDescription] -> f [ProviderDescription])
-> ([ProviderDescription] -> f [ProviderDescription])
-> ListIdentityProvidersResponse
-> f ListIdentityProvidersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ProviderDescription] -> f [ProviderDescription])
-> [ProviderDescription] -> f [ProviderDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListIdentityProvidersResponse