{-# 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.Connect.ListUserHierarchyGroups
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Provides summary information about the hierarchy groups for the
-- specified Amazon Connect instance.
--
-- For more information about agent hierarchies, see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/agent-hierarchy.html Set Up Agent Hierarchies>
-- in the /Amazon Connect Administrator Guide/.
--
-- This operation returns paginated results.
module Amazonka.Connect.ListUserHierarchyGroups
  ( -- * Creating a Request
    ListUserHierarchyGroups (..),
    newListUserHierarchyGroups,

    -- * Request Lenses
    listUserHierarchyGroups_maxResults,
    listUserHierarchyGroups_nextToken,
    listUserHierarchyGroups_instanceId,

    -- * Destructuring the Response
    ListUserHierarchyGroupsResponse (..),
    newListUserHierarchyGroupsResponse,

    -- * Response Lenses
    listUserHierarchyGroupsResponse_nextToken,
    listUserHierarchyGroupsResponse_userHierarchyGroupSummaryList,
    listUserHierarchyGroupsResponse_httpStatus,
  )
where

import Amazonka.Connect.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListUserHierarchyGroups' smart constructor.
data ListUserHierarchyGroups = ListUserHierarchyGroups'
  { -- | The maximum number of results to return per page. The default MaxResult
    -- size is 100.
    ListUserHierarchyGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of results. Use the value returned in the
    -- previous response in the next request to retrieve the next set of
    -- results.
    ListUserHierarchyGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    ListUserHierarchyGroups -> Text
instanceId :: Prelude.Text
  }
  deriving (ListUserHierarchyGroups -> ListUserHierarchyGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserHierarchyGroups -> ListUserHierarchyGroups -> Bool
$c/= :: ListUserHierarchyGroups -> ListUserHierarchyGroups -> Bool
== :: ListUserHierarchyGroups -> ListUserHierarchyGroups -> Bool
$c== :: ListUserHierarchyGroups -> ListUserHierarchyGroups -> Bool
Prelude.Eq, ReadPrec [ListUserHierarchyGroups]
ReadPrec ListUserHierarchyGroups
Int -> ReadS ListUserHierarchyGroups
ReadS [ListUserHierarchyGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserHierarchyGroups]
$creadListPrec :: ReadPrec [ListUserHierarchyGroups]
readPrec :: ReadPrec ListUserHierarchyGroups
$creadPrec :: ReadPrec ListUserHierarchyGroups
readList :: ReadS [ListUserHierarchyGroups]
$creadList :: ReadS [ListUserHierarchyGroups]
readsPrec :: Int -> ReadS ListUserHierarchyGroups
$creadsPrec :: Int -> ReadS ListUserHierarchyGroups
Prelude.Read, Int -> ListUserHierarchyGroups -> ShowS
[ListUserHierarchyGroups] -> ShowS
ListUserHierarchyGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserHierarchyGroups] -> ShowS
$cshowList :: [ListUserHierarchyGroups] -> ShowS
show :: ListUserHierarchyGroups -> String
$cshow :: ListUserHierarchyGroups -> String
showsPrec :: Int -> ListUserHierarchyGroups -> ShowS
$cshowsPrec :: Int -> ListUserHierarchyGroups -> ShowS
Prelude.Show, forall x. Rep ListUserHierarchyGroups x -> ListUserHierarchyGroups
forall x. ListUserHierarchyGroups -> Rep ListUserHierarchyGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListUserHierarchyGroups x -> ListUserHierarchyGroups
$cfrom :: forall x. ListUserHierarchyGroups -> Rep ListUserHierarchyGroups x
Prelude.Generic)

-- |
-- Create a value of 'ListUserHierarchyGroups' 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:
--
-- 'maxResults', 'listUserHierarchyGroups_maxResults' - The maximum number of results to return per page. The default MaxResult
-- size is 100.
--
-- 'nextToken', 'listUserHierarchyGroups_nextToken' - The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
--
-- 'instanceId', 'listUserHierarchyGroups_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
newListUserHierarchyGroups ::
  -- | 'instanceId'
  Prelude.Text ->
  ListUserHierarchyGroups
newListUserHierarchyGroups :: Text -> ListUserHierarchyGroups
newListUserHierarchyGroups Text
pInstanceId_ =
  ListUserHierarchyGroups'
    { $sel:maxResults:ListUserHierarchyGroups' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListUserHierarchyGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceId:ListUserHierarchyGroups' :: Text
instanceId = Text
pInstanceId_
    }

-- | The maximum number of results to return per page. The default MaxResult
-- size is 100.
listUserHierarchyGroups_maxResults :: Lens.Lens' ListUserHierarchyGroups (Prelude.Maybe Prelude.Natural)
listUserHierarchyGroups_maxResults :: Lens' ListUserHierarchyGroups (Maybe Natural)
listUserHierarchyGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserHierarchyGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListUserHierarchyGroups
s@ListUserHierarchyGroups' {} Maybe Natural
a -> ListUserHierarchyGroups
s {$sel:maxResults:ListUserHierarchyGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListUserHierarchyGroups)

-- | The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
listUserHierarchyGroups_nextToken :: Lens.Lens' ListUserHierarchyGroups (Prelude.Maybe Prelude.Text)
listUserHierarchyGroups_nextToken :: Lens' ListUserHierarchyGroups (Maybe Text)
listUserHierarchyGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserHierarchyGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUserHierarchyGroups
s@ListUserHierarchyGroups' {} Maybe Text
a -> ListUserHierarchyGroups
s {$sel:nextToken:ListUserHierarchyGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListUserHierarchyGroups)

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
listUserHierarchyGroups_instanceId :: Lens.Lens' ListUserHierarchyGroups Prelude.Text
listUserHierarchyGroups_instanceId :: Lens' ListUserHierarchyGroups Text
listUserHierarchyGroups_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserHierarchyGroups' {Text
instanceId :: Text
$sel:instanceId:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Text
instanceId} -> Text
instanceId) (\s :: ListUserHierarchyGroups
s@ListUserHierarchyGroups' {} Text
a -> ListUserHierarchyGroups
s {$sel:instanceId:ListUserHierarchyGroups' :: Text
instanceId = Text
a} :: ListUserHierarchyGroups)

instance Core.AWSPager ListUserHierarchyGroups where
  page :: ListUserHierarchyGroups
-> AWSResponse ListUserHierarchyGroups
-> Maybe ListUserHierarchyGroups
page ListUserHierarchyGroups
rq AWSResponse ListUserHierarchyGroups
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUserHierarchyGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUserHierarchyGroupsResponse (Maybe Text)
listUserHierarchyGroupsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUserHierarchyGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListUserHierarchyGroupsResponse (Maybe [HierarchyGroupSummary])
listUserHierarchyGroupsResponse_userHierarchyGroupSummaryList
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListUserHierarchyGroups
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListUserHierarchyGroups (Maybe Text)
listUserHierarchyGroups_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUserHierarchyGroups
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListUserHierarchyGroupsResponse (Maybe Text)
listUserHierarchyGroupsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListUserHierarchyGroups where
  type
    AWSResponse ListUserHierarchyGroups =
      ListUserHierarchyGroupsResponse
  request :: (Service -> Service)
-> ListUserHierarchyGroups -> Request ListUserHierarchyGroups
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListUserHierarchyGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListUserHierarchyGroups)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [HierarchyGroupSummary]
-> Int
-> ListUserHierarchyGroupsResponse
ListUserHierarchyGroupsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"UserHierarchyGroupSummaryList"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListUserHierarchyGroups where
  hashWithSalt :: Int -> ListUserHierarchyGroups -> Int
hashWithSalt Int
_salt ListUserHierarchyGroups' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Text
$sel:nextToken:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Maybe Text
$sel:maxResults:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId

instance Prelude.NFData ListUserHierarchyGroups where
  rnf :: ListUserHierarchyGroups -> ()
rnf ListUserHierarchyGroups' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Text
$sel:nextToken:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Maybe Text
$sel:maxResults:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId

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

instance Data.ToPath ListUserHierarchyGroups where
  toPath :: ListUserHierarchyGroups -> ByteString
toPath ListUserHierarchyGroups' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Text
$sel:nextToken:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Maybe Text
$sel:maxResults:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/user-hierarchy-groups-summary/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
instanceId
      ]

instance Data.ToQuery ListUserHierarchyGroups where
  toQuery :: ListUserHierarchyGroups -> QueryString
toQuery ListUserHierarchyGroups' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Text
$sel:nextToken:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Maybe Text
$sel:maxResults:ListUserHierarchyGroups' :: ListUserHierarchyGroups -> Maybe Natural
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newListUserHierarchyGroupsResponse' smart constructor.
data ListUserHierarchyGroupsResponse = ListUserHierarchyGroupsResponse'
  { -- | If there are additional results, this is the token for the next set of
    -- results.
    ListUserHierarchyGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the hierarchy groups.
    ListUserHierarchyGroupsResponse -> Maybe [HierarchyGroupSummary]
userHierarchyGroupSummaryList :: Prelude.Maybe [HierarchyGroupSummary],
    -- | The response's http status code.
    ListUserHierarchyGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListUserHierarchyGroupsResponse
-> ListUserHierarchyGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListUserHierarchyGroupsResponse
-> ListUserHierarchyGroupsResponse -> Bool
$c/= :: ListUserHierarchyGroupsResponse
-> ListUserHierarchyGroupsResponse -> Bool
== :: ListUserHierarchyGroupsResponse
-> ListUserHierarchyGroupsResponse -> Bool
$c== :: ListUserHierarchyGroupsResponse
-> ListUserHierarchyGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListUserHierarchyGroupsResponse]
ReadPrec ListUserHierarchyGroupsResponse
Int -> ReadS ListUserHierarchyGroupsResponse
ReadS [ListUserHierarchyGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListUserHierarchyGroupsResponse]
$creadListPrec :: ReadPrec [ListUserHierarchyGroupsResponse]
readPrec :: ReadPrec ListUserHierarchyGroupsResponse
$creadPrec :: ReadPrec ListUserHierarchyGroupsResponse
readList :: ReadS [ListUserHierarchyGroupsResponse]
$creadList :: ReadS [ListUserHierarchyGroupsResponse]
readsPrec :: Int -> ReadS ListUserHierarchyGroupsResponse
$creadsPrec :: Int -> ReadS ListUserHierarchyGroupsResponse
Prelude.Read, Int -> ListUserHierarchyGroupsResponse -> ShowS
[ListUserHierarchyGroupsResponse] -> ShowS
ListUserHierarchyGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListUserHierarchyGroupsResponse] -> ShowS
$cshowList :: [ListUserHierarchyGroupsResponse] -> ShowS
show :: ListUserHierarchyGroupsResponse -> String
$cshow :: ListUserHierarchyGroupsResponse -> String
showsPrec :: Int -> ListUserHierarchyGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListUserHierarchyGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep ListUserHierarchyGroupsResponse x
-> ListUserHierarchyGroupsResponse
forall x.
ListUserHierarchyGroupsResponse
-> Rep ListUserHierarchyGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListUserHierarchyGroupsResponse x
-> ListUserHierarchyGroupsResponse
$cfrom :: forall x.
ListUserHierarchyGroupsResponse
-> Rep ListUserHierarchyGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListUserHierarchyGroupsResponse' 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', 'listUserHierarchyGroupsResponse_nextToken' - If there are additional results, this is the token for the next set of
-- results.
--
-- 'userHierarchyGroupSummaryList', 'listUserHierarchyGroupsResponse_userHierarchyGroupSummaryList' - Information about the hierarchy groups.
--
-- 'httpStatus', 'listUserHierarchyGroupsResponse_httpStatus' - The response's http status code.
newListUserHierarchyGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListUserHierarchyGroupsResponse
newListUserHierarchyGroupsResponse :: Int -> ListUserHierarchyGroupsResponse
newListUserHierarchyGroupsResponse Int
pHttpStatus_ =
  ListUserHierarchyGroupsResponse'
    { $sel:nextToken:ListUserHierarchyGroupsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:userHierarchyGroupSummaryList:ListUserHierarchyGroupsResponse' :: Maybe [HierarchyGroupSummary]
userHierarchyGroupSummaryList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListUserHierarchyGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If there are additional results, this is the token for the next set of
-- results.
listUserHierarchyGroupsResponse_nextToken :: Lens.Lens' ListUserHierarchyGroupsResponse (Prelude.Maybe Prelude.Text)
listUserHierarchyGroupsResponse_nextToken :: Lens' ListUserHierarchyGroupsResponse (Maybe Text)
listUserHierarchyGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserHierarchyGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListUserHierarchyGroupsResponse' :: ListUserHierarchyGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListUserHierarchyGroupsResponse
s@ListUserHierarchyGroupsResponse' {} Maybe Text
a -> ListUserHierarchyGroupsResponse
s {$sel:nextToken:ListUserHierarchyGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListUserHierarchyGroupsResponse)

-- | Information about the hierarchy groups.
listUserHierarchyGroupsResponse_userHierarchyGroupSummaryList :: Lens.Lens' ListUserHierarchyGroupsResponse (Prelude.Maybe [HierarchyGroupSummary])
listUserHierarchyGroupsResponse_userHierarchyGroupSummaryList :: Lens'
  ListUserHierarchyGroupsResponse (Maybe [HierarchyGroupSummary])
listUserHierarchyGroupsResponse_userHierarchyGroupSummaryList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListUserHierarchyGroupsResponse' {Maybe [HierarchyGroupSummary]
userHierarchyGroupSummaryList :: Maybe [HierarchyGroupSummary]
$sel:userHierarchyGroupSummaryList:ListUserHierarchyGroupsResponse' :: ListUserHierarchyGroupsResponse -> Maybe [HierarchyGroupSummary]
userHierarchyGroupSummaryList} -> Maybe [HierarchyGroupSummary]
userHierarchyGroupSummaryList) (\s :: ListUserHierarchyGroupsResponse
s@ListUserHierarchyGroupsResponse' {} Maybe [HierarchyGroupSummary]
a -> ListUserHierarchyGroupsResponse
s {$sel:userHierarchyGroupSummaryList:ListUserHierarchyGroupsResponse' :: Maybe [HierarchyGroupSummary]
userHierarchyGroupSummaryList = Maybe [HierarchyGroupSummary]
a} :: ListUserHierarchyGroupsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListUserHierarchyGroupsResponse
  where
  rnf :: ListUserHierarchyGroupsResponse -> ()
rnf ListUserHierarchyGroupsResponse' {Int
Maybe [HierarchyGroupSummary]
Maybe Text
httpStatus :: Int
userHierarchyGroupSummaryList :: Maybe [HierarchyGroupSummary]
nextToken :: Maybe Text
$sel:httpStatus:ListUserHierarchyGroupsResponse' :: ListUserHierarchyGroupsResponse -> Int
$sel:userHierarchyGroupSummaryList:ListUserHierarchyGroupsResponse' :: ListUserHierarchyGroupsResponse -> Maybe [HierarchyGroupSummary]
$sel:nextToken:ListUserHierarchyGroupsResponse' :: ListUserHierarchyGroupsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [HierarchyGroupSummary]
userHierarchyGroupSummaryList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus