{-# 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.ListUserPoolClients
-- 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 clients that have been created for the specified user pool.
--
-- This operation returns paginated results.
module Amazonka.CognitoIdentityProvider.ListUserPoolClients
  ( -- * Creating a Request
    ListUserPoolClients (..),
    newListUserPoolClients,

    -- * Request Lenses
    listUserPoolClients_nextToken,
    listUserPoolClients_maxResults,
    listUserPoolClients_userPoolId,

    -- * Destructuring the Response
    ListUserPoolClientsResponse (..),
    newListUserPoolClientsResponse,

    -- * Response Lenses
    listUserPoolClientsResponse_nextToken,
    listUserPoolClientsResponse_userPoolClients,
    listUserPoolClientsResponse_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 the user pool clients.
--
-- /See:/ 'newListUserPoolClients' smart constructor.
data ListUserPoolClients = ListUserPoolClients'
  { -- | 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.
    ListUserPoolClients -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results you want the request to return when
    -- listing the user pool clients.
    ListUserPoolClients -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The user pool ID for the user pool where you want to list user pool
    -- clients.
    ListUserPoolClients -> Text
userPoolId :: Prelude.Text
  }
  deriving (ListUserPoolClients -> ListUserPoolClients -> Bool
(ListUserPoolClients -> ListUserPoolClients -> Bool)
-> (ListUserPoolClients -> ListUserPoolClients -> Bool)
-> Eq ListUserPoolClients
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserPoolClients -> ListUserPoolClients -> Bool
$c/= :: ListUserPoolClients -> ListUserPoolClients -> Bool
== :: ListUserPoolClients -> ListUserPoolClients -> Bool
$c== :: ListUserPoolClients -> ListUserPoolClients -> Bool
Prelude.Eq, ReadPrec [ListUserPoolClients]
ReadPrec ListUserPoolClients
Int -> ReadS ListUserPoolClients
ReadS [ListUserPoolClients]
(Int -> ReadS ListUserPoolClients)
-> ReadS [ListUserPoolClients]
-> ReadPrec ListUserPoolClients
-> ReadPrec [ListUserPoolClients]
-> Read ListUserPoolClients
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserPoolClients]
$creadListPrec :: ReadPrec [ListUserPoolClients]
readPrec :: ReadPrec ListUserPoolClients
$creadPrec :: ReadPrec ListUserPoolClients
readList :: ReadS [ListUserPoolClients]
$creadList :: ReadS [ListUserPoolClients]
readsPrec :: Int -> ReadS ListUserPoolClients
$creadsPrec :: Int -> ReadS ListUserPoolClients
Prelude.Read, Int -> ListUserPoolClients -> ShowS
[ListUserPoolClients] -> ShowS
ListUserPoolClients -> String
(Int -> ListUserPoolClients -> ShowS)
-> (ListUserPoolClients -> String)
-> ([ListUserPoolClients] -> ShowS)
-> Show ListUserPoolClients
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserPoolClients] -> ShowS
$cshowList :: [ListUserPoolClients] -> ShowS
show :: ListUserPoolClients -> String
$cshow :: ListUserPoolClients -> String
showsPrec :: Int -> ListUserPoolClients -> ShowS
$cshowsPrec :: Int -> ListUserPoolClients -> ShowS
Prelude.Show, (forall x. ListUserPoolClients -> Rep ListUserPoolClients x)
-> (forall x. Rep ListUserPoolClients x -> ListUserPoolClients)
-> Generic ListUserPoolClients
forall x. Rep ListUserPoolClients x -> ListUserPoolClients
forall x. ListUserPoolClients -> Rep ListUserPoolClients x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUserPoolClients x -> ListUserPoolClients
$cfrom :: forall x. ListUserPoolClients -> Rep ListUserPoolClients x
Prelude.Generic)

-- |
-- Create a value of 'ListUserPoolClients' 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', 'listUserPoolClients_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', 'listUserPoolClients_maxResults' - The maximum number of results you want the request to return when
-- listing the user pool clients.
--
-- 'userPoolId', 'listUserPoolClients_userPoolId' - The user pool ID for the user pool where you want to list user pool
-- clients.
newListUserPoolClients ::
  -- | 'userPoolId'
  Prelude.Text ->
  ListUserPoolClients
newListUserPoolClients :: Text -> ListUserPoolClients
newListUserPoolClients Text
pUserPoolId_ =
  ListUserPoolClients' :: Maybe Text -> Maybe Natural -> Text -> ListUserPoolClients
ListUserPoolClients'
    { $sel:nextToken:ListUserPoolClients' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListUserPoolClients' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:ListUserPoolClients' :: Text
userPoolId = Text
pUserPoolId_
    }

