{-# 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.CognitoIdentityProvider.ListUsersInGroup
-- 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 users in the specified group.
--
-- Calling this action requires developer credentials.
--
-- This operation returns paginated results.
module Amazonka.CognitoIdentityProvider.ListUsersInGroup
  ( -- * Creating a Request
    ListUsersInGroup (..),
    newListUsersInGroup,

    -- * Request Lenses
    listUsersInGroup_nextToken,
    listUsersInGroup_limit,
    listUsersInGroup_userPoolId,
    listUsersInGroup_groupName,

    -- * Destructuring the Response
    ListUsersInGroupResponse (..),
    newListUsersInGroupResponse,

    -- * Response Lenses
    listUsersInGroupResponse_users,
    listUsersInGroupResponse_nextToken,
    listUsersInGroupResponse_httpStatus,
  )
where

import Amazonka.CognitoIdentityProvider.Types
import qualified Amazonka.Core as Core
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:/ 'newListUsersInGroup' smart constructor.
data ListUsersInGroup = ListUsersInGroup'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListUsersInGroup -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The limit of the request to list users.
    ListUsersInGroup -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The user pool ID for the user pool.
    ListUsersInGroup -> Text
userPoolId :: Prelude.Text,
    -- | The name of the group.
    ListUsersInGroup -> Text
groupName :: Prelude.Text
  }
  deriving (ListUsersInGroup -> ListUsersInGroup -> Bool
(ListUsersInGroup -> ListUsersInGroup -> Bool)
-> (ListUsersInGroup -> ListUsersInGroup -> Bool)
-> Eq ListUsersInGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUsersInGroup -> ListUsersInGroup -> Bool
$c/= :: ListUsersInGroup -> ListUsersInGroup -> Bool
== :: ListUsersInGroup -> ListUsersInGroup -> Bool
$c== :: ListUsersInGroup -> ListUsersInGroup -> Bool
Prelude.Eq, ReadPrec [ListUsersInGroup]
ReadPrec ListUsersInGroup
Int -> ReadS ListUsersInGroup
ReadS [ListUsersInGroup]
(Int -> ReadS ListUsersInGroup)
-> ReadS [ListUsersInGroup]
-> ReadPrec ListUsersInGroup
-> ReadPrec [ListUsersInGroup]
-> Read ListUsersInGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUsersInGroup]
$creadListPrec :: ReadPrec [ListUsersInGroup]
readPrec :: ReadPrec ListUsersInGroup
$creadPrec :: ReadPrec ListUsersInGroup
readList :: ReadS [ListUsersInGroup]
$creadList :: ReadS [ListUsersInGroup]
readsPrec :: Int -> ReadS ListUsersInGroup
$creadsPrec :: Int -> ReadS ListUsersInGroup
Prelude.Read, Int -> ListUsersInGroup -> ShowS
[ListUsersInGroup] -> ShowS
ListUsersInGroup -> String
(Int -> ListUsersInGroup -> ShowS)
-> (ListUsersInGroup -> String)
-> ([ListUsersInGroup] -> ShowS)
-> Show ListUsersInGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUsersInGroup] -> ShowS
$cshowList :: [ListUsersInGroup] -> ShowS
show :: ListUsersInGroup -> String
$cshow :: ListUsersInGroup -> String
showsPrec :: Int -> ListUsersInGroup -> ShowS
$cshowsPrec :: Int -> ListUsersInGroup -> ShowS
Prelude.Show, (forall x. ListUsersInGroup -> Rep ListUsersInGroup x)
-> (forall x. Rep ListUsersInGroup x -> ListUsersInGroup)
-> Generic ListUsersInGroup
forall x. Rep ListUsersInGroup x -> ListUsersInGroup
forall x. ListUsersInGroup -> Rep ListUsersInGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUsersInGroup x -> ListUsersInGroup
$cfrom :: forall x. ListUsersInGroup -> Rep ListUsersInGroup x
Prelude.Generic)

-- |
-- Create a value of 'ListUsersInGroup' 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', 'listUsersInGroup_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'limit', 'listUsersInGroup_limit' - The limit of the request to list users.
--
-- 'userPoolId', 'listUsersInGroup_userPoolId' - The user pool ID for the user pool.
--
-- 'groupName', 'listUsersInGroup_groupName' - The name of the group.
newListUsersInGroup ::
  -- | 'userPoolId'
  Prelude.Text ->
  -- | 'groupName'
  Prelude.Text ->
  ListUsersInGroup
newListUsersInGroup :: Text -> Text -> ListUsersInGroup
newListUsersInGroup Text
pUserPoolId_ Text
pGroupName_ =
  ListUsersInGroup' :: Maybe Text -> Maybe Natural -> Text -> Text -> ListUsersInGroup
ListUsersInGroup'
    { $sel:nextToken:ListUsersInGroup' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListUsersInGroup' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:ListUsersInGroup' :: Text
userPoolId = Text
pUserPoolId_,
      $sel:groupName:ListUsersInGroup' :: Text
groupName = Text
pGroupName_
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listUsersInGroup_nextToken :: Lens.Lens' ListUsersInGroup (Prelude.Maybe Prelude.Text)
listUsersInGroup_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUsersInGroup -> f ListUsersInGroup
listUsersInGroup_nextToken = (ListUsersInGroup -> Maybe Text)
-> (ListUsersInGroup -> Maybe Text -> ListUsersInGroup)
-> Lens ListUsersInGroup ListUsersInGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsersInGroup' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUsersInGroup' :: ListUsersInGroup -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUsersInGroup
s@ListUsersInGroup' {} Maybe Text
a -> ListUsersInGroup
s {$sel:nextToken:ListUsersInGroup' :: Maybe Text
nextToken = Maybe Text
a} :: ListUsersInGroup)

-- | The limit of the request to list users.
listUsersInGroup_limit :: Lens.Lens' ListUsersInGroup (Prelude.Maybe Prelude.Natural)
listUsersInGroup_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListUsersInGroup -> f ListUsersInGroup
listUsersInGroup_limit = (ListUsersInGroup -> Maybe Natural)
-> (ListUsersInGroup -> Maybe Natural -> ListUsersInGroup)
-> Lens
     ListUsersInGroup ListUsersInGroup (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsersInGroup' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListUsersInGroup' :: ListUsersInGroup -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListUsersInGroup
s@ListUsersInGroup' {} Maybe Natural
a -> ListUsersInGroup
s {$sel:limit:ListUsersInGroup' :: Maybe Natural
limit = Maybe Natural
a} :: ListUsersInGroup)

-- | The user pool ID for the user pool.
listUsersInGroup_userPoolId :: Lens.Lens' ListUsersInGroup Prelude.Text
listUsersInGroup_userPoolId :: (Text -> f Text) -> ListUsersInGroup -> f ListUsersInGroup
listUsersInGroup_userPoolId = (ListUsersInGroup -> Text)
-> (ListUsersInGroup -> Text -> ListUsersInGroup)
-> Lens ListUsersInGroup ListUsersInGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsersInGroup' {Text
userPoolId :: Text
$sel:userPoolId:ListUsersInGroup' :: ListUsersInGroup -> Text
userPoolId} -> Text
userPoolId) (\s :: ListUsersInGroup
s@ListUsersInGroup' {} Text
a -> ListUsersInGroup
s {$sel:userPoolId:ListUsersInGroup' :: Text
userPoolId = Text
a} :: ListUsersInGroup)

-- | The name of the group.
listUsersInGroup_groupName :: Lens.Lens' ListUsersInGroup Prelude.Text
listUsersInGroup_groupName :: (Text -> f Text) -> ListUsersInGroup -> f ListUsersInGroup
listUsersInGroup_groupName = (ListUsersInGroup -> Text)
-> (ListUsersInGroup -> Text -> ListUsersInGroup)
-> Lens ListUsersInGroup ListUsersInGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsersInGroup' {Text
groupName :: Text
$sel:groupName:ListUsersInGroup' :: ListUsersInGroup -> Text
groupName} -> Text
groupName) (\s :: ListUsersInGroup
s@ListUsersInGroup' {} Text
a -> ListUsersInGroup
s {$sel:groupName:ListUsersInGroup' :: Text
groupName = Text
a} :: ListUsersInGroup)

instance Core.AWSPager ListUsersInGroup where
  page :: ListUsersInGroup
-> AWSResponse ListUsersInGroup -> Maybe ListUsersInGroup
page ListUsersInGroup
rq AWSResponse ListUsersInGroup
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUsersInGroup
ListUsersInGroupResponse
rs
            ListUsersInGroupResponse
-> Getting (First Text) ListUsersInGroupResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUsersInGroupResponse
-> Const (First Text) ListUsersInGroupResponse
Lens' ListUsersInGroupResponse (Maybe Text)
listUsersInGroupResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUsersInGroupResponse
 -> Const (First Text) ListUsersInGroupResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUsersInGroupResponse 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 ListUsersInGroup
forall a. Maybe a
Prelude.Nothing
    | Maybe [UserType] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUsersInGroup
ListUsersInGroupResponse
rs
            ListUsersInGroupResponse
-> Getting (First [UserType]) ListUsersInGroupResponse [UserType]
-> Maybe [UserType]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [UserType] -> Const (First [UserType]) (Maybe [UserType]))
-> ListUsersInGroupResponse
-> Const (First [UserType]) ListUsersInGroupResponse
Lens' ListUsersInGroupResponse (Maybe [UserType])
listUsersInGroupResponse_users ((Maybe [UserType] -> Const (First [UserType]) (Maybe [UserType]))
 -> ListUsersInGroupResponse
 -> Const (First [UserType]) ListUsersInGroupResponse)
-> (([UserType] -> Const (First [UserType]) [UserType])
    -> Maybe [UserType] -> Const (First [UserType]) (Maybe [UserType]))
-> Getting (First [UserType]) ListUsersInGroupResponse [UserType]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([UserType] -> Const (First [UserType]) [UserType])
-> Maybe [UserType] -> Const (First [UserType]) (Maybe [UserType])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListUsersInGroup
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListUsersInGroup -> Maybe ListUsersInGroup
forall a. a -> Maybe a
Prelude.Just (ListUsersInGroup -> Maybe ListUsersInGroup)
-> ListUsersInGroup -> Maybe ListUsersInGroup
forall a b. (a -> b) -> a -> b
Prelude.$
        ListUsersInGroup
rq
          ListUsersInGroup
-> (ListUsersInGroup -> ListUsersInGroup) -> ListUsersInGroup
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListUsersInGroup -> Identity ListUsersInGroup
Lens ListUsersInGroup ListUsersInGroup (Maybe Text) (Maybe Text)
listUsersInGroup_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListUsersInGroup -> Identity ListUsersInGroup)
-> Maybe Text -> ListUsersInGroup -> ListUsersInGroup
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUsersInGroup
ListUsersInGroupResponse
rs
          ListUsersInGroupResponse
-> Getting (First Text) ListUsersInGroupResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUsersInGroupResponse
-> Const (First Text) ListUsersInGroupResponse
Lens' ListUsersInGroupResponse (Maybe Text)
listUsersInGroupResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUsersInGroupResponse
 -> Const (First Text) ListUsersInGroupResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUsersInGroupResponse 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 ListUsersInGroup where
  type
    AWSResponse ListUsersInGroup =
      ListUsersInGroupResponse
  request :: ListUsersInGroup -> Request ListUsersInGroup
request = Service -> ListUsersInGroup -> Request ListUsersInGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListUsersInGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUsersInGroup)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListUsersInGroup))
-> Logger
-> Service
-> Proxy ListUsersInGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListUsersInGroup)))
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 [UserType] -> Maybe Text -> Int -> ListUsersInGroupResponse
ListUsersInGroupResponse'
            (Maybe [UserType] -> Maybe Text -> Int -> ListUsersInGroupResponse)
-> Either String (Maybe [UserType])
-> Either String (Maybe Text -> Int -> ListUsersInGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [UserType]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Users" Either String (Maybe (Maybe [UserType]))
-> Maybe [UserType] -> Either String (Maybe [UserType])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [UserType]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListUsersInGroupResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListUsersInGroupResponse)
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 -> ListUsersInGroupResponse)
-> Either String Int -> Either String ListUsersInGroupResponse
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 ListUsersInGroup

instance Prelude.NFData ListUsersInGroup

instance Core.ToHeaders ListUsersInGroup where
  toHeaders :: ListUsersInGroup -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListUsersInGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSCognitoIdentityProviderService.ListUsersInGroup" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListUsersInGroup where
  toJSON :: ListUsersInGroup -> Value
toJSON ListUsersInGroup' {Maybe Natural
Maybe Text
Text
groupName :: Text
userPoolId :: Text
limit :: Maybe Natural
nextToken :: Maybe Text
$sel:groupName:ListUsersInGroup' :: ListUsersInGroup -> Text
$sel:userPoolId:ListUsersInGroup' :: ListUsersInGroup -> Text
$sel:limit:ListUsersInGroup' :: ListUsersInGroup -> Maybe Natural
$sel:nextToken:ListUsersInGroup' :: ListUsersInGroup -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPoolId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
groupName)
          ]
      )

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

instance Core.ToQuery ListUsersInGroup where
  toQuery :: ListUsersInGroup -> QueryString
toQuery = QueryString -> ListUsersInGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListUsersInGroupResponse' smart constructor.
data ListUsersInGroupResponse = ListUsersInGroupResponse'
  { -- | The users returned in the request to list users.
    ListUsersInGroupResponse -> Maybe [UserType]
users :: Prelude.Maybe [UserType],
    -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListUsersInGroupResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListUsersInGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListUsersInGroupResponse -> ListUsersInGroupResponse -> Bool
(ListUsersInGroupResponse -> ListUsersInGroupResponse -> Bool)
-> (ListUsersInGroupResponse -> ListUsersInGroupResponse -> Bool)
-> Eq ListUsersInGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUsersInGroupResponse -> ListUsersInGroupResponse -> Bool
$c/= :: ListUsersInGroupResponse -> ListUsersInGroupResponse -> Bool
== :: ListUsersInGroupResponse -> ListUsersInGroupResponse -> Bool
$c== :: ListUsersInGroupResponse -> ListUsersInGroupResponse -> Bool
Prelude.Eq, Int -> ListUsersInGroupResponse -> ShowS
[ListUsersInGroupResponse] -> ShowS
ListUsersInGroupResponse -> String
(Int -> ListUsersInGroupResponse -> ShowS)
-> (ListUsersInGroupResponse -> String)
-> ([ListUsersInGroupResponse] -> ShowS)
-> Show ListUsersInGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUsersInGroupResponse] -> ShowS
$cshowList :: [ListUsersInGroupResponse] -> ShowS
show :: ListUsersInGroupResponse -> String
$cshow :: ListUsersInGroupResponse -> String
showsPrec :: Int -> ListUsersInGroupResponse -> ShowS
$cshowsPrec :: Int -> ListUsersInGroupResponse -> ShowS
Prelude.Show, (forall x.
 ListUsersInGroupResponse -> Rep ListUsersInGroupResponse x)
-> (forall x.
    Rep ListUsersInGroupResponse x -> ListUsersInGroupResponse)
-> Generic ListUsersInGroupResponse
forall x.
Rep ListUsersInGroupResponse x -> ListUsersInGroupResponse
forall x.
ListUsersInGroupResponse -> Rep ListUsersInGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListUsersInGroupResponse x -> ListUsersInGroupResponse
$cfrom :: forall x.
ListUsersInGroupResponse -> Rep ListUsersInGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListUsersInGroupResponse' 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:
--
-- 'users', 'listUsersInGroupResponse_users' - The users returned in the request to list users.
--
-- 'nextToken', 'listUsersInGroupResponse_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'httpStatus', 'listUsersInGroupResponse_httpStatus' - The response's http status code.
newListUsersInGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListUsersInGroupResponse
newListUsersInGroupResponse :: Int -> ListUsersInGroupResponse
newListUsersInGroupResponse Int
pHttpStatus_ =
  ListUsersInGroupResponse' :: Maybe [UserType] -> Maybe Text -> Int -> ListUsersInGroupResponse
ListUsersInGroupResponse'
    { $sel:users:ListUsersInGroupResponse' :: Maybe [UserType]
users = Maybe [UserType]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListUsersInGroupResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListUsersInGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The users returned in the request to list users.
listUsersInGroupResponse_users :: Lens.Lens' ListUsersInGroupResponse (Prelude.Maybe [UserType])
listUsersInGroupResponse_users :: (Maybe [UserType] -> f (Maybe [UserType]))
-> ListUsersInGroupResponse -> f ListUsersInGroupResponse
listUsersInGroupResponse_users = (ListUsersInGroupResponse -> Maybe [UserType])
-> (ListUsersInGroupResponse
    -> Maybe [UserType] -> ListUsersInGroupResponse)
-> Lens' ListUsersInGroupResponse (Maybe [UserType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsersInGroupResponse' {Maybe [UserType]
users :: Maybe [UserType]
$sel:users:ListUsersInGroupResponse' :: ListUsersInGroupResponse -> Maybe [UserType]
users} -> Maybe [UserType]
users) (\s :: ListUsersInGroupResponse
s@ListUsersInGroupResponse' {} Maybe [UserType]
a -> ListUsersInGroupResponse
s {$sel:users:ListUsersInGroupResponse' :: Maybe [UserType]
users = Maybe [UserType]
a} :: ListUsersInGroupResponse) ((Maybe [UserType] -> f (Maybe [UserType]))
 -> ListUsersInGroupResponse -> f ListUsersInGroupResponse)
-> ((Maybe [UserType] -> f (Maybe [UserType]))
    -> Maybe [UserType] -> f (Maybe [UserType]))
-> (Maybe [UserType] -> f (Maybe [UserType]))
-> ListUsersInGroupResponse
-> f ListUsersInGroupResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [UserType] [UserType] [UserType] [UserType]
-> Iso
     (Maybe [UserType])
     (Maybe [UserType])
     (Maybe [UserType])
     (Maybe [UserType])
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 [UserType] [UserType] [UserType] [UserType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listUsersInGroupResponse_nextToken :: Lens.Lens' ListUsersInGroupResponse (Prelude.Maybe Prelude.Text)
listUsersInGroupResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListUsersInGroupResponse -> f ListUsersInGroupResponse
listUsersInGroupResponse_nextToken = (ListUsersInGroupResponse -> Maybe Text)
-> (ListUsersInGroupResponse
    -> Maybe Text -> ListUsersInGroupResponse)
-> Lens' ListUsersInGroupResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUsersInGroupResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUsersInGroupResponse' :: ListUsersInGroupResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUsersInGroupResponse
s@ListUsersInGroupResponse' {} Maybe Text
a -> ListUsersInGroupResponse
s {$sel:nextToken:ListUsersInGroupResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUsersInGroupResponse)

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

instance Prelude.NFData ListUsersInGroupResponse