{-# 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.ListRolePolicies
-- 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 names of the inline policies that are embedded in the
-- specified IAM role.
--
-- An IAM role can also have managed policies attached to it. To list the
-- managed policies that are attached to a role, use
-- ListAttachedRolePolicies. For more information about policies, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html Managed policies and inline policies>
-- in the /IAM User Guide/.
--
-- You can paginate the results using the @MaxItems@ and @Marker@
-- parameters. If there are no inline policies embedded with the specified
-- role, the operation returns an empty list.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListRolePolicies
  ( -- * Creating a Request
    ListRolePolicies (..),
    newListRolePolicies,

    -- * Request Lenses
    listRolePolicies_marker,
    listRolePolicies_maxItems,
    listRolePolicies_roleName,

    -- * Destructuring the Response
    ListRolePoliciesResponse (..),
    newListRolePoliciesResponse,

    -- * Response Lenses
    listRolePoliciesResponse_isTruncated,
    listRolePoliciesResponse_marker,
    listRolePoliciesResponse_httpStatus,
    listRolePoliciesResponse_policyNames,
  )
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:/ 'newListRolePolicies' smart constructor.
data ListRolePolicies = ListRolePolicies'
  { -- | 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.
    ListRolePolicies -> 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.
    ListRolePolicies -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The name of the role to list policies for.
    --
    -- This parameter allows (through its
    -- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
    -- consisting of upper and lowercase alphanumeric characters with no
    -- spaces. You can also include any of the following characters: _+=,.\@-
    ListRolePolicies -> Text
roleName :: Prelude.Text
  }
  deriving (ListRolePolicies -> ListRolePolicies -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRolePolicies -> ListRolePolicies -> Bool
$c/= :: ListRolePolicies -> ListRolePolicies -> Bool
== :: ListRolePolicies -> ListRolePolicies -> Bool
$c== :: ListRolePolicies -> ListRolePolicies -> Bool
Prelude.Eq, ReadPrec [ListRolePolicies]
ReadPrec ListRolePolicies
Int -> ReadS ListRolePolicies
ReadS [ListRolePolicies]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRolePolicies]
$creadListPrec :: ReadPrec [ListRolePolicies]
readPrec :: ReadPrec ListRolePolicies
$creadPrec :: ReadPrec ListRolePolicies
readList :: ReadS [ListRolePolicies]
$creadList :: ReadS [ListRolePolicies]
readsPrec :: Int -> ReadS ListRolePolicies
$creadsPrec :: Int -> ReadS ListRolePolicies
Prelude.Read, Int -> ListRolePolicies -> ShowS
[ListRolePolicies] -> ShowS
ListRolePolicies -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRolePolicies] -> ShowS
$cshowList :: [ListRolePolicies] -> ShowS
show :: ListRolePolicies -> String
$cshow :: ListRolePolicies -> String
showsPrec :: Int -> ListRolePolicies -> ShowS
$cshowsPrec :: Int -> ListRolePolicies -> ShowS
Prelude.Show, forall x. Rep ListRolePolicies x -> ListRolePolicies
forall x. ListRolePolicies -> Rep ListRolePolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRolePolicies x -> ListRolePolicies
$cfrom :: forall x. ListRolePolicies -> Rep ListRolePolicies x
Prelude.Generic)

-- |
-- Create a value of 'ListRolePolicies' 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', 'listRolePolicies_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', 'listRolePolicies_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.
--
-- 'roleName', 'listRolePolicies_roleName' - The name of the role to list policies for.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
newListRolePolicies ::
  -- | 'roleName'
  Prelude.Text ->
  ListRolePolicies
newListRolePolicies :: Text -> ListRolePolicies
newListRolePolicies Text
pRoleName_ =
  ListRolePolicies'
    { $sel:marker:ListRolePolicies' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListRolePolicies' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
      $sel:roleName:ListRolePolicies' :: Text
roleName = Text
pRoleName_
    }

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

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

-- | The name of the role to list policies for.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
listRolePolicies_roleName :: Lens.Lens' ListRolePolicies Prelude.Text
listRolePolicies_roleName :: Lens' ListRolePolicies Text
listRolePolicies_roleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRolePolicies' {Text
roleName :: Text
$sel:roleName:ListRolePolicies' :: ListRolePolicies -> Text
roleName} -> Text
roleName) (\s :: ListRolePolicies
s@ListRolePolicies' {} Text
a -> ListRolePolicies
s {$sel:roleName:ListRolePolicies' :: Text
roleName = Text
a} :: ListRolePolicies)

instance Core.AWSPager ListRolePolicies where
  page :: ListRolePolicies
-> AWSResponse ListRolePolicies -> Maybe ListRolePolicies
page ListRolePolicies
rq AWSResponse ListRolePolicies
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRolePolicies
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRolePoliciesResponse (Maybe Bool)
listRolePoliciesResponse_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 ListRolePolicies
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRolePoliciesResponse (Maybe Text)
listRolePoliciesResponse_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.$ ListRolePolicies
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListRolePolicies (Maybe Text)
listRolePolicies_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRolePolicies
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRolePoliciesResponse (Maybe Text)
listRolePoliciesResponse_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 ListRolePolicies where
  type
    AWSResponse ListRolePolicies =
      ListRolePoliciesResponse
  request :: (Service -> Service)
-> ListRolePolicies -> Request ListRolePolicies
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 ListRolePolicies
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListRolePolicies)))
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
"ListRolePoliciesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Bool
-> Maybe Text -> Int -> [Text] -> ListRolePoliciesResponse
ListRolePoliciesResponse'
            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
"PolicyNames"
                            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 ListRolePolicies where
  hashWithSalt :: Int -> ListRolePolicies -> Int
hashWithSalt Int
_salt ListRolePolicies' {Maybe Natural
Maybe Text
Text
roleName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:roleName:ListRolePolicies' :: ListRolePolicies -> Text
$sel:maxItems:ListRolePolicies' :: ListRolePolicies -> Maybe Natural
$sel:marker:ListRolePolicies' :: ListRolePolicies -> 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` Text
roleName

instance Prelude.NFData ListRolePolicies where
  rnf :: ListRolePolicies -> ()
rnf ListRolePolicies' {Maybe Natural
Maybe Text
Text
roleName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:roleName:ListRolePolicies' :: ListRolePolicies -> Text
$sel:maxItems:ListRolePolicies' :: ListRolePolicies -> Maybe Natural
$sel:marker:ListRolePolicies' :: ListRolePolicies -> 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 Text
roleName

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

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

instance Data.ToQuery ListRolePolicies where
  toQuery :: ListRolePolicies -> QueryString
toQuery ListRolePolicies' {Maybe Natural
Maybe Text
Text
roleName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:roleName:ListRolePolicies' :: ListRolePolicies -> Text
$sel:maxItems:ListRolePolicies' :: ListRolePolicies -> Maybe Natural
$sel:marker:ListRolePolicies' :: ListRolePolicies -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListRolePolicies" :: 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
"RoleName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
roleName
      ]

-- | Contains the response to a successful ListRolePolicies request.
--
-- /See:/ 'newListRolePoliciesResponse' smart constructor.
data ListRolePoliciesResponse = ListRolePoliciesResponse'
  { -- | 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.
    ListRolePoliciesResponse -> 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.
    ListRolePoliciesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListRolePoliciesResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of policy names.
    ListRolePoliciesResponse -> [Text]
policyNames :: [Prelude.Text]
  }
  deriving (ListRolePoliciesResponse -> ListRolePoliciesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRolePoliciesResponse -> ListRolePoliciesResponse -> Bool
$c/= :: ListRolePoliciesResponse -> ListRolePoliciesResponse -> Bool
== :: ListRolePoliciesResponse -> ListRolePoliciesResponse -> Bool
$c== :: ListRolePoliciesResponse -> ListRolePoliciesResponse -> Bool
Prelude.Eq, ReadPrec [ListRolePoliciesResponse]
ReadPrec ListRolePoliciesResponse
Int -> ReadS ListRolePoliciesResponse
ReadS [ListRolePoliciesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRolePoliciesResponse]
$creadListPrec :: ReadPrec [ListRolePoliciesResponse]
readPrec :: ReadPrec ListRolePoliciesResponse
$creadPrec :: ReadPrec ListRolePoliciesResponse
readList :: ReadS [ListRolePoliciesResponse]
$creadList :: ReadS [ListRolePoliciesResponse]
readsPrec :: Int -> ReadS ListRolePoliciesResponse
$creadsPrec :: Int -> ReadS ListRolePoliciesResponse
Prelude.Read, Int -> ListRolePoliciesResponse -> ShowS
[ListRolePoliciesResponse] -> ShowS
ListRolePoliciesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRolePoliciesResponse] -> ShowS
$cshowList :: [ListRolePoliciesResponse] -> ShowS
show :: ListRolePoliciesResponse -> String
$cshow :: ListRolePoliciesResponse -> String
showsPrec :: Int -> ListRolePoliciesResponse -> ShowS
$cshowsPrec :: Int -> ListRolePoliciesResponse -> ShowS
Prelude.Show, forall x.
Rep ListRolePoliciesResponse x -> ListRolePoliciesResponse
forall x.
ListRolePoliciesResponse -> Rep ListRolePoliciesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRolePoliciesResponse x -> ListRolePoliciesResponse
$cfrom :: forall x.
ListRolePoliciesResponse -> Rep ListRolePoliciesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRolePoliciesResponse' 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', 'listRolePoliciesResponse_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', 'listRolePoliciesResponse_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', 'listRolePoliciesResponse_httpStatus' - The response's http status code.
--
-- 'policyNames', 'listRolePoliciesResponse_policyNames' - A list of policy names.
newListRolePoliciesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRolePoliciesResponse
newListRolePoliciesResponse :: Int -> ListRolePoliciesResponse
newListRolePoliciesResponse Int
pHttpStatus_ =
  ListRolePoliciesResponse'
    { $sel:isTruncated:ListRolePoliciesResponse' :: Maybe Bool
isTruncated =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListRolePoliciesResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRolePoliciesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:policyNames:ListRolePoliciesResponse' :: [Text]
policyNames = 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.
listRolePoliciesResponse_isTruncated :: Lens.Lens' ListRolePoliciesResponse (Prelude.Maybe Prelude.Bool)
listRolePoliciesResponse_isTruncated :: Lens' ListRolePoliciesResponse (Maybe Bool)
listRolePoliciesResponse_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRolePoliciesResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListRolePoliciesResponse' :: ListRolePoliciesResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListRolePoliciesResponse
s@ListRolePoliciesResponse' {} Maybe Bool
a -> ListRolePoliciesResponse
s {$sel:isTruncated:ListRolePoliciesResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListRolePoliciesResponse)

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

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

-- | A list of policy names.
listRolePoliciesResponse_policyNames :: Lens.Lens' ListRolePoliciesResponse [Prelude.Text]
listRolePoliciesResponse_policyNames :: Lens' ListRolePoliciesResponse [Text]
listRolePoliciesResponse_policyNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRolePoliciesResponse' {[Text]
policyNames :: [Text]
$sel:policyNames:ListRolePoliciesResponse' :: ListRolePoliciesResponse -> [Text]
policyNames} -> [Text]
policyNames) (\s :: ListRolePoliciesResponse
s@ListRolePoliciesResponse' {} [Text]
a -> ListRolePoliciesResponse
s {$sel:policyNames:ListRolePoliciesResponse' :: [Text]
policyNames = [Text]
a} :: ListRolePoliciesResponse) 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 ListRolePoliciesResponse where
  rnf :: ListRolePoliciesResponse -> ()
rnf ListRolePoliciesResponse' {Int
[Text]
Maybe Bool
Maybe Text
policyNames :: [Text]
httpStatus :: Int
marker :: Maybe Text
isTruncated :: Maybe Bool
$sel:policyNames:ListRolePoliciesResponse' :: ListRolePoliciesResponse -> [Text]
$sel:httpStatus:ListRolePoliciesResponse' :: ListRolePoliciesResponse -> Int
$sel:marker:ListRolePoliciesResponse' :: ListRolePoliciesResponse -> Maybe Text
$sel:isTruncated:ListRolePoliciesResponse' :: ListRolePoliciesResponse -> 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 [Text]
policyNames