-- | 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.
listUserPoolClients_nextToken :: Lens.Lens' ListUserPoolClients (Prelude.Maybe Prelude.Text)
listUserPoolClients_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUserPoolClients -> f ListUserPoolClients
listUserPoolClients_nextToken = (ListUserPoolClients -> Maybe Text)
-> (ListUserPoolClients -> Maybe Text -> ListUserPoolClients)
-> Lens
     ListUserPoolClients ListUserPoolClients (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserPoolClients' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUserPoolClients' :: ListUserPoolClients -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUserPoolClients
s@ListUserPoolClients' {} Maybe Text
a -> ListUserPoolClients
s {$sel:nextToken:ListUserPoolClients' :: Maybe Text
nextToken = Maybe Text
a} :: ListUserPoolClients)

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

-- | The user pool ID for the user pool where you want to list user pool
-- clients.
listUserPoolClients_userPoolId :: Lens.Lens' ListUserPoolClients Prelude.Text
listUserPoolClients_userPoolId :: (Text -> f Text) -> ListUserPoolClients -> f ListUserPoolClients
listUserPoolClients_userPoolId = (ListUserPoolClients -> Text)
-> (ListUserPoolClients -> Text -> ListUserPoolClients)
-> Lens ListUserPoolClients ListUserPoolClients Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserPoolClients' {Text
userPoolId :: Text
$sel:userPoolId:ListUserPoolClients' :: ListUserPoolClients -> Text
userPoolId} -> Text
userPoolId) (\s :: ListUserPoolClients
s@ListUserPoolClients' {} Text
a -> ListUserPoolClients
s {$sel:userPoolId:ListUserPoolClients' :: Text
userPoolId = Text
a} :: ListUserPoolClients)

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

instance Prelude.NFData ListUserPoolClients

instance Core.ToHeaders ListUserPoolClients where
  toHeaders :: ListUserPoolClients -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListUserPoolClients -> 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.ListUserPoolClients" ::
                          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 ListUserPoolClients where
  toJSON :: ListUserPoolClients -> Value
toJSON ListUserPoolClients' {Maybe Natural
Maybe Text
Text
userPoolId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:userPoolId:ListUserPoolClients' :: ListUserPoolClients -> Text
$sel:maxResults:ListUserPoolClients' :: ListUserPoolClients -> Maybe Natural
$sel:nextToken:ListUserPoolClients' :: ListUserPoolClients -> 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 ListUserPoolClients where
  toPath :: ListUserPoolClients -> ByteString
toPath = ByteString -> ListUserPoolClients -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | Represents the response from the server that lists user pool clients.
--
-- /See:/ 'newListUserPoolClientsResponse' smart constructor.
data ListUserPoolClientsResponse = ListUserPoolClientsResponse'
  { -- | 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.
    ListUserPoolClientsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The user pool clients in the response that lists user pool clients.
    ListUserPoolClientsResponse -> Maybe [UserPoolClientDescription]
userPoolClients :: Prelude.Maybe [UserPoolClientDescription],
    -- | The response's http status code.
    ListUserPoolClientsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListUserPoolClientsResponse -> ListUserPoolClientsResponse -> Bool
(ListUserPoolClientsResponse
 -> ListUserPoolClientsResponse -> Bool)
-> (ListUserPoolClientsResponse
    -> ListUserPoolClientsResponse -> Bool)
-> Eq ListUserPoolClientsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserPoolClientsResponse -> ListUserPoolClientsResponse -> Bool
$c/= :: ListUserPoolClientsResponse -> ListUserPoolClientsResponse -> Bool
== :: ListUserPoolClientsResponse -> ListUserPoolClientsResponse -> Bool
$c== :: ListUserPoolClientsResponse -> ListUserPoolClientsResponse -> Bool
Prelude.Eq, Int -> ListUserPoolClientsResponse -> ShowS
[ListUserPoolClientsResponse] -> ShowS
ListUserPoolClientsResponse -> String
(Int -> ListUserPoolClientsResponse -> ShowS)
-> (ListUserPoolClientsResponse -> String)
-> ([ListUserPoolClientsResponse] -> ShowS)
-> Show ListUserPoolClientsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserPoolClientsResponse] -> ShowS
$cshowList :: [ListUserPoolClientsResponse] -> ShowS
show :: ListUserPoolClientsResponse -> String
$cshow :: ListUserPoolClientsResponse -> String
showsPrec :: Int -> ListUserPoolClientsResponse -> ShowS
$cshowsPrec :: Int -> ListUserPoolClientsResponse -> ShowS
Prelude.Show, (forall x.
 ListUserPoolClientsResponse -> Rep ListUserPoolClientsResponse x)
-> (forall x.
    Rep ListUserPoolClientsResponse x -> ListUserPoolClientsResponse)
-> Generic ListUserPoolClientsResponse
forall x.
Rep ListUserPoolClientsResponse x -> ListUserPoolClientsResponse
forall x.
ListUserPoolClientsResponse -> Rep ListUserPoolClientsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListUserPoolClientsResponse x -> ListUserPoolClientsResponse
$cfrom :: forall x.
ListUserPoolClientsResponse -> Rep ListUserPoolClientsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListUserPoolClientsResponse' 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', 'listUserPoolClientsResponse_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.
--
-- 'userPoolClients', 'listUserPoolClientsResponse_userPoolClients' - The user pool clients in the response that lists user pool clients.
--
-- 'httpStatus', 'listUserPoolClientsResponse_httpStatus' - The response's http status code.
newListUserPoolClientsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListUserPoolClientsResponse
newListUserPoolClientsResponse :: Int -> ListUserPoolClientsResponse
newListUserPoolClientsResponse Int
pHttpStatus_ =
  ListUserPoolClientsResponse' :: Maybe Text
-> Maybe [UserPoolClientDescription]
-> Int
-> ListUserPoolClientsResponse
ListUserPoolClientsResponse'
    { $sel:nextToken:ListUserPoolClientsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolClients:ListUserPoolClientsResponse' :: Maybe [UserPoolClientDescription]
userPoolClients = Maybe [UserPoolClientDescription]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListUserPoolClientsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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.
listUserPoolClientsResponse_nextToken :: Lens.Lens' ListUserPoolClientsResponse (Prelude.Maybe Prelude.Text)
listUserPoolClientsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUserPoolClientsResponse -> f ListUserPoolClientsResponse
listUserPoolClientsResponse_nextToken = (ListUserPoolClientsResponse -> Maybe Text)
-> (ListUserPoolClientsResponse
    -> Maybe Text -> ListUserPoolClientsResponse)
-> Lens' ListUserPoolClientsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserPoolClientsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUserPoolClientsResponse' :: ListUserPoolClientsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUserPoolClientsResponse
s@ListUserPoolClientsResponse' {} Maybe Text
a -> ListUserPoolClientsResponse
s {$sel:nextToken:ListUserPoolClientsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUserPoolClientsResponse)

-- | The user pool clients in the response that lists user pool clients.
listUserPoolClientsResponse_userPoolClients :: Lens.Lens' ListUserPoolClientsResponse (Prelude.Maybe [UserPoolClientDescription])
listUserPoolClientsResponse_userPoolClients :: (Maybe [UserPoolClientDescription]
 -> f (Maybe [UserPoolClientDescription]))
-> ListUserPoolClientsResponse -> f ListUserPoolClientsResponse
listUserPoolClientsResponse_userPoolClients = (ListUserPoolClientsResponse -> Maybe [UserPoolClientDescription])
-> (ListUserPoolClientsResponse
    -> Maybe [UserPoolClientDescription]
    -> ListUserPoolClientsResponse)
-> Lens'
     ListUserPoolClientsResponse (Maybe [UserPoolClientDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserPoolClientsResponse' {Maybe [UserPoolClientDescription]
userPoolClients :: Maybe [UserPoolClientDescription]
$sel:userPoolClients:ListUserPoolClientsResponse' :: ListUserPoolClientsResponse -> Maybe [UserPoolClientDescription]
userPoolClients} -> Maybe [UserPoolClientDescription]
userPoolClients) (\s :: ListUserPoolClientsResponse
s@ListUserPoolClientsResponse' {} Maybe [UserPoolClientDescription]
a -> ListUserPoolClientsResponse
s {$sel:userPoolClients:ListUserPoolClientsResponse' :: Maybe [UserPoolClientDescription]
userPoolClients = Maybe [UserPoolClientDescription]
a} :: ListUserPoolClientsResponse) ((Maybe [UserPoolClientDescription]
  -> f (Maybe [UserPoolClientDescription]))
 -> ListUserPoolClientsResponse -> f ListUserPoolClientsResponse)
-> ((Maybe [UserPoolClientDescription]
     -> f (Maybe [UserPoolClientDescription]))
    -> Maybe [UserPoolClientDescription]
    -> f (Maybe [UserPoolClientDescription]))
-> (Maybe [UserPoolClientDescription]
    -> f (Maybe [UserPoolClientDescription]))
-> ListUserPoolClientsResponse
-> f ListUserPoolClientsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [UserPoolClientDescription]
  [UserPoolClientDescription]
  [UserPoolClientDescription]
  [UserPoolClientDescription]
-> Iso
     (Maybe [UserPoolClientDescription])
     (Maybe [UserPoolClientDescription])
     (Maybe [UserPoolClientDescription])
     (Maybe [UserPoolClientDescription])
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
  [UserPoolClientDescription]
  [UserPoolClientDescription]
  [UserPoolClientDescription]
  [UserPoolClientDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListUserPoolClientsResponse