{-# 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.ListUserPools
-- 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 the user pools associated with an account.
--
-- This operation returns paginated results.
module Amazonka.CognitoIdentityProvider.ListUserPools
  ( -- * Creating a Request
    ListUserPools (..),
    newListUserPools,

    -- * Request Lenses
    listUserPools_nextToken,
    listUserPools_maxResults,

    -- * Destructuring the Response
    ListUserPoolsResponse (..),
    newListUserPoolsResponse,

    -- * Response Lenses
    listUserPoolsResponse_userPools,
    listUserPoolsResponse_nextToken,
    listUserPoolsResponse_httpStatus,
  )
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

-- | Represents the request to list user pools.
--
-- /See:/ 'newListUserPools' smart constructor.
data ListUserPools = ListUserPools'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListUserPools -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results you want the request to return when
    -- listing the user pools.
    ListUserPools -> Natural
maxResults :: Prelude.Natural
  }
  deriving (ListUserPools -> ListUserPools -> Bool
(ListUserPools -> ListUserPools -> Bool)
-> (ListUserPools -> ListUserPools -> Bool) -> Eq ListUserPools
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserPools -> ListUserPools -> Bool
$c/= :: ListUserPools -> ListUserPools -> Bool
== :: ListUserPools -> ListUserPools -> Bool
$c== :: ListUserPools -> ListUserPools -> Bool
Prelude.Eq, ReadPrec [ListUserPools]
ReadPrec ListUserPools
Int -> ReadS ListUserPools
ReadS [ListUserPools]
(Int -> ReadS ListUserPools)
-> ReadS [ListUserPools]
-> ReadPrec ListUserPools
-> ReadPrec [ListUserPools]
-> Read ListUserPools
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserPools]
$creadListPrec :: ReadPrec [ListUserPools]
readPrec :: ReadPrec ListUserPools
$creadPrec :: ReadPrec ListUserPools
readList :: ReadS [ListUserPools]
$creadList :: ReadS [ListUserPools]
readsPrec :: Int -> ReadS ListUserPools
$creadsPrec :: Int -> ReadS ListUserPools
Prelude.Read, Int -> ListUserPools -> ShowS
[ListUserPools] -> ShowS
ListUserPools -> String
(Int -> ListUserPools -> ShowS)
-> (ListUserPools -> String)
-> ([ListUserPools] -> ShowS)
-> Show ListUserPools
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserPools] -> ShowS
$cshowList :: [ListUserPools] -> ShowS
show :: ListUserPools -> String
$cshow :: ListUserPools -> String
showsPrec :: Int -> ListUserPools -> ShowS
$cshowsPrec :: Int -> ListUserPools -> ShowS
Prelude.Show, (forall x. ListUserPools -> Rep ListUserPools x)
-> (forall x. Rep ListUserPools x -> ListUserPools)
-> Generic ListUserPools
forall x. Rep ListUserPools x -> ListUserPools
forall x. ListUserPools -> Rep ListUserPools x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUserPools x -> ListUserPools
$cfrom :: forall x. ListUserPools -> Rep ListUserPools x
Prelude.Generic)

-- |
-- Create a value of 'ListUserPools' 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', 'listUserPools_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'maxResults', 'listUserPools_maxResults' - The maximum number of results you want the request to return when
-- listing the user pools.
newListUserPools ::
  -- | 'maxResults'
  Prelude.Natural ->
  ListUserPools
newListUserPools :: Natural -> ListUserPools
newListUserPools Natural
pMaxResults_ =
  ListUserPools' :: Maybe Text -> Natural -> ListUserPools
ListUserPools'
    { $sel:nextToken:ListUserPools' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListUserPools' :: Natural
maxResults = Natural
pMaxResults_
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listUserPools_nextToken :: Lens.Lens' ListUserPools (Prelude.Maybe Prelude.Text)
listUserPools_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListUserPools -> f ListUserPools
listUserPools_nextToken = (ListUserPools -> Maybe Text)
-> (ListUserPools -> Maybe Text -> ListUserPools)
-> Lens ListUserPools ListUserPools (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserPools' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUserPools' :: ListUserPools -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUserPools
s@ListUserPools' {} Maybe Text
a -> ListUserPools
s {$sel:nextToken:ListUserPools' :: Maybe Text
nextToken = Maybe Text
a} :: ListUserPools)

-- | The maximum number of results you want the request to return when
-- listing the user pools.
listUserPools_maxResults :: Lens.Lens' ListUserPools Prelude.Natural
listUserPools_maxResults :: (Natural -> f Natural) -> ListUserPools -> f ListUserPools
listUserPools_maxResults = (ListUserPools -> Natural)
-> (ListUserPools -> Natural -> ListUserPools)
-> Lens ListUserPools ListUserPools Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserPools' {Natural
maxResults :: Natural
$sel:maxResults:ListUserPools' :: ListUserPools -> Natural
maxResults} -> Natural
maxResults) (\s :: ListUserPools
s@ListUserPools' {} Natural
a -> ListUserPools
s {$sel:maxResults:ListUserPools' :: Natural
maxResults = Natural
a} :: ListUserPools)

instance Core.AWSPager ListUserPools where
  page :: ListUserPools -> AWSResponse ListUserPools -> Maybe ListUserPools
page ListUserPools
rq AWSResponse ListUserPools
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUserPools
ListUserPoolsResponse
rs
            ListUserPoolsResponse
-> Getting (First Text) ListUserPoolsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUserPoolsResponse
-> Const (First Text) ListUserPoolsResponse
Lens' ListUserPoolsResponse (Maybe Text)
listUserPoolsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUserPoolsResponse
 -> Const (First Text) ListUserPoolsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUserPoolsResponse 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 ListUserPools
forall a. Maybe a
Prelude.Nothing
    | Maybe [UserPoolDescriptionType] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUserPools
ListUserPoolsResponse
rs
            ListUserPoolsResponse
-> Getting
     (First [UserPoolDescriptionType])
     ListUserPoolsResponse
     [UserPoolDescriptionType]
-> Maybe [UserPoolDescriptionType]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [UserPoolDescriptionType]
 -> Const
      (First [UserPoolDescriptionType])
      (Maybe [UserPoolDescriptionType]))
-> ListUserPoolsResponse
-> Const (First [UserPoolDescriptionType]) ListUserPoolsResponse
Lens' ListUserPoolsResponse (Maybe [UserPoolDescriptionType])
listUserPoolsResponse_userPools ((Maybe [UserPoolDescriptionType]
  -> Const
       (First [UserPoolDescriptionType])
       (Maybe [UserPoolDescriptionType]))
 -> ListUserPoolsResponse
 -> Const (First [UserPoolDescriptionType]) ListUserPoolsResponse)
-> (([UserPoolDescriptionType]
     -> Const
          (First [UserPoolDescriptionType]) [UserPoolDescriptionType])
    -> Maybe [UserPoolDescriptionType]
    -> Const
         (First [UserPoolDescriptionType])
         (Maybe [UserPoolDescriptionType]))
-> Getting
     (First [UserPoolDescriptionType])
     ListUserPoolsResponse
     [UserPoolDescriptionType]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([UserPoolDescriptionType]
 -> Const
      (First [UserPoolDescriptionType]) [UserPoolDescriptionType])
-> Maybe [UserPoolDescriptionType]
-> Const
     (First [UserPoolDescriptionType]) (Maybe [UserPoolDescriptionType])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListUserPools
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListUserPools -> Maybe ListUserPools
forall a. a -> Maybe a
Prelude.Just (ListUserPools -> Maybe ListUserPools)
-> ListUserPools -> Maybe ListUserPools
forall a b. (a -> b) -> a -> b
Prelude.$
        ListUserPools
rq
          ListUserPools -> (ListUserPools -> ListUserPools) -> ListUserPools
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListUserPools -> Identity ListUserPools
Lens ListUserPools ListUserPools (Maybe Text) (Maybe Text)
listUserPools_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListUserPools -> Identity ListUserPools)
-> Maybe Text -> ListUserPools -> ListUserPools
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUserPools
ListUserPoolsResponse
rs
          ListUserPoolsResponse
-> Getting (First Text) ListUserPoolsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUserPoolsResponse
-> Const (First Text) ListUserPoolsResponse
Lens' ListUserPoolsResponse (Maybe Text)
listUserPoolsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUserPoolsResponse
 -> Const (First Text) ListUserPoolsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUserPoolsResponse 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 ListUserPools where
  type
    AWSResponse ListUserPools =
      ListUserPoolsResponse
  request :: ListUserPools -> Request ListUserPools
request = Service -> ListUserPools -> Request ListUserPools
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListUserPools
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUserPools)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListUserPools))
-> Logger
-> Service
-> Proxy ListUserPools
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUserPools)))
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 [UserPoolDescriptionType]
-> Maybe Text -> Int -> ListUserPoolsResponse
ListUserPoolsResponse'
            (Maybe [UserPoolDescriptionType]
 -> Maybe Text -> Int -> ListUserPoolsResponse)
