{-# 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.ListGroups
-- 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 groups associated with a user pool.
--
-- Calling this action requires developer credentials.
--
-- This operation returns paginated results.
module Amazonka.CognitoIdentityProvider.ListGroups
  ( -- * Creating a Request
    ListGroups (..),
    newListGroups,

    -- * Request Lenses
    listGroups_nextToken,
    listGroups_limit,
    listGroups_userPoolId,

    -- * Destructuring the Response
    ListGroupsResponse (..),
    newListGroupsResponse,

    -- * Response Lenses
    listGroupsResponse_groups,
    listGroupsResponse_nextToken,
    listGroupsResponse_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:/ 'newListGroups' smart constructor.
data ListGroups = ListGroups'
  { -- | 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.
    ListGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The limit of the request to list groups.
    ListGroups -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The user pool ID for the user pool.
    ListGroups -> Text
userPoolId :: Prelude.Text
  }
  deriving (ListGroups -> ListGroups -> Bool
(ListGroups -> ListGroups -> Bool)
-> (ListGroups -> ListGroups -> Bool) -> Eq ListGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroups -> ListGroups -> Bool
$c/= :: ListGroups -> ListGroups -> Bool
== :: ListGroups -> ListGroups -> Bool
$c== :: ListGroups -> ListGroups -> Bool
Prelude.Eq, ReadPrec [ListGroups]
ReadPrec ListGroups
Int -> ReadS ListGroups
ReadS [ListGroups]
(Int -> ReadS ListGroups)
-> ReadS [ListGroups]
-> ReadPrec ListGroups
-> ReadPrec [ListGroups]
-> Read ListGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroups]
$creadListPrec :: ReadPrec [ListGroups]
readPrec :: ReadPrec ListGroups
$creadPrec :: ReadPrec ListGroups
readList :: ReadS [ListGroups]
$creadList :: ReadS [ListGroups]
readsPrec :: Int -> ReadS ListGroups
$creadsPrec :: Int -> ReadS ListGroups
Prelude.Read, Int -> ListGroups -> ShowS
[ListGroups] -> ShowS
ListGroups -> String
(Int -> ListGroups -> ShowS)
-> (ListGroups -> String)
-> ([ListGroups] -> ShowS)
-> Show ListGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroups] -> ShowS
$cshowList :: [ListGroups] -> ShowS
show :: ListGroups -> String
$cshow :: ListGroups -> String
showsPrec :: Int -> ListGroups -> ShowS
$cshowsPrec :: Int -> ListGroups -> ShowS
Prelude.Show, (forall x. ListGroups -> Rep ListGroups x)
-> (forall x. Rep ListGroups x -> ListGroups) -> Generic ListGroups
forall x. Rep ListGroups x -> ListGroups
forall x. ListGroups -> Rep ListGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGroups x -> ListGroups
$cfrom :: forall x. ListGroups -> Rep ListGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListGroups' 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', 'listGroups_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', 'listGroups_limit' - The limit of the request to list groups.
--
-- 'userPoolId', 'listGroups_userPoolId' - The user pool ID for the user pool.
newListGroups ::
  -- | 'userPoolId'
  Prelude.Text ->
  ListGroups
newListGroups :: Text -> ListGroups
newListGroups Text
pUserPoolId_ =
  ListGroups' :: Maybe Text -> Maybe Natural -> Text -> ListGroups
ListGroups'
    { $sel:nextToken:ListGroups' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:ListGroups' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:ListGroups' :: Text
userPoolId = Text
pUserPoolId_
    }

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

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

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

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

instance Prelude.NFData ListGroups

instance Core.ToHeaders ListGroups where
  toHeaders :: ListGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListGroups -> 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.ListGroups" ::
                          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 ListGroups where
  toJSON :: ListGroups -> Value
toJSON ListGroups' {Maybe Natural
Maybe Text
Text
userPoolId :: Text
limit :: Maybe Natural
nextToken :: Maybe Text
$sel:userPoolId:ListGroups' :: ListGroups -> Text
$sel:limit:ListGroups' :: ListGroups -> Maybe Natural
$sel:nextToken:ListGroups' :: ListGroups -> 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)
          ]
      )

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

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

-- | /See:/ 'newListGroupsResponse' smart constructor.
data ListGroupsResponse = ListGroupsResponse'
  { -- | The group objects for the groups.
    ListGroupsResponse -> Maybe [GroupType]
groups :: Prelude.Maybe [GroupType],
    -- | 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.
    ListGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListGroupsResponse -> ListGroupsResponse -> Bool
(ListGroupsResponse -> ListGroupsResponse -> Bool)
-> (ListGroupsResponse -> ListGroupsResponse -> Bool)
-> Eq ListGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroupsResponse -> ListGroupsResponse -> Bool
$c/= :: ListGroupsResponse -> ListGroupsResponse -> Bool
== :: ListGroupsResponse -> ListGroupsResponse -> Bool
$c== :: ListGroupsResponse -> ListGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListGroupsResponse]
ReadPrec ListGroupsResponse
Int -> ReadS ListGroupsResponse
ReadS [ListGroupsResponse]
(Int -> ReadS ListGroupsResponse)
-> ReadS [ListGroupsResponse]
-> ReadPrec ListGroupsResponse
-> ReadPrec [ListGroupsResponse]
-> Read ListGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroupsResponse]
$creadListPrec :: ReadPrec [ListGroupsResponse]
readPrec :: ReadPrec ListGroupsResponse
$creadPrec :: ReadPrec ListGroupsResponse
readList :: ReadS [ListGroupsResponse]
$creadList :: ReadS [ListGroupsResponse]
readsPrec :: Int -> ReadS ListGroupsResponse
$creadsPrec :: Int -> ReadS ListGroupsResponse
Prelude.Read, Int -> ListGroupsResponse -> ShowS
[ListGroupsResponse] -> ShowS
ListGroupsResponse -> String
(Int -> ListGroupsResponse -> ShowS)
-> (ListGroupsResponse -> String)
-> ([ListGroupsResponse] -> ShowS)
-> Show ListGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroupsResponse] -> ShowS
$cshowList :: [ListGroupsResponse] -> ShowS
show :: ListGroupsResponse -> String
$cshow :: ListGroupsResponse -> String
showsPrec :: Int -> ListGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListGroupsResponse -> ShowS
Prelude.Show, (forall x. ListGroupsResponse -> Rep ListGroupsResponse x)
-> (forall x. Rep ListGroupsResponse x -> ListGroupsResponse)
-> Generic ListGroupsResponse
forall x. Rep ListGroupsResponse x -> ListGroupsResponse
forall x. ListGroupsResponse -> Rep ListGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGroupsResponse x -> ListGroupsResponse
$cfrom :: forall x. ListGroupsResponse -> Rep ListGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListGroupsResponse' 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:
--
-- 'groups', 'listGroupsResponse_groups' - The group objects for the groups.
--
-- 'nextToken', 'listGroupsResponse_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', 'listGroupsResponse_httpStatus' - The response's http status code.
newListGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListGroupsResponse
newListGroupsResponse :: Int -> ListGroupsResponse
newListGroupsResponse Int
pHttpStatus_ =
  ListGroupsResponse' :: Maybe [GroupType] -> Maybe Text -> Int -> ListGroupsResponse
ListGroupsResponse'
    { $sel:groups:ListGroupsResponse' :: Maybe [GroupType]
groups = Maybe [GroupType]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListGroupsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The group objects for the groups.
listGroupsResponse_groups :: Lens.Lens' ListGroupsResponse (Prelude.Maybe [GroupType])
listGroupsResponse_groups :: (Maybe [GroupType] -> f (Maybe [GroupType]))
-> ListGroupsResponse -> f ListGroupsResponse
listGroupsResponse_groups = (ListGroupsResponse -> Maybe [GroupType])
-> (ListGroupsResponse -> Maybe [GroupType] -> ListGroupsResponse)
-> Lens' ListGroupsResponse (Maybe [GroupType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupsResponse' {Maybe [GroupType]
groups :: Maybe [GroupType]
$sel:groups:ListGroupsResponse' :: ListGroupsResponse -> Maybe [GroupType]
groups} -> Maybe [GroupType]
groups) (\s :: ListGroupsResponse
s@ListGroupsResponse' {} Maybe [GroupType]
a -> ListGroupsResponse
s {$sel:groups:ListGroupsResponse' :: Maybe [GroupType]
groups = Maybe [GroupType]
a} :: ListGroupsResponse) ((Maybe [GroupType] -> f (Maybe [GroupType]))
 -> ListGroupsResponse -> f ListGroupsResponse)
-> ((Maybe [GroupType] -> f (Maybe [GroupType]))
    -> Maybe [GroupType] -> f (Maybe [GroupType]))
-> (Maybe [GroupType] -> f (Maybe [GroupType]))
-> ListGroupsResponse
-> f ListGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [GroupType] [GroupType] [GroupType] [GroupType]
-> Iso
     (Maybe [GroupType])
     (Maybe [GroupType])
     (Maybe [GroupType])
     (Maybe [GroupType])
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 [GroupType] [GroupType] [GroupType] [GroupType]
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.
listGroupsResponse_nextToken :: Lens.Lens' ListGroupsResponse (Prelude.Maybe Prelude.Text)
listGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGroupsResponse -> f ListGroupsResponse
listGroupsResponse_nextToken = (ListGroupsResponse -> Maybe Text)
-> (ListGroupsResponse -> Maybe Text -> ListGroupsResponse)
-> Lens' ListGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGroupsResponse' :: ListGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGroupsResponse
s@ListGroupsResponse' {} Maybe Text
a -> ListGroupsResponse
s {$sel:nextToken:ListGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGroupsResponse)

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

instance Prelude.NFData ListGroupsResponse