{-# 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.QuickSight.ListUserGroups
-- 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 Amazon QuickSight groups that an Amazon QuickSight user is a
-- member of.
module Amazonka.QuickSight.ListUserGroups
  ( -- * Creating a Request
    ListUserGroups (..),
    newListUserGroups,

    -- * Request Lenses
    listUserGroups_nextToken,
    listUserGroups_maxResults,
    listUserGroups_userName,
    listUserGroups_awsAccountId,
    listUserGroups_namespace,

    -- * Destructuring the Response
    ListUserGroupsResponse (..),
    newListUserGroupsResponse,

    -- * Response Lenses
    listUserGroupsResponse_requestId,
    listUserGroupsResponse_groupList,
    listUserGroupsResponse_nextToken,
    listUserGroupsResponse_status,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListUserGroups' smart constructor.
data ListUserGroups = ListUserGroups'
  { -- | A pagination token that can be used in a subsequent request.
    ListUserGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return from this request.
    ListUserGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon QuickSight user name that you want to list group memberships
    -- for.
    ListUserGroups -> Text
userName :: Prelude.Text,
    -- | The Amazon Web Services account ID that the user is in. Currently, you
    -- use the ID for the Amazon Web Services account that contains your Amazon
    -- QuickSight account.
    ListUserGroups -> Text
awsAccountId :: Prelude.Text,
    -- | The namespace. Currently, you should set this to @default@.
    ListUserGroups -> Text
namespace :: Prelude.Text
  }
  deriving (ListUserGroups -> ListUserGroups -> Bool
(ListUserGroups -> ListUserGroups -> Bool)
-> (ListUserGroups -> ListUserGroups -> Bool) -> Eq ListUserGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserGroups -> ListUserGroups -> Bool
$c/= :: ListUserGroups -> ListUserGroups -> Bool
== :: ListUserGroups -> ListUserGroups -> Bool
$c== :: ListUserGroups -> ListUserGroups -> Bool
Prelude.Eq, ReadPrec [ListUserGroups]
ReadPrec ListUserGroups
Int -> ReadS ListUserGroups
ReadS [ListUserGroups]
(Int -> ReadS ListUserGroups)
-> ReadS [ListUserGroups]
-> ReadPrec ListUserGroups
-> ReadPrec [ListUserGroups]
-> Read ListUserGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserGroups]
$creadListPrec :: ReadPrec [ListUserGroups]
readPrec :: ReadPrec ListUserGroups
$creadPrec :: ReadPrec ListUserGroups
readList :: ReadS [ListUserGroups]
$creadList :: ReadS [ListUserGroups]
readsPrec :: Int -> ReadS ListUserGroups
$creadsPrec :: Int -> ReadS ListUserGroups
Prelude.Read, Int -> ListUserGroups -> ShowS
[ListUserGroups] -> ShowS
ListUserGroups -> String
(Int -> ListUserGroups -> ShowS)
-> (ListUserGroups -> String)
-> ([ListUserGroups] -> ShowS)
-> Show ListUserGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserGroups] -> ShowS
$cshowList :: [ListUserGroups] -> ShowS
show :: ListUserGroups -> String
$cshow :: ListUserGroups -> String
showsPrec :: Int -> ListUserGroups -> ShowS
$cshowsPrec :: Int -> ListUserGroups -> ShowS
Prelude.Show, (forall x. ListUserGroups -> Rep ListUserGroups x)
-> (forall x. Rep ListUserGroups x -> ListUserGroups)
-> Generic ListUserGroups
forall x. Rep ListUserGroups x -> ListUserGroups
forall x. ListUserGroups -> Rep ListUserGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUserGroups x -> ListUserGroups
$cfrom :: forall x. ListUserGroups -> Rep ListUserGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListUserGroups' 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:
--
-- 'nextToken', 'listUserGroups_nextToken' - A pagination token that can be used in a subsequent request.
--
-- 'maxResults', 'listUserGroups_maxResults' - The maximum number of results to return from this request.
--
-- 'userName', 'listUserGroups_userName' - The Amazon QuickSight user name that you want to list group memberships
-- for.
--
-- 'awsAccountId', 'listUserGroups_awsAccountId' - The Amazon Web Services account ID that the user is in. Currently, you
-- use the ID for the Amazon Web Services account that contains your Amazon
-- QuickSight account.
--
-- 'namespace', 'listUserGroups_namespace' - The namespace. Currently, you should set this to @default@.
newListUserGroups ::
  -- | 'userName'
  Prelude.Text ->
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'namespace'
  Prelude.Text ->
  ListUserGroups
newListUserGroups :: Text -> Text -> Text -> ListUserGroups
newListUserGroups
  Text
pUserName_
  Text
pAwsAccountId_
  Text
pNamespace_ =
    ListUserGroups' :: Maybe Text
-> Maybe Natural -> Text -> Text -> Text -> ListUserGroups
ListUserGroups'
      { $sel:nextToken:ListUserGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListUserGroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:userName:ListUserGroups' :: Text
userName = Text
pUserName_,
        $sel:awsAccountId:ListUserGroups' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:namespace:ListUserGroups' :: Text
namespace = Text
pNamespace_
      }

-- | A pagination token that can be used in a subsequent request.
listUserGroups_nextToken :: Lens.Lens' ListUserGroups (Prelude.Maybe Prelude.Text)
listUserGroups_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUserGroups -> f ListUserGroups
listUserGroups_nextToken = (ListUserGroups -> Maybe Text)
-> (ListUserGroups -> Maybe Text -> ListUserGroups)
-> Lens ListUserGroups ListUserGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUserGroups' :: ListUserGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUserGroups
s@ListUserGroups' {} Maybe Text
a -> ListUserGroups
s {$sel:nextToken:ListUserGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListUserGroups)

-- | The maximum number of results to return from this request.
listUserGroups_maxResults :: Lens.Lens' ListUserGroups (Prelude.Maybe Prelude.Natural)
listUserGroups_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListUserGroups -> f ListUserGroups
listUserGroups_maxResults = (ListUserGroups -> Maybe Natural)
-> (ListUserGroups -> Maybe Natural -> ListUserGroups)
-> Lens
     ListUserGroups ListUserGroups (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListUserGroups' :: ListUserGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListUserGroups
s@ListUserGroups' {} Maybe Natural
a -> ListUserGroups
s {$sel:maxResults:ListUserGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListUserGroups)

-- | The Amazon QuickSight user name that you want to list group memberships
-- for.
listUserGroups_userName :: Lens.Lens' ListUserGroups Prelude.Text
listUserGroups_userName :: (Text -> f Text) -> ListUserGroups -> f ListUserGroups
listUserGroups_userName = (ListUserGroups -> Text)
-> (ListUserGroups -> Text -> ListUserGroups)
-> Lens ListUserGroups ListUserGroups Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserGroups' {Text
userName :: Text
$sel:userName:ListUserGroups' :: ListUserGroups -> Text
userName} -> Text
userName) (\s :: ListUserGroups
s@ListUserGroups' {} Text
a -> ListUserGroups
s {$sel:userName:ListUserGroups' :: Text
userName = Text
a} :: ListUserGroups)

-- | The Amazon Web Services account ID that the user is in. Currently, you
-- use the ID for the Amazon Web Services account that contains your Amazon
-- QuickSight account.
listUserGroups_awsAccountId :: Lens.Lens' ListUserGroups Prelude.Text
listUserGroups_awsAccountId :: (Text -> f Text) -> ListUserGroups -> f ListUserGroups
listUserGroups_awsAccountId = (ListUserGroups -> Text)
-> (ListUserGroups -> Text -> ListUserGroups)
-> Lens ListUserGroups ListUserGroups Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserGroups' {Text
awsAccountId :: Text
$sel:awsAccountId:ListUserGroups' :: ListUserGroups -> Text
awsAccountId} -> Text
awsAccountId) (\s :: ListUserGroups
s@ListUserGroups' {} Text
a -> ListUserGroups
s {$sel:awsAccountId:ListUserGroups' :: Text
awsAccountId = Text
a} :: ListUserGroups)

-- | The namespace. Currently, you should set this to @default@.
listUserGroups_namespace :: Lens.Lens' ListUserGroups Prelude.Text
listUserGroups_namespace :: (Text -> f Text) -> ListUserGroups -> f ListUserGroups
listUserGroups_namespace = (ListUserGroups -> Text)
-> (ListUserGroups -> Text -> ListUserGroups)
-> Lens ListUserGroups ListUserGroups Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserGroups' {Text
namespace :: Text
$sel:namespace:ListUserGroups' :: ListUserGroups -> Text
namespace} -> Text
namespace) (\s :: ListUserGroups
s@ListUserGroups' {} Text
a -> ListUserGroups
s {$sel:namespace:ListUserGroups' :: Text
namespace = Text
a} :: ListUserGroups)

instance Core.AWSRequest ListUserGroups where
  type
    AWSResponse ListUserGroups =
      ListUserGroupsResponse
  request :: ListUserGroups -> Request ListUserGroups
request = Service -> ListUserGroups -> Request ListUserGroups
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListUserGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUserGroups)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListUserGroups))
-> Logger
-> Service
-> Proxy ListUserGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUserGroups)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [Group] -> Maybe Text -> Int -> ListUserGroupsResponse
ListUserGroupsResponse'
            (Maybe Text
 -> Maybe [Group] -> Maybe Text -> Int -> ListUserGroupsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Group] -> Maybe Text -> Int -> ListUserGroupsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RequestId")
            Either
  String
  (Maybe [Group] -> Maybe Text -> Int -> ListUserGroupsResponse)
-> Either String (Maybe [Group])
-> Either String (Maybe Text -> Int -> ListUserGroupsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Group]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GroupList" Either String (Maybe (Maybe [Group]))
-> Maybe [Group] -> Either String (Maybe [Group])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Group]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListUserGroupsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListUserGroupsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> ListUserGroupsResponse)
-> Either String Int -> Either String ListUserGroupsResponse
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))
      )

instance Prelude.Hashable ListUserGroups

instance Prelude.NFData ListUserGroups

instance Core.ToHeaders ListUserGroups where
  toHeaders :: ListUserGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListUserGroups -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListUserGroups where
  toPath :: ListUserGroups -> ByteString
toPath ListUserGroups' {Maybe Natural
Maybe Text
Text
namespace :: Text
awsAccountId :: Text
userName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:namespace:ListUserGroups' :: ListUserGroups -> Text
$sel:awsAccountId:ListUserGroups' :: ListUserGroups -> Text
$sel:userName:ListUserGroups' :: ListUserGroups -> Text
$sel:maxResults:ListUserGroups' :: ListUserGroups -> Maybe Natural
$sel:nextToken:ListUserGroups' :: ListUserGroups -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/namespaces/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
namespace,
        ByteString
"/users/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
userName,
        ByteString
"/groups"
      ]

instance Core.ToQuery ListUserGroups where
  toQuery :: ListUserGroups -> QueryString
toQuery ListUserGroups' {Maybe Natural
Maybe Text
Text
namespace :: Text
awsAccountId :: Text
userName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:namespace:ListUserGroups' :: ListUserGroups -> Text
$sel:awsAccountId:ListUserGroups' :: ListUserGroups -> Text
$sel:userName:ListUserGroups' :: ListUserGroups -> Text
$sel:maxResults:ListUserGroups' :: ListUserGroups -> Maybe Natural
$sel:nextToken:ListUserGroups' :: ListUserGroups -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"next-token" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListUserGroupsResponse' smart constructor.
data ListUserGroupsResponse = ListUserGroupsResponse'
  { -- | The Amazon Web Services request ID for this operation.
    ListUserGroupsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The list of groups the user is a member of.
    ListUserGroupsResponse -> Maybe [Group]
groupList :: Prelude.Maybe [Group],
    -- | A pagination token that can be used in a subsequent request.
    ListUserGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    ListUserGroupsResponse -> Int
status :: Prelude.Int
  }
  deriving (ListUserGroupsResponse -> ListUserGroupsResponse -> Bool
(ListUserGroupsResponse -> ListUserGroupsResponse -> Bool)
-> (ListUserGroupsResponse -> ListUserGroupsResponse -> Bool)
-> Eq ListUserGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserGroupsResponse -> ListUserGroupsResponse -> Bool
$c/= :: ListUserGroupsResponse -> ListUserGroupsResponse -> Bool
== :: ListUserGroupsResponse -> ListUserGroupsResponse -> Bool
$c== :: ListUserGroupsResponse -> ListUserGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListUserGroupsResponse]
ReadPrec ListUserGroupsResponse
Int -> ReadS ListUserGroupsResponse
ReadS [ListUserGroupsResponse]
(Int -> ReadS ListUserGroupsResponse)
-> ReadS [ListUserGroupsResponse]
-> ReadPrec ListUserGroupsResponse
-> ReadPrec [ListUserGroupsResponse]
-> Read ListUserGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserGroupsResponse]
$creadListPrec :: ReadPrec [ListUserGroupsResponse]
readPrec :: ReadPrec ListUserGroupsResponse
$creadPrec :: ReadPrec ListUserGroupsResponse
readList :: ReadS [ListUserGroupsResponse]
$creadList :: ReadS [ListUserGroupsResponse]
readsPrec :: Int -> ReadS ListUserGroupsResponse
$creadsPrec :: Int -> ReadS ListUserGroupsResponse
Prelude.Read, Int -> ListUserGroupsResponse -> ShowS
[ListUserGroupsResponse] -> ShowS
ListUserGroupsResponse -> String
(Int -> ListUserGroupsResponse -> ShowS)
-> (ListUserGroupsResponse -> String)
-> ([ListUserGroupsResponse] -> ShowS)
-> Show ListUserGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserGroupsResponse] -> ShowS
$cshowList :: [ListUserGroupsResponse] -> ShowS
show :: ListUserGroupsResponse -> String
$cshow :: ListUserGroupsResponse -> String
showsPrec :: Int -> ListUserGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListUserGroupsResponse -> ShowS
Prelude.Show, (forall x. ListUserGroupsResponse -> Rep ListUserGroupsResponse x)
-> (forall x.
    Rep ListUserGroupsResponse x -> ListUserGroupsResponse)
-> Generic ListUserGroupsResponse
forall x. Rep ListUserGroupsResponse x -> ListUserGroupsResponse
forall x. ListUserGroupsResponse -> Rep ListUserGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUserGroupsResponse x -> ListUserGroupsResponse
$cfrom :: forall x. ListUserGroupsResponse -> Rep ListUserGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListUserGroupsResponse' 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:
--
-- 'requestId', 'listUserGroupsResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'groupList', 'listUserGroupsResponse_groupList' - The list of groups the user is a member of.
--
-- 'nextToken', 'listUserGroupsResponse_nextToken' - A pagination token that can be used in a subsequent request.
--
-- 'status', 'listUserGroupsResponse_status' - The HTTP status of the request.
newListUserGroupsResponse ::
  -- | 'status'
  Prelude.Int ->
  ListUserGroupsResponse
newListUserGroupsResponse :: Int -> ListUserGroupsResponse
newListUserGroupsResponse Int
pStatus_ =
  ListUserGroupsResponse' :: Maybe Text
-> Maybe [Group] -> Maybe Text -> Int -> ListUserGroupsResponse
ListUserGroupsResponse'
    { $sel:requestId:ListUserGroupsResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupList:ListUserGroupsResponse' :: Maybe [Group]
groupList = Maybe [Group]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListUserGroupsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListUserGroupsResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
listUserGroupsResponse_requestId :: Lens.Lens' ListUserGroupsResponse (Prelude.Maybe Prelude.Text)
listUserGroupsResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> ListUserGroupsResponse -> f ListUserGroupsResponse
listUserGroupsResponse_requestId = (ListUserGroupsResponse -> Maybe Text)
-> (ListUserGroupsResponse -> Maybe Text -> ListUserGroupsResponse)
-> Lens
     ListUserGroupsResponse
     ListUserGroupsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserGroupsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListUserGroupsResponse' :: ListUserGroupsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListUserGroupsResponse
s@ListUserGroupsResponse' {} Maybe Text
a -> ListUserGroupsResponse
s {$sel:requestId:ListUserGroupsResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListUserGroupsResponse)

-- | The list of groups the user is a member of.
listUserGroupsResponse_groupList :: Lens.Lens' ListUserGroupsResponse (Prelude.Maybe [Group])
listUserGroupsResponse_groupList :: (Maybe [Group] -> f (Maybe [Group]))
-> ListUserGroupsResponse -> f ListUserGroupsResponse
listUserGroupsResponse_groupList = (ListUserGroupsResponse -> Maybe [Group])
-> (ListUserGroupsResponse
    -> Maybe [Group] -> ListUserGroupsResponse)
-> Lens
     ListUserGroupsResponse
     ListUserGroupsResponse
     (Maybe [Group])
     (Maybe [Group])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserGroupsResponse' {Maybe [Group]
groupList :: Maybe [Group]
$sel:groupList:ListUserGroupsResponse' :: ListUserGroupsResponse -> Maybe [Group]
groupList} -> Maybe [Group]
groupList) (\s :: ListUserGroupsResponse
s@ListUserGroupsResponse' {} Maybe [Group]
a -> ListUserGroupsResponse
s {$sel:groupList:ListUserGroupsResponse' :: Maybe [Group]
groupList = Maybe [Group]
a} :: ListUserGroupsResponse) ((Maybe [Group] -> f (Maybe [Group]))
 -> ListUserGroupsResponse -> f ListUserGroupsResponse)
-> ((Maybe [Group] -> f (Maybe [Group]))
    -> Maybe [Group] -> f (Maybe [Group]))
-> (Maybe [Group] -> f (Maybe [Group]))
-> ListUserGroupsResponse
-> f ListUserGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Group] [Group] [Group] [Group]
-> Iso
     (Maybe [Group]) (Maybe [Group]) (Maybe [Group]) (Maybe [Group])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Group] [Group] [Group] [Group]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A pagination token that can be used in a subsequent request.
listUserGroupsResponse_nextToken :: Lens.Lens' ListUserGroupsResponse (Prelude.Maybe Prelude.Text)
listUserGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUserGroupsResponse -> f ListUserGroupsResponse
listUserGroupsResponse_nextToken = (ListUserGroupsResponse -> Maybe Text)
-> (ListUserGroupsResponse -> Maybe Text -> ListUserGroupsResponse)
-> Lens
     ListUserGroupsResponse
     ListUserGroupsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUserGroupsResponse' :: ListUserGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUserGroupsResponse
s@ListUserGroupsResponse' {} Maybe Text
a -> ListUserGroupsResponse
s {$sel:nextToken:ListUserGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUserGroupsResponse)

-- | The HTTP status of the request.
listUserGroupsResponse_status :: Lens.Lens' ListUserGroupsResponse Prelude.Int
listUserGroupsResponse_status :: (Int -> f Int)
-> ListUserGroupsResponse -> f ListUserGroupsResponse
listUserGroupsResponse_status = (ListUserGroupsResponse -> Int)
-> (ListUserGroupsResponse -> Int -> ListUserGroupsResponse)
-> Lens ListUserGroupsResponse ListUserGroupsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserGroupsResponse' {Int
status :: Int
$sel:status:ListUserGroupsResponse' :: ListUserGroupsResponse -> Int
status} -> Int
status) (\s :: ListUserGroupsResponse
s@ListUserGroupsResponse' {} Int
a -> ListUserGroupsResponse
s {$sel:status:ListUserGroupsResponse' :: Int
status = Int
a} :: ListUserGroupsResponse)

instance Prelude.NFData ListUserGroupsResponse