{-# 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.MemoryDb.DescribeUsers
-- 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)
--
-- Returns a list of users.
module Amazonka.MemoryDb.DescribeUsers
  ( -- * Creating a Request
    DescribeUsers (..),
    newDescribeUsers,

    -- * Request Lenses
    describeUsers_filters,
    describeUsers_userName,
    describeUsers_nextToken,
    describeUsers_maxResults,

    -- * Destructuring the Response
    DescribeUsersResponse (..),
    newDescribeUsersResponse,

    -- * Response Lenses
    describeUsersResponse_users,
    describeUsersResponse_nextToken,
    describeUsersResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeUsers' smart constructor.
data DescribeUsers = DescribeUsers'
  { -- | Filter to determine the list of users to return.
    DescribeUsers -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The name of the user
    DescribeUsers -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
    -- | An optional argument to pass in case the total number of records exceeds
    -- the value of MaxResults. If nextToken is returned, there are more
    -- results available. The value of nextToken is a unique pagination token
    -- for each page. Make the call again using the returned token to retrieve
    -- the next page. Keep all other arguments unchanged.
    DescribeUsers -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified MaxResults value, a token is included
    -- in the response so that the remaining results can be retrieved.
    DescribeUsers -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeUsers -> DescribeUsers -> Bool
(DescribeUsers -> DescribeUsers -> Bool)
-> (DescribeUsers -> DescribeUsers -> Bool) -> Eq DescribeUsers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUsers -> DescribeUsers -> Bool
$c/= :: DescribeUsers -> DescribeUsers -> Bool
== :: DescribeUsers -> DescribeUsers -> Bool
$c== :: DescribeUsers -> DescribeUsers -> Bool
Prelude.Eq, ReadPrec [DescribeUsers]
ReadPrec DescribeUsers
Int -> ReadS DescribeUsers
ReadS [DescribeUsers]
(Int -> ReadS DescribeUsers)
-> ReadS [DescribeUsers]
-> ReadPrec DescribeUsers
-> ReadPrec [DescribeUsers]
-> Read DescribeUsers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUsers]
$creadListPrec :: ReadPrec [DescribeUsers]
readPrec :: ReadPrec DescribeUsers
$creadPrec :: ReadPrec DescribeUsers
readList :: ReadS [DescribeUsers]
$creadList :: ReadS [DescribeUsers]
readsPrec :: Int -> ReadS DescribeUsers
$creadsPrec :: Int -> ReadS DescribeUsers
Prelude.Read, Int -> DescribeUsers -> ShowS
[DescribeUsers] -> ShowS
DescribeUsers -> String
(Int -> DescribeUsers -> ShowS)
-> (DescribeUsers -> String)
-> ([DescribeUsers] -> ShowS)
-> Show DescribeUsers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUsers] -> ShowS
$cshowList :: [DescribeUsers] -> ShowS
show :: DescribeUsers -> String
$cshow :: DescribeUsers -> String
showsPrec :: Int -> DescribeUsers -> ShowS
$cshowsPrec :: Int -> DescribeUsers -> ShowS
Prelude.Show, (forall x. DescribeUsers -> Rep DescribeUsers x)
-> (forall x. Rep DescribeUsers x -> DescribeUsers)
-> Generic DescribeUsers
forall x. Rep DescribeUsers x -> DescribeUsers
forall x. DescribeUsers -> Rep DescribeUsers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeUsers x -> DescribeUsers
$cfrom :: forall x. DescribeUsers -> Rep DescribeUsers x
Prelude.Generic)

-- |
-- Create a value of 'DescribeUsers' 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:
--
-- 'filters', 'describeUsers_filters' - Filter to determine the list of users to return.
--
-- 'userName', 'describeUsers_userName' - The name of the user
--
-- 'nextToken', 'describeUsers_nextToken' - An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
--
-- 'maxResults', 'describeUsers_maxResults' - The maximum number of records to include in the response. If more
-- records exist than the specified MaxResults value, a token is included
-- in the response so that the remaining results can be retrieved.
newDescribeUsers ::
  DescribeUsers
newDescribeUsers :: DescribeUsers
newDescribeUsers =
  DescribeUsers' :: Maybe [Filter]
-> Maybe Text -> Maybe Text -> Maybe Int -> DescribeUsers
DescribeUsers'
    { $sel:filters:DescribeUsers' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:userName:DescribeUsers' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeUsers' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeUsers' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Filter to determine the list of users to return.
describeUsers_filters :: Lens.Lens' DescribeUsers (Prelude.Maybe [Filter])
describeUsers_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeUsers -> f DescribeUsers
describeUsers_filters = (DescribeUsers -> Maybe [Filter])
-> (DescribeUsers -> Maybe [Filter] -> DescribeUsers)
-> Lens
     DescribeUsers DescribeUsers (Maybe [Filter]) (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsers' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeUsers' :: DescribeUsers -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeUsers
s@DescribeUsers' {} Maybe [Filter]
a -> DescribeUsers
s {$sel:filters:DescribeUsers' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeUsers) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeUsers -> f DescribeUsers)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeUsers
-> f DescribeUsers
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the user
describeUsers_userName :: Lens.Lens' DescribeUsers (Prelude.Maybe Prelude.Text)
describeUsers_userName :: (Maybe Text -> f (Maybe Text)) -> DescribeUsers -> f DescribeUsers
describeUsers_userName = (DescribeUsers -> Maybe Text)
-> (DescribeUsers -> Maybe Text -> DescribeUsers)
-> Lens DescribeUsers DescribeUsers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsers' {Maybe Text
userName :: Maybe Text
$sel:userName:DescribeUsers' :: DescribeUsers -> Maybe Text
userName} -> Maybe Text
userName) (\s :: DescribeUsers
s@DescribeUsers' {} Maybe Text
a -> DescribeUsers
s {$sel:userName:DescribeUsers' :: Maybe Text
userName = Maybe Text
a} :: DescribeUsers)

-- | An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
describeUsers_nextToken :: Lens.Lens' DescribeUsers (Prelude.Maybe Prelude.Text)
describeUsers_nextToken :: (Maybe Text -> f (Maybe Text)) -> DescribeUsers -> f DescribeUsers
describeUsers_nextToken = (DescribeUsers -> Maybe Text)
-> (DescribeUsers -> Maybe Text -> DescribeUsers)
-> Lens DescribeUsers DescribeUsers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsers' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeUsers' :: DescribeUsers -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeUsers
s@DescribeUsers' {} Maybe Text
a -> DescribeUsers
s {$sel:nextToken:DescribeUsers' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeUsers)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified MaxResults value, a token is included
-- in the response so that the remaining results can be retrieved.
describeUsers_maxResults :: Lens.Lens' DescribeUsers (Prelude.Maybe Prelude.Int)
describeUsers_maxResults :: (Maybe Int -> f (Maybe Int)) -> DescribeUsers -> f DescribeUsers
describeUsers_maxResults = (DescribeUsers -> Maybe Int)
-> (DescribeUsers -> Maybe Int -> DescribeUsers)
-> Lens DescribeUsers DescribeUsers (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsers' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeUsers' :: DescribeUsers -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeUsers
s@DescribeUsers' {} Maybe Int
a -> DescribeUsers
s {$sel:maxResults:DescribeUsers' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeUsers)

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

instance Prelude.NFData DescribeUsers

instance Core.ToHeaders DescribeUsers where
  toHeaders :: DescribeUsers -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeUsers -> 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
"AmazonMemoryDB.DescribeUsers" ::
                          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 DescribeUsers where
  toJSON :: DescribeUsers -> Value
toJSON DescribeUsers' {Maybe Int
Maybe [Filter]
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
userName :: Maybe Text
filters :: Maybe [Filter]
$sel:maxResults:DescribeUsers' :: DescribeUsers -> Maybe Int
$sel:nextToken:DescribeUsers' :: DescribeUsers -> Maybe Text
$sel:userName:DescribeUsers' :: DescribeUsers -> Maybe Text
$sel:filters:DescribeUsers' :: DescribeUsers -> Maybe [Filter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Filters" Text -> [Filter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Filter] -> Pair) -> Maybe [Filter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Text
"UserName" 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
userName,
            (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 -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

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

-- | /See:/ 'newDescribeUsersResponse' smart constructor.
data DescribeUsersResponse = DescribeUsersResponse'
  { -- | A list of users.
    DescribeUsersResponse -> Maybe [User]
users :: Prelude.Maybe [User],
    -- | An optional argument to pass in case the total number of records exceeds
    -- the value of MaxResults. If nextToken is returned, there are more
    -- results available. The value of nextToken is a unique pagination token
    -- for each page. Make the call again using the returned token to retrieve
    -- the next page. Keep all other arguments unchanged.
    DescribeUsersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeUsersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeUsersResponse -> DescribeUsersResponse -> Bool
(DescribeUsersResponse -> DescribeUsersResponse -> Bool)
-> (DescribeUsersResponse -> DescribeUsersResponse -> Bool)
-> Eq DescribeUsersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUsersResponse -> DescribeUsersResponse -> Bool
$c/= :: DescribeUsersResponse -> DescribeUsersResponse -> Bool
== :: DescribeUsersResponse -> DescribeUsersResponse -> Bool
$c== :: DescribeUsersResponse -> DescribeUsersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeUsersResponse]
ReadPrec DescribeUsersResponse
Int -> ReadS DescribeUsersResponse
ReadS [DescribeUsersResponse]
(Int -> ReadS DescribeUsersResponse)
-> ReadS [DescribeUsersResponse]
-> ReadPrec DescribeUsersResponse
-> ReadPrec [DescribeUsersResponse]
-> Read DescribeUsersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUsersResponse]
$creadListPrec :: ReadPrec [DescribeUsersResponse]
readPrec :: ReadPrec DescribeUsersResponse
$creadPrec :: ReadPrec DescribeUsersResponse
readList :: ReadS [DescribeUsersResponse]
$creadList :: ReadS [DescribeUsersResponse]
readsPrec :: Int -> ReadS DescribeUsersResponse
$creadsPrec :: Int -> ReadS DescribeUsersResponse
Prelude.Read, Int -> DescribeUsersResponse -> ShowS
[DescribeUsersResponse] -> ShowS
DescribeUsersResponse -> String
(Int -> DescribeUsersResponse -> ShowS)
-> (DescribeUsersResponse -> String)
-> ([DescribeUsersResponse] -> ShowS)
-> Show DescribeUsersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUsersResponse] -> ShowS
$cshowList :: [DescribeUsersResponse] -> ShowS
show :: DescribeUsersResponse -> String
$cshow :: DescribeUsersResponse -> String
showsPrec :: Int -> DescribeUsersResponse -> ShowS
$cshowsPrec :: Int -> DescribeUsersResponse -> ShowS
Prelude.Show, (forall x. DescribeUsersResponse -> Rep DescribeUsersResponse x)
-> (forall x. Rep DescribeUsersResponse x -> DescribeUsersResponse)
-> Generic DescribeUsersResponse
forall x. Rep DescribeUsersResponse x -> DescribeUsersResponse
forall x. DescribeUsersResponse -> Rep DescribeUsersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeUsersResponse x -> DescribeUsersResponse
$cfrom :: forall x. DescribeUsersResponse -> Rep DescribeUsersResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeUsersResponse' 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:
--
-- 'users', 'describeUsersResponse_users' - A list of users.
--
-- 'nextToken', 'describeUsersResponse_nextToken' - An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
--
-- 'httpStatus', 'describeUsersResponse_httpStatus' - The response's http status code.
newDescribeUsersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeUsersResponse
newDescribeUsersResponse :: Int -> DescribeUsersResponse
newDescribeUsersResponse Int
pHttpStatus_ =
  DescribeUsersResponse' :: Maybe [User] -> Maybe Text -> Int -> DescribeUsersResponse
DescribeUsersResponse'
    { $sel:users:DescribeUsersResponse' :: Maybe [User]
users = Maybe [User]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeUsersResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeUsersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of users.
describeUsersResponse_users :: Lens.Lens' DescribeUsersResponse (Prelude.Maybe [User])
describeUsersResponse_users :: (Maybe [User] -> f (Maybe [User]))
-> DescribeUsersResponse -> f DescribeUsersResponse
describeUsersResponse_users = (DescribeUsersResponse -> Maybe [User])
-> (DescribeUsersResponse -> Maybe [User] -> DescribeUsersResponse)
-> Lens
     DescribeUsersResponse
     DescribeUsersResponse
     (Maybe [User])
     (Maybe [User])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsersResponse' {Maybe [User]
users :: Maybe [User]
$sel:users:DescribeUsersResponse' :: DescribeUsersResponse -> Maybe [User]
users} -> Maybe [User]
users) (\s :: DescribeUsersResponse
s@DescribeUsersResponse' {} Maybe [User]
a -> DescribeUsersResponse
s {$sel:users:DescribeUsersResponse' :: Maybe [User]
users = Maybe [User]
a} :: DescribeUsersResponse) ((Maybe [User] -> f (Maybe [User]))
 -> DescribeUsersResponse -> f DescribeUsersResponse)
-> ((Maybe [User] -> f (Maybe [User]))
    -> Maybe [User] -> f (Maybe [User]))
-> (Maybe [User] -> f (Maybe [User]))
-> DescribeUsersResponse
-> f DescribeUsersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [User] [User] [User] [User]
-> Iso (Maybe [User]) (Maybe [User]) (Maybe [User]) (Maybe [User])
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 [User] [User] [User] [User]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional argument to pass in case the total number of records exceeds
-- the value of MaxResults. If nextToken is returned, there are more
-- results available. The value of nextToken is a unique pagination token
-- for each page. Make the call again using the returned token to retrieve
-- the next page. Keep all other arguments unchanged.
describeUsersResponse_nextToken :: Lens.Lens' DescribeUsersResponse (Prelude.Maybe Prelude.Text)
describeUsersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeUsersResponse -> f DescribeUsersResponse
describeUsersResponse_nextToken = (DescribeUsersResponse -> Maybe Text)
-> (DescribeUsersResponse -> Maybe Text -> DescribeUsersResponse)
-> Lens
     DescribeUsersResponse
     DescribeUsersResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeUsersResponse' :: DescribeUsersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeUsersResponse
s@DescribeUsersResponse' {} Maybe Text
a -> DescribeUsersResponse
s {$sel:nextToken:DescribeUsersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeUsersResponse)

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

instance Prelude.NFData DescribeUsersResponse