{-# 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.ListUserPolicies
-- 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 embedded in the specified IAM
-- user.
--
-- An IAM user can also have managed policies attached to it. To list the
-- managed policies that are attached to a user, use
-- ListAttachedUserPolicies. 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
-- user, the operation returns an empty list.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListUserPolicies
  ( -- * Creating a Request
    ListUserPolicies (..),
    newListUserPolicies,

    -- * Request Lenses
    listUserPolicies_marker,
    listUserPolicies_maxItems,
    listUserPolicies_userName,

    -- * Destructuring the Response
    ListUserPoliciesResponse (..),
    newListUserPoliciesResponse,

    -- * Response Lenses
    listUserPoliciesResponse_isTruncated,
    listUserPoliciesResponse_marker,
    listUserPoliciesResponse_httpStatus,
    listUserPoliciesResponse_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:/ 'newListUserPolicies' smart constructor.
data ListUserPolicies = ListUserPolicies'
  { -- | 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.
    ListUserPolicies -> 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.
    ListUserPolicies -> Maybe Natural
maxItems :: Prelude.Maybe Prelude.Natural,
    -- | The name of the user 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: _+=,.\@-
    ListUserPolicies -> Text
userName :: Prelude.Text
  }
  deriving (ListUserPolicies -> ListUserPolicies -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserPolicies -> ListUserPolicies -> Bool
$c/= :: ListUserPolicies -> ListUserPolicies -> Bool
== :: ListUserPolicies -> ListUserPolicies -> Bool
$c== :: ListUserPolicies -> ListUserPolicies -> Bool
Prelude.Eq, ReadPrec [ListUserPolicies]
ReadPrec ListUserPolicies
Int -> ReadS ListUserPolicies
ReadS [ListUserPolicies]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserPolicies]
$creadListPrec :: ReadPrec [ListUserPolicies]
readPrec :: ReadPrec ListUserPolicies
$creadPrec :: ReadPrec ListUserPolicies
readList :: ReadS [ListUserPolicies]
$creadList :: ReadS [ListUserPolicies]
readsPrec :: Int -> ReadS ListUserPolicies
$creadsPrec :: Int -> ReadS ListUserPolicies
Prelude.Read, Int -> ListUserPolicies -> ShowS
[ListUserPolicies] -> ShowS
ListUserPolicies -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserPolicies] -> ShowS
$cshowList :: [ListUserPolicies] -> ShowS
show :: ListUserPolicies -> String
$cshow :: ListUserPolicies -> String
showsPrec :: Int -> ListUserPolicies -> ShowS
$cshowsPrec :: Int -> ListUserPolicies -> ShowS
Prelude.Show, forall x. Rep ListUserPolicies x -> ListUserPolicies
forall x. ListUserPolicies -> Rep ListUserPolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUserPolicies x -> ListUserPolicies
$cfrom :: forall x. ListUserPolicies -> Rep ListUserPolicies x
Prelude.Generic)

-- |
-- Create a value of 'ListUserPolicies' 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', 'listUserPolicies_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', 'listUserPolicies_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.
--
-- 'userName', 'listUserPolicies_userName' - The name of the user 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: _+=,.\@-
newListUserPolicies ::
  -- | 'userName'
  Prelude.Text ->
  ListUserPolicies
newListUserPolicies :: Text -> ListUserPolicies
newListUserPolicies Text
pUserName_ =
  ListUserPolicies'
    { $sel:marker:ListUserPolicies' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListUserPolicies' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
      $sel:userName:ListUserPolicies' :: Text
userName = Text
pUserName_
    }

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

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

-- | The name of the user 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: _+=,.\@-
listUserPolicies_userName :: Lens.Lens' ListUserPolicies Prelude.Text
listUserPolicies_userName :: Lens' ListUserPolicies Text
listUserPolicies_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserPolicies' {Text
userName :: Text
$sel:userName:ListUserPolicies' :: ListUserPolicies -> Text
userName} -> Text
userName) (\s :: ListUserPolicies
s@ListUserPolicies' {} Text
a -> ListUserPolicies
s {$sel:userName:ListUserPolicies' :: Text
userName = Text
a} :: ListUserPolicies)

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

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

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

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

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

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

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

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

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

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