-> Either String (Maybe [UserPoolDescriptionType])
-> Either String (Maybe Text -> Int -> ListUserPoolsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [UserPoolDescriptionType]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UserPools" Either String (Maybe (Maybe [UserPoolDescriptionType]))
-> Maybe [UserPoolDescriptionType]
-> Either String (Maybe [UserPoolDescriptionType])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [UserPoolDescriptionType]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListUserPoolsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListUserPoolsResponse)
forall (f :: * -> *) a b. Applicative f => 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 -> ListUserPoolsResponse)
-> Either String Int -> Either String ListUserPoolsResponse
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))
      )

instance Prelude.Hashable ListUserPools

instance Prelude.NFData ListUserPools

instance Core.ToHeaders ListUserPools where
  toHeaders :: ListUserPools -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListUserPools -> 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.ListUserPools" ::
                          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 ListUserPools where
  toJSON :: ListUserPools -> Value
toJSON ListUserPools' {Natural
Maybe Text
maxResults :: Natural
nextToken :: Maybe Text
$sel:maxResults:ListUserPools' :: ListUserPools -> Natural
$sel:nextToken:ListUserPools' :: ListUserPools -> 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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
maxResults)
          ]
      )

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

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

-- | Represents the response to list user pools.
--
-- /See:/ 'newListUserPoolsResponse' smart constructor.
data ListUserPoolsResponse = ListUserPoolsResponse'
  { -- | The user pools from the response to list users.
    ListUserPoolsResponse -> Maybe [UserPoolDescriptionType]
userPools :: Prelude.Maybe [UserPoolDescriptionType],
    -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListUserPoolsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListUserPoolsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListUserPoolsResponse -> ListUserPoolsResponse -> Bool
(ListUserPoolsResponse -> ListUserPoolsResponse -> Bool)
-> (ListUserPoolsResponse -> ListUserPoolsResponse -> Bool)
-> Eq ListUserPoolsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserPoolsResponse -> ListUserPoolsResponse -> Bool
$c/= :: ListUserPoolsResponse -> ListUserPoolsResponse -> Bool
== :: ListUserPoolsResponse -> ListUserPoolsResponse -> Bool
$c== :: ListUserPoolsResponse -> ListUserPoolsResponse -> Bool
Prelude.Eq, ReadPrec [ListUserPoolsResponse]
ReadPrec ListUserPoolsResponse
Int -> ReadS ListUserPoolsResponse
ReadS [ListUserPoolsResponse]
(Int -> ReadS ListUserPoolsResponse)
-> ReadS [ListUserPoolsResponse]
-> ReadPrec ListUserPoolsResponse
-> ReadPrec [ListUserPoolsResponse]
-> Read ListUserPoolsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserPoolsResponse]
$creadListPrec :: ReadPrec [ListUserPoolsResponse]
readPrec :: ReadPrec ListUserPoolsResponse
$creadPrec :: ReadPrec ListUserPoolsResponse
readList :: ReadS [ListUserPoolsResponse]
$creadList :: ReadS [ListUserPoolsResponse]
readsPrec :: Int -> ReadS ListUserPoolsResponse
$creadsPrec :: Int -> ReadS ListUserPoolsResponse
Prelude.Read, Int -> ListUserPoolsResponse -> ShowS
[ListUserPoolsResponse] -> ShowS
ListUserPoolsResponse -> String
(Int -> ListUserPoolsResponse -> ShowS)
-> (ListUserPoolsResponse -> String)
-> ([ListUserPoolsResponse] -> ShowS)
-> Show ListUserPoolsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserPoolsResponse] -> ShowS
$cshowList :: [ListUserPoolsResponse] -> ShowS
show :: ListUserPoolsResponse -> String
$cshow :: ListUserPoolsResponse -> String
showsPrec :: Int -> ListUserPoolsResponse -> ShowS
$cshowsPrec :: Int -> ListUserPoolsResponse -> ShowS
Prelude.Show, (forall x. ListUserPoolsResponse -> Rep ListUserPoolsResponse x)
-> (forall x. Rep ListUserPoolsResponse x -> ListUserPoolsResponse)
-> Generic ListUserPoolsResponse
forall x. Rep ListUserPoolsResponse x -> ListUserPoolsResponse
forall x. ListUserPoolsResponse -> Rep ListUserPoolsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUserPoolsResponse x -> ListUserPoolsResponse
$cfrom :: forall x. ListUserPoolsResponse -> Rep ListUserPoolsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListUserPoolsResponse' 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:
--
-- 'userPools', 'listUserPoolsResponse_userPools' - The user pools from the response to list users.
--
-- 'nextToken', 'listUserPoolsResponse_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'httpStatus', 'listUserPoolsResponse_httpStatus' - The response's http status code.
newListUserPoolsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListUserPoolsResponse
newListUserPoolsResponse :: Int -> ListUserPoolsResponse
newListUserPoolsResponse Int
pHttpStatus_ =
  ListUserPoolsResponse' :: Maybe [UserPoolDescriptionType]
-> Maybe Text -> Int -> ListUserPoolsResponse
ListUserPoolsResponse'
    { $sel:userPools:ListUserPoolsResponse' :: Maybe [UserPoolDescriptionType]
userPools = Maybe [UserPoolDescriptionType]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListUserPoolsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListUserPoolsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The user pools from the response to list users.
listUserPoolsResponse_userPools :: Lens.Lens' ListUserPoolsResponse (Prelude.Maybe [UserPoolDescriptionType])
listUserPoolsResponse_userPools :: (Maybe [UserPoolDescriptionType]
 -> f (Maybe [UserPoolDescriptionType]))
-> ListUserPoolsResponse -> f ListUserPoolsResponse
listUserPoolsResponse_userPools = (ListUserPoolsResponse -> Maybe [UserPoolDescriptionType])
-> (ListUserPoolsResponse
    -> Maybe [UserPoolDescriptionType] -> ListUserPoolsResponse)
-> Lens' ListUserPoolsResponse (Maybe [UserPoolDescriptionType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserPoolsResponse' {Maybe [UserPoolDescriptionType]
userPools :: Maybe [UserPoolDescriptionType]
$sel:userPools:ListUserPoolsResponse' :: ListUserPoolsResponse -> Maybe [UserPoolDescriptionType]
userPools} -> Maybe [UserPoolDescriptionType]
userPools) (\s :: ListUserPoolsResponse
s@ListUserPoolsResponse' {} Maybe [UserPoolDescriptionType]
a -> ListUserPoolsResponse
s {$sel:userPools:ListUserPoolsResponse' :: Maybe [UserPoolDescriptionType]
userPools = Maybe [UserPoolDescriptionType]
a} :: ListUserPoolsResponse) ((Maybe [UserPoolDescriptionType]
  -> f (Maybe [UserPoolDescriptionType]))
 -> ListUserPoolsResponse -> f ListUserPoolsResponse)
-> ((Maybe [UserPoolDescriptionType]
     -> f (Maybe [UserPoolDescriptionType]))
    -> Maybe [UserPoolDescriptionType]
    -> f (Maybe [UserPoolDescriptionType]))
-> (Maybe [UserPoolDescriptionType]
    -> f (Maybe [UserPoolDescriptionType]))
-> ListUserPoolsResponse
-> f ListUserPoolsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [UserPoolDescriptionType]
  [UserPoolDescriptionType]
  [UserPoolDescriptionType]
  [UserPoolDescriptionType]
-> Iso
     (Maybe [UserPoolDescriptionType])
     (Maybe [UserPoolDescriptionType])
     (Maybe [UserPoolDescriptionType])
     (Maybe [UserPoolDescriptionType])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [UserPoolDescriptionType]
  [UserPoolDescriptionType]
  [UserPoolDescriptionType]
  [UserPoolDescriptionType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listUserPoolsResponse_nextToken :: Lens.Lens' ListUserPoolsResponse (Prelude.Maybe Prelude.Text)
listUserPoolsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUserPoolsResponse -> f ListUserPoolsResponse
listUserPoolsResponse_nextToken = (ListUserPoolsResponse -> Maybe Text)
-> (ListUserPoolsResponse -> Maybe Text -> ListUserPoolsResponse)
-> Lens' ListUserPoolsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserPoolsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUserPoolsResponse' :: ListUserPoolsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUserPoolsResponse
s@ListUserPoolsResponse' {} Maybe Text
a -> ListUserPoolsResponse
s {$sel:nextToken:ListUserPoolsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUserPoolsResponse)

-- | The response's http status code.
listUserPoolsResponse_httpStatus :: Lens.Lens' ListUserPoolsResponse Prelude.Int
listUserPoolsResponse_httpStatus :: (Int -> f Int) -> ListUserPoolsResponse -> f ListUserPoolsResponse
listUserPoolsResponse_httpStatus = (ListUserPoolsResponse -> Int)
-> (ListUserPoolsResponse -> Int -> ListUserPoolsResponse)
-> Lens ListUserPoolsResponse ListUserPoolsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserPoolsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListUserPoolsResponse' :: ListUserPoolsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListUserPoolsResponse
s@ListUserPoolsResponse' {} Int
a -> ListUserPoolsResponse
s {$sel:httpStatus:ListUserPoolsResponse' :: Int
httpStatus = Int
a} :: ListUserPoolsResponse)

instance Prelude.NFData ListUserPoolsResponse