{-# 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.IAM.ListUsers
-- 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 IAM users that have the specified path prefix. If no path
-- prefix is specified, the operation returns all users in the Amazon Web
-- Services account. If there are none, the operation returns an empty
-- list.
--
-- IAM resource-listing operations return a subset of the available
-- attributes for the resource. For example, this operation does not return
-- tags, even though they are an attribute of the returned object. To view
-- all of the information for a user, see GetUser.
--
-- You can paginate the results using the @MaxItems@ and @Marker@
-- parameters.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListUsers
  ( -- * Creating a Request
    ListUsers (..),
    newListUsers,

    -- * Request Lenses
    listUsers_pathPrefix,
    listUsers_marker,
    listUsers_maxItems,

    -- * Destructuring the Response
    ListUsersResponse (..),
    newListUsersResponse,

    -- * Response Lenses
    listUsersResponse_marker,
    listUsersResponse_isTruncated,
    listUsersResponse_httpStatus,
    listUsersResponse_users,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IAM.Types
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:/ 'newListUsers' smart constructor.
data ListUsers = ListUsers'
  { -- | The path prefix for filtering the results. For example:
    -- @\/division_abc\/subdivision_xyz\/@, which would get all user names
    -- whose path starts with @\/division_abc\/subdivision_xyz\/@.
    --
    -- This parameter is optional. If it is not included, it defaults to a
    -- slash (\/), listing all user names. This parameter allows (through its
    -- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
    -- consisting of either a forward slash (\/) by itself or a string that
    -- must begin and end with forward slashes. In addition, it can contain any
    -- ASCII character from the ! (@\\u0021@) through the DEL character
    -- (@\\u007F@), including most punctuation characters, digits, and upper
    -- and lowercased letters.
    ListUsers -> Maybe Text
pathPrefix :: Prelude.Maybe Prelude.Text,
    -- | Use this parameter only when paginating results and only after you
    -- receive a response indicating that the results are truncated. Set it to
    -- the value of the @Marker@ element in the response that you received to
    -- indicate where the next call should start.
    ListUsers -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Use this only when paginating results to indicate the maximum number of
    -- items you want in the response. If additional items exist beyond the
    -- maximum you specify, the @IsTruncated@ response element is @true@.
    --
    -- If you do not include this parameter, the number of items defaults to
    -- 100. Note that IAM might return fewer results, even when there are more
    -- results available. In that case, the @IsTruncated@ response element
    -- returns @true@, and @Marker@ contains a value to include in the
    -- subsequent call that tells the service where to continue from.
    ListUsers -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListUsers -> ListUsers -> Bool
(ListUsers -> ListUsers -> Bool)
-> (ListUsers -> ListUsers -> Bool) -> Eq ListUsers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUsers -> ListUsers -> Bool
$c/= :: ListUsers -> ListUsers -> Bool
== :: ListUsers -> ListUsers -> Bool
$c== :: ListUsers -> ListUsers -> Bool
Prelude.Eq, ReadPrec [ListUsers]
ReadPrec ListUsers
Int -> ReadS ListUsers
ReadS [ListUsers]
(Int -> ReadS ListUsers)
-> ReadS [ListUsers]
-> ReadPrec ListUsers
-> ReadPrec [ListUsers]
-> Read ListUsers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUsers]
$creadListPrec :: ReadPrec [ListUsers]
readPrec :: ReadPrec ListUsers
$creadPrec :: ReadPrec ListUsers
readList :: ReadS [ListUsers]
$creadList :: ReadS [ListUsers]
readsPrec :: Int -> ReadS ListUsers
$creadsPrec :: Int -> ReadS ListUsers
Prelude.Read, Int -> ListUsers -> ShowS
[ListUsers] -> ShowS
ListUsers -> String
(Int -> ListUsers -> ShowS)
-> (ListUsers -> String)
-> ([ListUsers] -> ShowS)
-> Show ListUsers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUsers] -> ShowS
$cshowList :: [ListUsers] -> ShowS
show :: ListUsers -> String
$cshow :: ListUsers -> String
showsPrec :: Int -> ListUsers -> ShowS
$cshowsPrec :: Int -> ListUsers -> ShowS
Prelude.Show, (forall x. ListUsers -> Rep ListUsers x)
-> (forall x. Rep ListUsers x -> ListUsers) -> Generic ListUsers
forall x. Rep ListUsers x -> ListUsers
forall x. ListUsers -> Rep ListUsers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUsers x -> ListUsers
$cfrom :: forall x. ListUsers -> Rep ListUsers x
Prelude.Generic)

-- |
-- Create a value of 'ListUsers' 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:
--
-- 'pathPrefix', 'listUsers_pathPrefix' - The path prefix for filtering the results. For example:
-- @\/division_abc\/subdivision_xyz\/@, which would get all user names
-- whose path starts with @\/division_abc\/subdivision_xyz\/@.
--
-- This parameter is optional. If it is not included, it defaults to a
-- slash (\/), listing all user names. This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of either a forward slash (\/) by itself or a string that
-- must begin and end with forward slashes. In addition, it can contain any
-- ASCII character from the ! (@\\u0021@) through the DEL character
-- (@\\u007F@), including most punctuation characters, digits, and upper
-- and lowercased letters.
--
-- 'marker', 'listUsers_marker' - Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
--
-- 'maxItems', 'listUsers_maxItems' - Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
newListUsers ::
  ListUsers
newListUsers :: ListUsers
newListUsers =
  ListUsers' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListUsers
ListUsers'
    { $sel:pathPrefix:ListUsers' :: Maybe Text
pathPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListUsers' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListUsers' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The path prefix for filtering the results. For example:
-- @\/division_abc\/subdivision_xyz\/@, which would get all user names
-- whose path starts with @\/division_abc\/subdivision_xyz\/@.
--
-- This parameter is optional. If it is not included, it defaults to a
-- slash (\/), listing all user names. This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of either a forward slash (\/) by itself or a string that
-- must begin and end with forward slashes. In addition, it can contain any
-- ASCII character from the ! (@\\u0021@) through the DEL character
-- (@\\u007F@), including most punctuation characters, digits, and upper
-- and lowercased letters.
listUsers_pathPrefix :: Lens.Lens' ListUsers (Prelude.Maybe Prelude.Text)
listUsers_pathPrefix :: (Maybe Text -> f (Maybe Text)) -> ListUsers -> f ListUsers
listUsers_pathPrefix = (ListUsers -> Maybe Text)
-> (ListUsers -> Maybe Text -> ListUsers)
-> Lens ListUsers ListUsers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsers' {Maybe Text
pathPrefix :: Maybe Text
$sel:pathPrefix:ListUsers' :: ListUsers -> Maybe Text
pathPrefix} -> Maybe Text
pathPrefix) (\s :: ListUsers
s@ListUsers' {} Maybe Text
a -> ListUsers
s {$sel:pathPrefix:ListUsers' :: Maybe Text
pathPrefix = Maybe Text
a} :: ListUsers)

-- | Use this parameter only when paginating results and only after you
-- receive a response indicating that the results are truncated. Set it to
-- the value of the @Marker@ element in the response that you received to
-- indicate where the next call should start.
listUsers_marker :: Lens.Lens' ListUsers (Prelude.Maybe Prelude.Text)
listUsers_marker :: (Maybe Text -> f (Maybe Text)) -> ListUsers -> f ListUsers
listUsers_marker = (ListUsers -> Maybe Text)
-> (ListUsers -> Maybe Text -> ListUsers)
-> Lens ListUsers ListUsers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsers' {Maybe Text
marker :: Maybe Text
$sel:marker:ListUsers' :: ListUsers -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListUsers
s@ListUsers' {} Maybe Text
a -> ListUsers
s {$sel:marker:ListUsers' :: Maybe Text
marker = Maybe Text
a} :: ListUsers)

-- | Use this only when paginating results to indicate the maximum number of
-- items you want in the response. If additional items exist beyond the
-- maximum you specify, the @IsTruncated@ response element is @true@.
--
-- If you do not include this parameter, the number of items defaults to
-- 100. Note that IAM might return fewer results, even when there are more
-- results available. In that case, the @IsTruncated@ response element
-- returns @true@, and @Marker@ contains a value to include in the
-- subsequent call that tells the service where to continue from.
listUsers_maxItems :: Lens.Lens' ListUsers (Prelude.Maybe Prelude.Natural)
listUsers_maxItems :: (Maybe Natural -> f (Maybe Natural)) -> ListUsers -> f ListUsers
listUsers_maxItems = (ListUsers -> Maybe Natural)
-> (ListUsers -> Maybe Natural -> ListUsers)
-> Lens ListUsers ListUsers (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsers' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListUsers' :: ListUsers -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListUsers
s@ListUsers' {} Maybe Natural
a -> ListUsers
s {$sel:maxItems:ListUsers' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListUsers)

instance Core.AWSPager ListUsers where
  page :: ListUsers -> AWSResponse ListUsers -> Maybe ListUsers
page ListUsers
rq AWSResponse ListUsers
rs
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUsers
ListUsersResponse
rs
            ListUsersResponse
-> Getting (First Bool) ListUsersResponse Bool -> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListUsersResponse -> Const (First Bool) ListUsersResponse
Lens' ListUsersResponse (Maybe Bool)
listUsersResponse_isTruncated ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListUsersResponse -> Const (First Bool) ListUsersResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListUsersResponse Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Bool -> Const (First Bool) Bool)
-> Maybe Bool -> Const (First Bool) (Maybe Bool)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListUsers
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListUsers
ListUsersResponse
rs
            ListUsersResponse
-> Getting (First Text) ListUsersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUsersResponse -> Const (First Text) ListUsersResponse
Lens' ListUsersResponse (Maybe Text)
listUsersResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUsersResponse -> Const (First Text) ListUsersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUsersResponse 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 ListUsers
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListUsers -> Maybe ListUsers
forall a. a -> Maybe a
Prelude.Just (ListUsers -> Maybe ListUsers) -> ListUsers -> Maybe ListUsers
forall a b. (a -> b) -> a -> b
Prelude.$
        ListUsers
rq
          ListUsers -> (ListUsers -> ListUsers) -> ListUsers
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListUsers -> Identity ListUsers
Lens ListUsers ListUsers (Maybe Text) (Maybe Text)
listUsers_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListUsers -> Identity ListUsers)
-> Maybe Text -> ListUsers -> ListUsers
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUsers
ListUsersResponse
rs
          ListUsersResponse
-> Getting (First Text) ListUsersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUsersResponse -> Const (First Text) ListUsersResponse
Lens' ListUsersResponse (Maybe Text)
listUsersResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUsersResponse -> Const (First Text) ListUsersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUsersResponse 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 ListUsers where
  type AWSResponse ListUsers = ListUsersResponse
  request :: ListUsers -> Request ListUsers
request = Service -> ListUsers -> Request ListUsers
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListUsers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUsers)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListUsers))
-> Logger
-> Service
-> Proxy ListUsers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUsers)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListUsersResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Maybe Bool -> Int -> [User] -> ListUsersResponse
ListUsersResponse'
            (Maybe Text -> Maybe Bool -> Int -> [User] -> ListUsersResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Bool -> Int -> [User] -> ListUsersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Marker")
            Either String (Maybe Bool -> Int -> [User] -> ListUsersResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> [User] -> ListUsersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IsTruncated")
            Either String (Int -> [User] -> ListUsersResponse)
-> Either String Int -> Either String ([User] -> ListUsersResponse)
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 ([User] -> ListUsersResponse)
-> Either String [User] -> Either String ListUsersResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Users" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String [User]) -> Either String [User]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [User]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListUsers

instance Prelude.NFData ListUsers

instance Core.ToHeaders ListUsers where
  toHeaders :: ListUsers -> ResponseHeaders
toHeaders = ResponseHeaders -> ListUsers -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery ListUsers where
  toQuery :: ListUsers -> QueryString
toQuery ListUsers' {Maybe Natural
Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
pathPrefix :: Maybe Text
$sel:maxItems:ListUsers' :: ListUsers -> Maybe Natural
$sel:marker:ListUsers' :: ListUsers -> Maybe Text
$sel:pathPrefix:ListUsers' :: ListUsers -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListUsers" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"PathPrefix" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
pathPrefix,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxItems" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxItems
      ]

-- | Contains the response to a successful ListUsers request.
--
-- /See:/ 'newListUsersResponse' smart constructor.
data ListUsersResponse = ListUsersResponse'
  { -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    ListUsersResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | A flag that indicates whether there are more items to return. If your
    -- results were truncated, you can make a subsequent pagination request
    -- using the @Marker@ request parameter to retrieve more items. Note that
    -- IAM might return fewer than the @MaxItems@ number of results even when
    -- there are more results available. We recommend that you check
    -- @IsTruncated@ after every call to ensure that you receive all your
    -- results.
    ListUsersResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    ListUsersResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of users.
    ListUsersResponse -> [User]
users :: [User]
  }
  deriving (ListUsersResponse -> ListUsersResponse -> Bool
(ListUsersResponse -> ListUsersResponse -> Bool)
-> (ListUsersResponse -> ListUsersResponse -> Bool)
-> Eq ListUsersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUsersResponse -> ListUsersResponse -> Bool
$c/= :: ListUsersResponse -> ListUsersResponse -> Bool
== :: ListUsersResponse -> ListUsersResponse -> Bool
$c== :: ListUsersResponse -> ListUsersResponse -> Bool
Prelude.Eq, ReadPrec [ListUsersResponse]
ReadPrec ListUsersResponse
Int -> ReadS ListUsersResponse
ReadS [ListUsersResponse]
(Int -> ReadS ListUsersResponse)
-> ReadS [ListUsersResponse]
-> ReadPrec ListUsersResponse
-> ReadPrec [ListUsersResponse]
-> Read ListUsersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUsersResponse]
$creadListPrec :: ReadPrec [ListUsersResponse]
readPrec :: ReadPrec ListUsersResponse
$creadPrec :: ReadPrec ListUsersResponse
readList :: ReadS [ListUsersResponse]
$creadList :: ReadS [ListUsersResponse]
readsPrec :: Int -> ReadS ListUsersResponse
$creadsPrec :: Int -> ReadS ListUsersResponse
Prelude.Read, Int -> ListUsersResponse -> ShowS
[ListUsersResponse] -> ShowS
ListUsersResponse -> String
(Int -> ListUsersResponse -> ShowS)
-> (ListUsersResponse -> String)
-> ([ListUsersResponse] -> ShowS)
-> Show ListUsersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUsersResponse] -> ShowS
$cshowList :: [ListUsersResponse] -> ShowS
show :: ListUsersResponse -> String
$cshow :: ListUsersResponse -> String
showsPrec :: Int -> ListUsersResponse -> ShowS
$cshowsPrec :: Int -> ListUsersResponse -> ShowS
Prelude.Show, (forall x. ListUsersResponse -> Rep ListUsersResponse x)
-> (forall x. Rep ListUsersResponse x -> ListUsersResponse)
-> Generic ListUsersResponse
forall x. Rep ListUsersResponse x -> ListUsersResponse
forall x. ListUsersResponse -> Rep ListUsersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUsersResponse x -> ListUsersResponse
$cfrom :: forall x. ListUsersResponse -> Rep ListUsersResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListUsersResponse' 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:
--
-- 'marker', 'listUsersResponse_marker' - When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
--
-- 'isTruncated', 'listUsersResponse_isTruncated' - A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
--
-- 'httpStatus', 'listUsersResponse_httpStatus' - The response's http status code.
--
-- 'users', 'listUsersResponse_users' - A list of users.
newListUsersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListUsersResponse
newListUsersResponse :: Int -> ListUsersResponse
newListUsersResponse Int
pHttpStatus_ =
  ListUsersResponse' :: Maybe Text -> Maybe Bool -> Int -> [User] -> ListUsersResponse
