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

    -- * Request Lenses
    listGroupPolicies_marker,
    listGroupPolicies_maxItems,
    listGroupPolicies_groupName,

    -- * Destructuring the Response
    ListGroupPoliciesResponse (..),
    newListGroupPoliciesResponse,

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

-- |
-- Create a value of 'ListGroupPolicies' 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', 'listGroupPolicies_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', 'listGroupPolicies_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.
--
-- 'groupName', 'listGroupPolicies_groupName' - The name of the group 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: _+=,.\@-
newListGroupPolicies ::
  -- | 'groupName'
  Prelude.Text ->
  ListGroupPolicies
newListGroupPolicies :: Text -> ListGroupPolicies
newListGroupPolicies Text
pGroupName_ =
  ListGroupPolicies' :: Maybe Text -> Maybe Natural -> Text -> ListGroupPolicies
ListGroupPolicies'
    { $sel:marker:ListGroupPolicies' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListGroupPolicies' :: Maybe Natural
maxItems = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:ListGroupPolicies' :: Text
groupName = Text
pGroupName_
    }

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

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

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

instance Core.AWSPager ListGroupPolicies where
  page :: ListGroupPolicies
-> AWSResponse ListGroupPolicies -> Maybe ListGroupPolicies
page ListGroupPolicies
rq AWSResponse ListGroupPolicies
rs
    | Maybe Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListGroupPolicies
ListGroupPoliciesResponse
rs
            ListGroupPoliciesResponse
-> Getting (First Bool) ListGroupPoliciesResponse Bool
-> Maybe Bool
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Bool -> Const (First Bool) (Maybe Bool))
-> ListGroupPoliciesResponse
-> Const (First Bool) ListGroupPoliciesResponse
Lens' ListGroupPoliciesResponse (Maybe Bool)
listGroupPoliciesResponse_isTruncated
              ((Maybe Bool -> Const (First Bool) (Maybe Bool))
 -> ListGroupPoliciesResponse
 -> Const (First Bool) ListGroupPoliciesResponse)
-> ((Bool -> Const (First Bool) Bool)
    -> Maybe Bool -> Const (First Bool) (Maybe Bool))
-> Getting (First Bool) ListGroupPoliciesResponse 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 ListGroupPolicies
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse ListGroupPolicies
ListGroupPoliciesResponse
rs
            ListGroupPoliciesResponse
-> Getting (First Text) ListGroupPoliciesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListGroupPoliciesResponse
-> Const (First Text) ListGroupPoliciesResponse
Lens' ListGroupPoliciesResponse (Maybe Text)
listGroupPoliciesResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListGroupPoliciesResponse
 -> Const (First Text) ListGroupPoliciesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListGroupPoliciesResponse 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 ListGroupPolicies
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListGroupPolicies -> Maybe ListGroupPolicies
forall a. a -> Maybe a
Prelude.Just (ListGroupPolicies -> Maybe ListGroupPolicies)
-> ListGroupPolicies -> Maybe ListGroupPolicies
forall a b. (a -> b) -> a -> b
Prelude.$
        ListGroupPolicies
rq
          ListGroupPolicies
-> (ListGroupPolicies -> ListGroupPolicies) -> ListGroupPolicies
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListGroupPolicies -> Identity ListGroupPolicies
Lens ListGroupPolicies ListGroupPolicies (Maybe Text) (Maybe Text)
listGroupPolicies_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> ListGroupPolicies -> Identity ListGroupPolicies)
-> Maybe Text -> ListGroupPolicies -> ListGroupPolicies
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListGroupPolicies
ListGroupPoliciesResponse
rs
          ListGroupPoliciesResponse
-> Getting (First Text) ListGroupPoliciesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListGroupPoliciesResponse
-> Const (First Text) ListGroupPoliciesResponse
Lens' ListGroupPoliciesResponse (Maybe Text)
listGroupPoliciesResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListGroupPoliciesResponse
 -> Const (First Text) ListGroupPoliciesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListGroupPoliciesResponse 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 ListGroupPolicies where
  type
    AWSResponse ListGroupPolicies =
      ListGroupPoliciesResponse
  request :: ListGroupPolicies -> Request ListGroupPolicies
request = Service -> ListGroupPolicies -> Request ListGroupPolicies
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListGroupPolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListGroupPolicies)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListGroupPolicies))
-> Logger
-> Service
-> Proxy ListGroupPolicies
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListGroupPolicies)))
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
"ListGroupPoliciesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe Bool -> Int -> [Text] -> ListGroupPoliciesResponse
ListGroupPoliciesResponse'
            (Maybe Text
 -> Maybe Bool -> Int -> [Text] -> ListGroupPoliciesResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Bool -> Int -> [Text] -> ListGroupPoliciesResponse)
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 -> [Text] -> ListGroupPoliciesResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> [Text] -> ListGroupPoliciesResponse)
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 -> [Text] -> ListGroupPoliciesResponse)
-> Either String Int
-> Either String ([Text] -> ListGroupPoliciesResponse)
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 ([Text] -> ListGroupPoliciesResponse)
-> Either String [Text] -> Either String ListGroupPoliciesResponse
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
"PolicyNames" 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 [Text]) -> Either String [Text]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable ListGroupPolicies

instance Prelude.NFData ListGroupPolicies

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

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

instance Core.ToQuery ListGroupPolicies where
  toQuery :: ListGroupPolicies -> QueryString
toQuery ListGroupPolicies' {Maybe Natural
Maybe Text
Text
groupName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:groupName:ListGroupPolicies' :: ListGroupPolicies -> Text
$sel:maxItems:ListGroupPolicies' :: ListGroupPolicies -> Maybe Natural
$sel:marker:ListGroupPolicies' :: ListGroupPolicies -> 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
"ListGroupPolicies" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        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,
        ByteString
"GroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
groupName
      ]

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

-- |
-- Create a value of 'ListGroupPoliciesResponse' 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', 'listGroupPoliciesResponse_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', 'listGroupPoliciesResponse_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', 'listGroupPoliciesResponse_httpStatus' - The response's http status code.
--
-- 'policyNames', 'listGroupPoliciesResponse_policyNames' - A list of policy names.
--
-- 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: _+=,.\@-
newListGroupPoliciesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListGroupPoliciesResponse
newListGroupPoliciesResponse :: Int -> ListGroupPoliciesResponse
newListGroupPoliciesResponse Int
pHttpStatus_ =
  ListGroupPoliciesResponse' :: Maybe Text
-> Maybe Bool -> Int -> [Text] -> ListGroupPoliciesResponse
ListGroupPoliciesResponse'
    { $sel:marker:ListGroupPoliciesResponse' :: Maybe Text
marker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isTruncated:ListGroupPoliciesResponse' :: Maybe Bool
isTruncated = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListGroupPoliciesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:policyNames:ListGroupPoliciesResponse' :: [Text]
policyNames = [Text]
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.
listGroupPoliciesResponse_marker :: Lens.Lens' ListGroupPoliciesResponse (Prelude.Maybe Prelude.Text)
listGroupPoliciesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListGroupPoliciesResponse -> f ListGroupPoliciesResponse
listGroupPoliciesResponse_marker = (ListGroupPoliciesResponse -> Maybe Text)
-> (ListGroupPoliciesResponse
    -> Maybe Text -> ListGroupPoliciesResponse)
-> Lens' ListGroupPoliciesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupPoliciesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListGroupPoliciesResponse' :: ListGroupPoliciesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListGroupPoliciesResponse
s@ListGroupPoliciesResponse' {} Maybe Text
a -> ListGroupPoliciesResponse
s {$sel:marker:ListGroupPoliciesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListGroupPoliciesResponse)

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

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

-- | A list of policy names.
--
-- 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: _+=,.\@-
listGroupPoliciesResponse_policyNames :: Lens.Lens' ListGroupPoliciesResponse [Prelude.Text]
listGroupPoliciesResponse_policyNames :: ([Text] -> f [Text])
-> ListGroupPoliciesResponse -> f ListGroupPoliciesResponse
listGroupPoliciesResponse_policyNames = (ListGroupPoliciesResponse -> [Text])
-> (ListGroupPoliciesResponse
    -> [Text] -> ListGroupPoliciesResponse)
-> Lens
     ListGroupPoliciesResponse ListGroupPoliciesResponse [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupPoliciesResponse' {[Text]
policyNames :: [Text]
$sel:policyNames:ListGroupPoliciesResponse' :: ListGroupPoliciesResponse -> [Text]
policyNames} -> [Text]
policyNames) (\s :: ListGroupPoliciesResponse
s@ListGroupPoliciesResponse' {} [Text]
a -> ListGroupPoliciesResponse
s {$sel:policyNames:ListGroupPoliciesResponse' :: [Text]
policyNames = [Text]
a} :: ListGroupPoliciesResponse) (([Text] -> f [Text])
 -> ListGroupPoliciesResponse -> f ListGroupPoliciesResponse)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ListGroupPoliciesResponse
-> f ListGroupPoliciesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListGroupPoliciesResponse