{-# 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.ListGroupsForUser
-- 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 groups that the specified IAM user belongs to.
--
-- You can paginate the results using the @MaxItems@ and @Marker@
-- parameters.
--
-- This operation returns paginated results.
module Amazonka.IAM.ListGroupsForUser
  ( -- * Creating a Request
    ListGroupsForUser (..),
    newListGroupsForUser,

    -- * Request Lenses
    listGroupsForUser_marker,
    listGroupsForUser_maxItems,
    listGroupsForUser_userName,

    -- * Destructuring the Response
    ListGroupsForUserResponse (..),
    newListGroupsForUserResponse,

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

-- |
-- Create a value of 'ListGroupsForUser' 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', 'listGroupsForUser_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', 'listGroupsForUser_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', 'listGroupsForUser_userName' - The name of the user to list groups 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: _+=,.\@-
newListGroupsForUser ::
  -- | 'userName'
  Prelude.Text ->
  ListGroupsForUser
newListGroupsForUser :: Text -> ListGroupsForUser
newListGroupsForUser Text
pUserName_ =
  ListGroupsForUser'
    { $sel:marker:ListGroupsForUser' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListGroupsForUser' :: Maybe Natural
maxItems = forall a. Maybe a
Prelude.Nothing,
      $sel:userName:ListGroupsForUser' :: 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.
listGroupsForUser_marker :: Lens.Lens' ListGroupsForUser (Prelude.Maybe Prelude.Text)
listGroupsForUser_marker :: Lens' ListGroupsForUser (Maybe Text)
listGroupsForUser_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupsForUser' {Maybe Text
marker :: Maybe Text
$sel:marker:ListGroupsForUser' :: ListGroupsForUser -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListGroupsForUser
s@ListGroupsForUser' {} Maybe Text
a -> ListGroupsForUser
s {$sel:marker:ListGroupsForUser' :: Maybe Text
marker = Maybe Text
a} :: ListGroupsForUser)

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

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

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

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

instance Data.ToQuery ListGroupsForUser where
  toQuery :: ListGroupsForUser -> QueryString
toQuery ListGroupsForUser' {Maybe Natural
Maybe Text
Text
userName :: Text
maxItems :: Maybe Natural
marker :: Maybe Text
$sel:userName:ListGroupsForUser' :: ListGroupsForUser -> Text
$sel:maxItems:ListGroupsForUser' :: ListGroupsForUser -> Maybe Natural
$sel:marker:ListGroupsForUser' :: ListGroupsForUser -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListGroupsForUser" :: 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 ListGroupsForUser request.
--
-- /See:/ 'newListGroupsForUserResponse' smart constructor.
data ListGroupsForUserResponse = ListGroupsForUserResponse'
  { -- | 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.
    ListGroupsForUserResponse -> 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.
    ListGroupsForUserResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListGroupsForUserResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of groups.
    ListGroupsForUserResponse -> [Group]
groups :: [Group]
  }
  deriving (ListGroupsForUserResponse -> ListGroupsForUserResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroupsForUserResponse -> ListGroupsForUserResponse -> Bool
$c/= :: ListGroupsForUserResponse -> ListGroupsForUserResponse -> Bool
== :: ListGroupsForUserResponse -> ListGroupsForUserResponse -> Bool
$c== :: ListGroupsForUserResponse -> ListGroupsForUserResponse -> Bool
Prelude.Eq, ReadPrec [ListGroupsForUserResponse]
ReadPrec ListGroupsForUserResponse
Int -> ReadS ListGroupsForUserResponse
ReadS [ListGroupsForUserResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroupsForUserResponse]
$creadListPrec :: ReadPrec [ListGroupsForUserResponse]
readPrec :: ReadPrec ListGroupsForUserResponse
$creadPrec :: ReadPrec ListGroupsForUserResponse
readList :: ReadS [ListGroupsForUserResponse]
$creadList :: ReadS [ListGroupsForUserResponse]
readsPrec :: Int -> ReadS ListGroupsForUserResponse
$creadsPrec :: Int -> ReadS ListGroupsForUserResponse
Prelude.Read, Int -> ListGroupsForUserResponse -> ShowS
[ListGroupsForUserResponse] -> ShowS
ListGroupsForUserResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroupsForUserResponse] -> ShowS
$cshowList :: [ListGroupsForUserResponse] -> ShowS
show :: ListGroupsForUserResponse -> String
$cshow :: ListGroupsForUserResponse -> String
showsPrec :: Int -> ListGroupsForUserResponse -> ShowS
$cshowsPrec :: Int -> ListGroupsForUserResponse -> ShowS
Prelude.Show, forall x.
Rep ListGroupsForUserResponse x -> ListGroupsForUserResponse
forall x.
ListGroupsForUserResponse -> Rep ListGroupsForUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGroupsForUserResponse x -> ListGroupsForUserResponse
$cfrom :: forall x.
ListGroupsForUserResponse -> Rep ListGroupsForUserResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListGroupsForUserResponse' 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', 'listGroupsForUserResponse_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', 'listGroupsForUserResponse_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', 'listGroupsForUserResponse_httpStatus' - The response's http status code.
--
-- 'groups', 'listGroupsForUserResponse_groups' - A list of groups.
newListGroupsForUserResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListGroupsForUserResponse
newListGroupsForUserResponse :: Int -> ListGroupsForUserResponse
newListGroupsForUserResponse Int
pHttpStatus_ =
  ListGroupsForUserResponse'
    { $sel:isTruncated:ListGroupsForUserResponse' :: Maybe Bool
isTruncated =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:ListGroupsForUserResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListGroupsForUserResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:groups:ListGroupsForUserResponse' :: [Group]
groups = 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.
listGroupsForUserResponse_isTruncated :: Lens.Lens' ListGroupsForUserResponse (Prelude.Maybe Prelude.Bool)
listGroupsForUserResponse_isTruncated :: Lens' ListGroupsForUserResponse (Maybe Bool)
listGroupsForUserResponse_isTruncated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupsForUserResponse' {Maybe Bool
isTruncated :: Maybe Bool
$sel:isTruncated:ListGroupsForUserResponse' :: ListGroupsForUserResponse -> Maybe Bool
isTruncated} -> Maybe Bool
isTruncated) (\s :: ListGroupsForUserResponse
s@ListGroupsForUserResponse' {} Maybe Bool
a -> ListGroupsForUserResponse
s {$sel:isTruncated:ListGroupsForUserResponse' :: Maybe Bool
isTruncated = Maybe Bool
a} :: ListGroupsForUserResponse)

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

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

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