ListUsersResponse'
    { $sel:marker:ListUsersResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListUsersResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListUsersResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:users:ListUsersResponse' :: [User]
users = [User]
forall a. Monoid a => a
Prelude.mempty
    }

-- | When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
listUsersResponse_marker :: Lens.Lens' ListUsersResponse (Prelude.Maybe Prelude.Text)
listUsersResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListUsersResponse -> f ListUsersResponse
listUsersResponse_marker = (ListUsersResponse -> Maybe Text)
-> (ListUsersResponse -> Maybe Text -> ListUsersResponse)
-> Lens' ListUsersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsersResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListUsersResponse' :: ListUsersResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListUsersResponse
s@ListUsersResponse' {} Maybe Text
a -> ListUsersResponse
s {$sel:marker:ListUsersResponse' :: Maybe Text
marker = Maybe Text
a} :: ListUsersResponse)

-- | A flag that indicates whether there are more items to return. If your
-- results were truncated, you can make a subsequent pagination request
-- using the @Marker@ request parameter to retrieve more items. Note that
-- IAM might return fewer than the @MaxItems@ number of results even when
-- there are more results available. We recommend that you check
-- @IsTruncated@ after every call to ensure that you receive all your
-- results.
listUsersResponse_isTruncated :: Lens.Lens' ListUsersResponse (Prelude.Maybe Prelude.Bool)
listUsersResponse_isTruncated :: (Maybe Bool -> f (Maybe Bool))
-> ListUsersResponse -> f ListUsersResponse
listUsersResponse_isTruncated = (ListUsersResponse -> Maybe Bool)
-> (ListUsersResponse -> Maybe Bool -> ListUsersResponse)
-> Lens' ListUsersResponse (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsersResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListUsersResponse' :: ListUsersResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListUsersResponse
s@ListUsersResponse' {} Maybe Bool
a -> ListUsersResponse
s {$sel:isTruncated:ListUsersResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListUsersResponse)

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

-- | A list of users.
listUsersResponse_users :: Lens.Lens' ListUsersResponse [User]
listUsersResponse_users :: ([User] -> f [User]) -> ListUsersResponse -> f ListUsersResponse
listUsersResponse_users = (ListUsersResponse -> [User])
-> (ListUsersResponse -> [User] -> ListUsersResponse)
-> Lens ListUsersResponse ListUsersResponse [User] [User]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsersResponse' {[User]
users :: [User]
$sel:users:ListUsersResponse' :: ListUsersResponse -> [User]
users} -> [User]
users) (\s :: ListUsersResponse
s@ListUsersResponse' {} [User]
a -> ListUsersResponse
s {$sel:users:ListUsersResponse' :: [User]
users = [User]
a} :: ListUsersResponse) (([User] -> f [User]) -> ListUsersResponse -> f ListUsersResponse)
-> (([User] -> f [User]) -> [User] -> f [User])
-> ([User] -> f [User])
-> ListUsersResponse
-> f ListUsersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([User] -> f [User]) -> [User] -> f [User]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListUsersResponse