{-# 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.ListGroupMemberships
-- 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 member users in a group.
module Amazonka.QuickSight.ListGroupMemberships
  ( -- * Creating a Request
    ListGroupMemberships (..),
    newListGroupMemberships,

    -- * Request Lenses
    listGroupMemberships_nextToken,
    listGroupMemberships_maxResults,
    listGroupMemberships_groupName,
    listGroupMemberships_awsAccountId,
    listGroupMemberships_namespace,

    -- * Destructuring the Response
    ListGroupMembershipsResponse (..),
    newListGroupMembershipsResponse,

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

-- |
-- Create a value of 'ListGroupMemberships' 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', 'listGroupMemberships_nextToken' - A pagination token that can be used in a subsequent request.
--
-- 'maxResults', 'listGroupMemberships_maxResults' - The maximum number of results to return from this request.
--
-- 'groupName', 'listGroupMemberships_groupName' - The name of the group that you want to see a membership list of.
--
-- 'awsAccountId', 'listGroupMemberships_awsAccountId' - The ID for the Amazon Web Services account that the group is in.
-- Currently, you use the ID for the Amazon Web Services account that
-- contains your Amazon QuickSight account.
--
-- 'namespace', 'listGroupMemberships_namespace' - The namespace. Currently, you should set this to @default@.
newListGroupMemberships ::
  -- | 'groupName'
  Prelude.Text ->
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'namespace'
  Prelude.Text ->
  ListGroupMemberships
newListGroupMemberships :: Text -> Text -> Text -> ListGroupMemberships
newListGroupMemberships
  Text
pGroupName_
  Text
pAwsAccountId_
  Text
pNamespace_ =
    ListGroupMemberships' :: Maybe Text
-> Maybe Natural -> Text -> Text -> Text -> ListGroupMemberships
ListGroupMemberships'
      { $sel:nextToken:ListGroupMemberships' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListGroupMemberships' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:groupName:ListGroupMemberships' :: Text
groupName = Text
pGroupName_,
        $sel:awsAccountId:ListGroupMemberships' :: Text
awsAccountId = Text
pAwsAccountId_,
        $sel:namespace:ListGroupMemberships' :: Text
namespace = Text
pNamespace_
      }

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

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

-- | The name of the group that you want to see a membership list of.
listGroupMemberships_groupName :: Lens.Lens' ListGroupMemberships Prelude.Text
listGroupMemberships_groupName :: (Text -> f Text) -> ListGroupMemberships -> f ListGroupMemberships
listGroupMemberships_groupName = (ListGroupMemberships -> Text)
-> (ListGroupMemberships -> Text -> ListGroupMemberships)
-> Lens ListGroupMemberships ListGroupMemberships Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupMemberships' {Text
groupName :: Text
$sel:groupName:ListGroupMemberships' :: ListGroupMemberships -> Text
groupName} -> Text
groupName) (\s :: ListGroupMemberships
s@ListGroupMemberships' {} Text
a -> ListGroupMemberships
s {$sel:groupName:ListGroupMemberships' :: Text
groupName = Text
a} :: ListGroupMemberships)

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

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

instance Core.AWSRequest ListGroupMemberships where
  type
    AWSResponse ListGroupMemberships =
      ListGroupMembershipsResponse
  request :: ListGroupMemberships -> Request ListGroupMemberships
request = Service -> ListGroupMemberships -> Request ListGroupMemberships
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListGroupMemberships
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListGroupMemberships)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListGroupMemberships))
-> Logger
-> Service
-> Proxy ListGroupMemberships
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListGroupMemberships)))
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 Text
-> Maybe [GroupMember]
-> Int
-> ListGroupMembershipsResponse
ListGroupMembershipsResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [GroupMember]
 -> Int
 -> ListGroupMembershipsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [GroupMember] -> Int -> ListGroupMembershipsResponse)
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 Text
   -> Maybe [GroupMember] -> Int -> ListGroupMembershipsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [GroupMember] -> Int -> ListGroupMembershipsResponse)
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 (Maybe [GroupMember] -> Int -> ListGroupMembershipsResponse)
-> Either String (Maybe [GroupMember])
-> Either String (Int -> ListGroupMembershipsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [GroupMember]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GroupMemberList"
                            Either String (Maybe (Maybe [GroupMember]))
-> Maybe [GroupMember] -> Either String (Maybe [GroupMember])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [GroupMember]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListGroupMembershipsResponse)
-> Either String Int -> Either String ListGroupMembershipsResponse
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 ListGroupMemberships

instance Prelude.NFData ListGroupMemberships

instance Core.ToHeaders ListGroupMemberships where
  toHeaders :: ListGroupMemberships -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListGroupMemberships -> 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 ListGroupMemberships where
  toPath :: ListGroupMemberships -> ByteString
toPath ListGroupMemberships' {Maybe Natural
Maybe Text
Text
namespace :: Text
awsAccountId :: Text
groupName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:namespace:ListGroupMemberships' :: ListGroupMemberships -> Text
$sel:awsAccountId:ListGroupMemberships' :: ListGroupMemberships -> Text
$sel:groupName:ListGroupMemberships' :: ListGroupMemberships -> Text
$sel:maxResults:ListGroupMemberships' :: ListGroupMemberships -> Maybe Natural
$sel:nextToken:ListGroupMemberships' :: ListGroupMemberships -> 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
"/groups/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
groupName,
        ByteString
"/members"
      ]

instance Core.ToQuery ListGroupMemberships where
  toQuery :: ListGroupMemberships -> QueryString
toQuery ListGroupMemberships' {Maybe Natural
Maybe Text
Text
namespace :: Text
awsAccountId :: Text
groupName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:namespace:ListGroupMemberships' :: ListGroupMemberships -> Text
$sel:awsAccountId:ListGroupMemberships' :: ListGroupMemberships -> Text
$sel:groupName:ListGroupMemberships' :: ListGroupMemberships -> Text
$sel:maxResults:ListGroupMemberships' :: ListGroupMemberships -> Maybe Natural
$sel:nextToken:ListGroupMemberships' :: ListGroupMemberships -> 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:/ 'newListGroupMembershipsResponse' smart constructor.
data ListGroupMembershipsResponse = ListGroupMembershipsResponse'
  { -- | The Amazon Web Services request ID for this operation.
    ListGroupMembershipsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | A pagination token that can be used in a subsequent request.
    ListGroupMembershipsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of the members of the group.
    ListGroupMembershipsResponse -> Maybe [GroupMember]
groupMemberList :: Prelude.Maybe [GroupMember],
    -- | The HTTP status of the request.
    ListGroupMembershipsResponse -> Int
status :: Prelude.Int
  }
  deriving (ListGroupMembershipsResponse
-> ListGroupMembershipsResponse -> Bool
(ListGroupMembershipsResponse
 -> ListGroupMembershipsResponse -> Bool)
-> (ListGroupMembershipsResponse
    -> ListGroupMembershipsResponse -> Bool)
-> Eq ListGroupMembershipsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroupMembershipsResponse
-> ListGroupMembershipsResponse -> Bool
$c/= :: ListGroupMembershipsResponse
-> ListGroupMembershipsResponse -> Bool
== :: ListGroupMembershipsResponse
-> ListGroupMembershipsResponse -> Bool
$c== :: ListGroupMembershipsResponse
-> ListGroupMembershipsResponse -> Bool
Prelude.Eq, ReadPrec [ListGroupMembershipsResponse]
ReadPrec ListGroupMembershipsResponse
Int -> ReadS ListGroupMembershipsResponse
ReadS [ListGroupMembershipsResponse]
(Int -> ReadS ListGroupMembershipsResponse)
-> ReadS [ListGroupMembershipsResponse]
-> ReadPrec ListGroupMembershipsResponse
-> ReadPrec [ListGroupMembershipsResponse]
-> Read ListGroupMembershipsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroupMembershipsResponse]
$creadListPrec :: ReadPrec [ListGroupMembershipsResponse]
readPrec :: ReadPrec ListGroupMembershipsResponse
$creadPrec :: ReadPrec ListGroupMembershipsResponse
readList :: ReadS [ListGroupMembershipsResponse]
$creadList :: ReadS [ListGroupMembershipsResponse]
readsPrec :: Int -> ReadS ListGroupMembershipsResponse
$creadsPrec :: Int -> ReadS ListGroupMembershipsResponse
Prelude.Read, Int -> ListGroupMembershipsResponse -> ShowS
[ListGroupMembershipsResponse] -> ShowS
ListGroupMembershipsResponse -> String
(Int -> ListGroupMembershipsResponse -> ShowS)
-> (ListGroupMembershipsResponse -> String)
-> ([ListGroupMembershipsResponse] -> ShowS)
-> Show ListGroupMembershipsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroupMembershipsResponse] -> ShowS
$cshowList :: [ListGroupMembershipsResponse] -> ShowS
show :: ListGroupMembershipsResponse -> String
$cshow :: ListGroupMembershipsResponse -> String
showsPrec :: Int -> ListGroupMembershipsResponse -> ShowS
$cshowsPrec :: Int -> ListGroupMembershipsResponse -> ShowS
Prelude.Show, (forall x.
 ListGroupMembershipsResponse -> Rep ListGroupMembershipsResponse x)
-> (forall x.
    Rep ListGroupMembershipsResponse x -> ListGroupMembershipsResponse)
-> Generic ListGroupMembershipsResponse
forall x.
Rep ListGroupMembershipsResponse x -> ListGroupMembershipsResponse
forall x.
ListGroupMembershipsResponse -> Rep ListGroupMembershipsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGroupMembershipsResponse x -> ListGroupMembershipsResponse
$cfrom :: forall x.
ListGroupMembershipsResponse -> Rep ListGroupMembershipsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListGroupMembershipsResponse' 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', 'listGroupMembershipsResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'nextToken', 'listGroupMembershipsResponse_nextToken' - A pagination token that can be used in a subsequent request.
--
-- 'groupMemberList', 'listGroupMembershipsResponse_groupMemberList' - The list of the members of the group.
--
-- 'status', 'listGroupMembershipsResponse_status' - The HTTP status of the request.
newListGroupMembershipsResponse ::
  -- | 'status'
  Prelude.Int ->
  ListGroupMembershipsResponse
newListGroupMembershipsResponse :: Int -> ListGroupMembershipsResponse
newListGroupMembershipsResponse Int
pStatus_ =
  ListGroupMembershipsResponse' :: Maybe Text
-> Maybe Text
-> Maybe [GroupMember]
-> Int
-> ListGroupMembershipsResponse
ListGroupMembershipsResponse'
    { $sel:requestId:ListGroupMembershipsResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListGroupMembershipsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupMemberList:ListGroupMembershipsResponse' :: Maybe [GroupMember]
groupMemberList = Maybe [GroupMember]
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListGroupMembershipsResponse' :: Int
status = Int
pStatus_
    }

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

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

-- | The list of the members of the group.
listGroupMembershipsResponse_groupMemberList :: Lens.Lens' ListGroupMembershipsResponse (Prelude.Maybe [GroupMember])
listGroupMembershipsResponse_groupMemberList :: (Maybe [GroupMember] -> f (Maybe [GroupMember]))
-> ListGroupMembershipsResponse -> f ListGroupMembershipsResponse
listGroupMembershipsResponse_groupMemberList = (ListGroupMembershipsResponse -> Maybe [GroupMember])
-> (ListGroupMembershipsResponse
    -> Maybe [GroupMember] -> ListGroupMembershipsResponse)
-> Lens
     ListGroupMembershipsResponse
     ListGroupMembershipsResponse
     (Maybe [GroupMember])
     (Maybe [GroupMember])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupMembershipsResponse' {Maybe [GroupMember]
groupMemberList :: Maybe [GroupMember]
$sel:groupMemberList:ListGroupMembershipsResponse' :: ListGroupMembershipsResponse -> Maybe [GroupMember]
groupMemberList} -> Maybe [GroupMember]
groupMemberList) (\s :: ListGroupMembershipsResponse
s@ListGroupMembershipsResponse' {} Maybe [GroupMember]
a -> ListGroupMembershipsResponse
s {$sel:groupMemberList:ListGroupMembershipsResponse' :: Maybe [GroupMember]
groupMemberList = Maybe [GroupMember]
a} :: ListGroupMembershipsResponse) ((Maybe [GroupMember] -> f (Maybe [GroupMember]))
 -> ListGroupMembershipsResponse -> f ListGroupMembershipsResponse)
-> ((Maybe [GroupMember] -> f (Maybe [GroupMember]))
    -> Maybe [GroupMember] -> f (Maybe [GroupMember]))
-> (Maybe [GroupMember] -> f (Maybe [GroupMember]))
-> ListGroupMembershipsResponse
-> f ListGroupMembershipsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [GroupMember] [GroupMember] [GroupMember] [GroupMember]
-> Iso
     (Maybe [GroupMember])
     (Maybe [GroupMember])
     (Maybe [GroupMember])
     (Maybe [GroupMember])
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 [GroupMember] [GroupMember] [GroupMember] [GroupMember]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListGroupMembershipsResponse