{-# 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.ListRoles
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the IAM roles that have the specified path prefix. If there are
-- none, the operation returns an empty list. For more information about
-- roles, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/WorkingWithRoles.html Working with roles>.
--
-- 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 role, see GetRole.
--
-- You can paginate the results using the @MaxItems@ and @Marker@
-- parameters.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListRoles
  ( -- * Creating a Request
    ListRoles (..),
    newListRoles,

    -- * Request Lenses
    listRoles_marker,
    listRoles_maxItems,
    listRoles_pathPrefix,

    -- * Destructuring the Response
    ListRolesResponse (..),
    newListRolesResponse,

    -- * Response Lenses
    listRolesResponse_isTruncated,
    listRolesResponse_marker,
    listRolesResponse_httpStatus,
    listRolesResponse_roles,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListRoles' smart constructor.
data ListRoles = ListRoles'
  { -- | 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.
    ListRoles -> 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.
    ListRoles -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The path prefix for filtering the results. For example, the prefix
    -- @\/application_abc\/component_xyz\/@ gets all roles whose path starts
    -- with @\/application_abc\/component_xyz\/@.
    --
    -- This parameter is optional. If it is not included, it defaults to a
    -- slash (\/), listing all roles. 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.
    ListRoles -> Maybe Text
pathPrefix :: Prelude.Maybe Prelude.Text
  }
  deriving (ListRoles -> ListRoles -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRoles -> ListRoles -> Bool
$c/= :: ListRoles -> ListRoles -> Bool
== :: ListRoles -> ListRoles -> Bool
$c== :: ListRoles -> ListRoles -> Bool
Prelude.Eq, ReadPrec [ListRoles]
ReadPrec ListRoles
Int -> ReadS ListRoles
ReadS [ListRoles]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRoles]
$creadListPrec :: ReadPrec [ListRoles]
readPrec :: ReadPrec ListRoles
$creadPrec :: ReadPrec ListRoles
readList :: ReadS [ListRoles]
$creadList :: ReadS [ListRoles]
readsPrec :: Int -> ReadS ListRoles
$creadsPrec :: Int -> ReadS ListRoles
Prelude.Read, Int -> ListRoles -> ShowS
[ListRoles] -> ShowS
ListRoles -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRoles] -> ShowS
$cshowList :: [ListRoles] -> ShowS
show :: ListRoles -> String
$cshow :: ListRoles -> String
showsPrec :: Int -> ListRoles -> ShowS
$cshowsPrec :: Int -> ListRoles -> ShowS
Prelude.Show, forall x. Rep ListRoles x -> ListRoles
forall x. ListRoles -> Rep ListRoles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRoles x -> ListRoles
$cfrom :: forall x. ListRoles -> Rep ListRoles x
Prelude.Generic)

-- |
-- Create a value of 'ListRoles' 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', 'listRoles_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', 'listRoles_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.
--
-- 'pathPrefix', 'listRoles_pathPrefix' - The path prefix for filtering the results. For example, the prefix
-- @\/application_abc\/component_xyz\/@ gets all roles whose path starts
-- with @\/application_abc\/component_xyz\/@.
--
-- This parameter is optional. If it is not included, it defaults to a
-- slash (\/), listing all roles. 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.
newListRoles ::
  ListRoles
newListRoles :: ListRoles
newListRoles =
  ListRoles'
    { $sel:marker:ListRoles' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListRoles' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
      $sel:pathPrefix:ListRoles' :: Maybe Text
pathPrefix = forall a. Maybe a
Prelude.Nothing
    }

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

-- | 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.
listRoles_maxItems :: Lens.Lens' ListRoles (Prelude.Maybe Prelude.Natural)
listRoles_maxItems :: Lens' ListRoles (Maybe Natural)
listRoles_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoles' {Maybe Natural
maxItems :: Maybe Natural
$sel:maxItems:ListRoles' :: ListRoles -> Maybe Natural
maxItems} -> Maybe Natural
maxItems) (\s :: ListRoles
s@ListRoles' {} Maybe Natural
a -> ListRoles
s {$sel:maxItems:ListRoles' :: Maybe Natural
maxItems = Maybe Natural
a} :: ListRoles)

-- | The path prefix for filtering the results. For example, the prefix
-- @\/application_abc\/component_xyz\/@ gets all roles whose path starts
-- with @\/application_abc\/component_xyz\/@.
--
-- This parameter is optional. If it is not included, it defaults to a
-- slash (\/), listing all roles. 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.
listRoles_pathPrefix :: Lens.Lens' ListRoles (Prelude.Maybe Prelude.Text)
listRoles_pathPrefix :: Lens' ListRoles (Maybe Text)
listRoles_pathPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRoles' {Maybe Text
pathPrefix :: Maybe Text
$sel:pathPrefix:ListRoles' :: ListRoles -> Maybe Text
pathPrefix} -> Maybe Text
pathPrefix) (\s :: ListRoles
s@ListRoles' {} Maybe Text
a -> ListRoles
s {$sel:pathPrefix:ListRoles' :: Maybe Text
pathPrefix = Maybe Text
a} :: ListRoles)

instance Core.AWSPager ListRoles where
  page :: ListRoles -> AWSResponse ListRoles -> Maybe ListRoles
page ListRoles
rq AWSResponse ListRoles
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRoles
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRolesResponse (Maybe Bool)
listRolesResponse_isTruncated
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListRoles
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRolesResponse (Maybe Text)
listRolesResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListRoles
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListRoles (Maybe Text)
listRoles_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRoles
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRolesResponse (Maybe Text)
listRolesResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListRoles where
  type AWSResponse ListRoles = ListRolesResponse
  request :: (Service -> Service) -> ListRoles -> Request ListRoles
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListRoles
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListRoles)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListRolesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Bool -> Maybe Text -> Int -> [Role] -> ListRolesResponse
ListRolesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IsTruncated")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Roles"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListRoles where
  hashWithSalt :: Int -> ListRoles -> Int
hashWithSalt Int
_salt ListRoles' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListRoles' :: ListRoles -> Maybe Text
$sel:maxItems:ListRoles' :: ListRoles -> Maybe Natural
$sel:marker:ListRoles' :: ListRoles -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxItems
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pathPrefix

instance Prelude.NFData ListRoles where
  rnf :: ListRoles -> ()
rnf ListRoles' {Maybe Natural
Maybe Text
pathPrefix :: Maybe Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:pathPrefix:ListRoles' :: ListRoles -> Maybe Text
$sel:maxItems:ListRoles' :: ListRoles -> Maybe Natural
$sel:marker:ListRoles' :: ListRoles -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxItems
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pathPrefix

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

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

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

-- | Contains the response to a successful ListRoles request.
--
-- /See:/ 'newListRolesResponse' smart constructor.
data ListRolesResponse = ListRolesResponse'
  { -- | 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.
    ListRolesResponse -> Maybe Bool
isTruncated :: Prelude.Maybe Prelude.Bool,
    -- | When @IsTruncated@ is @true@, this element is present and contains the
    -- value to use for the @Marker@ parameter in a subsequent pagination
    -- request.
    ListRolesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListRolesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of roles.
    ListRolesResponse -> [Role]
roles :: [Role]
  }
  deriving (ListRolesResponse -> ListRolesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRolesResponse -> ListRolesResponse -> Bool
$c/= :: ListRolesResponse -> ListRolesResponse -> Bool
== :: ListRolesResponse -> ListRolesResponse -> Bool
$c== :: ListRolesResponse -> ListRolesResponse -> Bool
Prelude.Eq, ReadPrec [ListRolesResponse]
ReadPrec ListRolesResponse
Int -> ReadS ListRolesResponse
ReadS [ListRolesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRolesResponse]
$creadListPrec :: ReadPrec [ListRolesResponse]
readPrec :: ReadPrec ListRolesResponse
$creadPrec :: ReadPrec ListRolesResponse
readList :: ReadS [ListRolesResponse]
$creadList :: ReadS [ListRolesResponse]
readsPrec :: Int -> ReadS ListRolesResponse
$creadsPrec :: Int -> ReadS ListRolesResponse
Prelude.Read, Int -> ListRolesResponse -> ShowS
[ListRolesResponse] -> ShowS
ListRolesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRolesResponse] -> ShowS
$cshowList :: [ListRolesResponse] -> ShowS
show :: ListRolesResponse -> String
$cshow :: ListRolesResponse -> String
showsPrec :: Int -> ListRolesResponse -> ShowS
$cshowsPrec :: Int -> ListRolesResponse -> ShowS
Prelude.Show, forall x. Rep ListRolesResponse x -> ListRolesResponse
forall x. ListRolesResponse -> Rep ListRolesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRolesResponse x -> ListRolesResponse
$cfrom :: forall x. ListRolesResponse -> Rep ListRolesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRolesResponse' 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:
--
-- 'isTruncated', 'listRolesResponse_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.
--
-- 'marker', 'listRolesResponse_marker' - When @IsTruncated@ is @true@, this element is present and contains the
-- value to use for the @Marker@ parameter in a subsequent pagination
-- request.
--
-- 'httpStatus', 'listRolesResponse_httpStatus' - The response's http status code.
--
-- 'roles', 'listRolesResponse_roles' - A list of roles.
newListRolesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRolesResponse
newListRolesResponse :: Int -> ListRolesResponse
newListRolesResponse Int
pHttpStatus_ =
  ListRolesResponse'
    { $sel:isTruncated:ListRolesResponse' :: Maybe Bool
isTruncated = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListRolesResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRolesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:roles:ListRolesResponse' :: [Role]
roles = forall a. Monoid a => a
Prelude.mempty
    }

-- | 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.
listRolesResponse_isTruncated :: Lens.Lens' ListRolesResponse (Prelude.Maybe Prelude.Bool)
listRolesResponse_isTruncated :: Lens' ListRolesResponse (Maybe Bool)
listRolesResponse_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRolesResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListRolesResponse' :: ListRolesResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListRolesResponse
s@ListRolesResponse' {} Maybe Bool
a -> ListRolesResponse
s {$sel:isTruncated:ListRolesResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListRolesResponse)

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

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

-- | A list of roles.
listRolesResponse_roles :: Lens.Lens' ListRolesResponse [Role]
listRolesResponse_roles :: Lens' ListRolesResponse [Role]
listRolesResponse_roles = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRolesResponse' {[Role]
roles :: [Role]
$sel:roles:ListRolesResponse' :: ListRolesResponse -> [Role]
roles} -> [Role]
roles) (\s :: ListRolesResponse
s@ListRolesResponse' {} [Role]
a -> ListRolesResponse
s {$sel:roles:ListRolesResponse' :: [Role]
roles = [Role]
a} :: ListRolesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListRolesResponse where
  rnf :: ListRolesResponse -> ()
rnf ListRolesResponse' {Int
[Role]
Maybe Bool
Maybe Text
roles :: [Role]
httpStatus :: Int
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:roles:ListRolesResponse' :: ListRolesResponse -> [Role]
$sel:httpStatus:ListRolesResponse' :: ListRolesResponse -> Int
$sel:marker:ListRolesResponse' :: ListRolesResponse -> Maybe Text
$sel:isTruncated:ListRolesResponse' :: ListRolesResponse -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isTruncated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Role]
roles