{-# 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-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)
--
-- 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_nextToken,
    listUserHierarchyGroups_maxResults,
    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.Lens as Lens
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 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 maximum number of results to return per page.
    ListUserHierarchyGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | 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
(ListUserHierarchyGroups -> ListUserHierarchyGroups -> Bool)
-> (ListUserHierarchyGroups -> ListUserHierarchyGroups -> Bool)
-> Eq ListUserHierarchyGroups
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]
(Int -> ReadS ListUserHierarchyGroups)
-> ReadS [ListUserHierarchyGroups]
-> ReadPrec ListUserHierarchyGroups
-> ReadPrec [ListUserHierarchyGroups]
-> Read 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
(Int -> ListUserHierarchyGroups -> ShowS)
-> (ListUserHierarchyGroups -> String)
-> ([ListUserHierarchyGroups] -> ShowS)
-> Show ListUserHierarchyGroups
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.
 ListUserHierarchyGroups -> Rep ListUserHierarchyGroups x)
-> (forall x.
    Rep ListUserHierarchyGroups x -> ListUserHierarchyGroups)
-> Generic ListUserHierarchyGroups
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:
--
-- '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.
--
-- 'maxResults', 'listUserHierarchyGroups_maxResults' - The maximum number of results to return per page.
--
-- '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' :: Maybe Text -> Maybe Natural -> Text -> ListUserHierarchyGroups
ListUserHierarchyGroups'
    { $sel:nextToken:ListUserHierarchyGroups' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListUserHierarchyGroups' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceId:ListUserHierarchyGroups' :: Text
instanceId = Text
pInstanceId_
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListUserHierarchyGroups -> f ListUserHierarchyGroups
listUserHierarchyGroups_nextToken = (ListUserHierarchyGroups -> Maybe Text)
-> (ListUserHierarchyGroups
    -> Maybe Text -> ListUserHierarchyGroups)
-> Lens
     ListUserHierarchyGroups
     ListUserHierarchyGroups
     (Maybe Text)
     (Maybe Text)
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 maximum number of results to return per page.
listUserHierarchyGroups_maxResults :: Lens.Lens' ListUserHierarchyGroups (Prelude.Maybe Prelude.Natural)
listUserHierarchyGroups_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListUserHierarchyGroups -> f ListUserHierarchyGroups
listUserHierarchyGroups_maxResults = (ListUserHierarchyGroups -> Maybe Natural)
-> (ListUserHierarchyGroups
    -> Maybe Natural -> ListUserHierarchyGroups)
-> Lens
     ListUserHierarchyGroups
     ListUserHierarchyGroups
     (Maybe Natural)
     (Maybe Natural)
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 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 :: (Text -> f Text)
-> ListUserHierarchyGroups -> f ListUserHierarchyGroups
listUserHierarchyGroups_instanceId = (ListUserHierarchyGroups -> Text)
-> (ListUserHierarchyGroups -> Text -> ListUserHierarchyGroups)
-> Lens ListUserHierarchyGroups ListUserHierarchyGroups Text Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUserHierarchyGroups
ListUserHierarchyGroupsResponse
rs
            ListUserHierarchyGroupsResponse
-> Getting (First Text) ListUserHierarchyGroupsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUserHierarchyGroupsResponse
-> Const (First Text) ListUserHierarchyGroupsResponse
Lens' ListUserHierarchyGroupsResponse (Maybe Text)
listUserHierarchyGroupsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUserHierarchyGroupsResponse
 -> Const (First Text) ListUserHierarchyGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUserHierarchyGroupsResponse 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 ListUserHierarchyGroups
forall a. Maybe a
Prelude.Nothing
    | Maybe [HierarchyGroupSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListUserHierarchyGroups
ListUserHierarchyGroupsResponse
rs
            ListUserHierarchyGroupsResponse
-> Getting
     (First [HierarchyGroupSummary])
     ListUserHierarchyGroupsResponse
     [HierarchyGroupSummary]
-> Maybe [HierarchyGroupSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [HierarchyGroupSummary]
 -> Const
      (First [HierarchyGroupSummary]) (Maybe [HierarchyGroupSummary]))
-> ListUserHierarchyGroupsResponse
-> Const
     (First [HierarchyGroupSummary]) ListUserHierarchyGroupsResponse
Lens'
  ListUserHierarchyGroupsResponse (Maybe [HierarchyGroupSummary])
listUserHierarchyGroupsResponse_userHierarchyGroupSummaryList
              ((Maybe [HierarchyGroupSummary]
  -> Const
       (First [HierarchyGroupSummary]) (Maybe [HierarchyGroupSummary]))
 -> ListUserHierarchyGroupsResponse
 -> Const
      (First [HierarchyGroupSummary]) ListUserHierarchyGroupsResponse)
-> (([HierarchyGroupSummary]
     -> Const (First [HierarchyGroupSummary]) [HierarchyGroupSummary])
    -> Maybe [HierarchyGroupSummary]
    -> Const
         (First [HierarchyGroupSummary]) (Maybe [HierarchyGroupSummary]))
-> Getting
     (First [HierarchyGroupSummary])
     ListUserHierarchyGroupsResponse
     [HierarchyGroupSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([HierarchyGroupSummary]
 -> Const (First [HierarchyGroupSummary]) [HierarchyGroupSummary])
-> Maybe [HierarchyGroupSummary]
-> Const
     (First [HierarchyGroupSummary]) (Maybe [HierarchyGroupSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListUserHierarchyGroups
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListUserHierarchyGroups -> Maybe ListUserHierarchyGroups
forall a. a -> Maybe a
Prelude.Just (ListUserHierarchyGroups -> Maybe ListUserHierarchyGroups)
-> ListUserHierarchyGroups -> Maybe ListUserHierarchyGroups
forall a b. (a -> b) -> a -> b
Prelude.$
        ListUserHierarchyGroups
rq
          ListUserHierarchyGroups
-> (ListUserHierarchyGroups -> ListUserHierarchyGroups)
-> ListUserHierarchyGroups
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListUserHierarchyGroups -> Identity ListUserHierarchyGroups
Lens
  ListUserHierarchyGroups
  ListUserHierarchyGroups
  (Maybe Text)
  (Maybe Text)
listUserHierarchyGroups_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListUserHierarchyGroups -> Identity ListUserHierarchyGroups)
-> Maybe Text -> ListUserHierarchyGroups -> ListUserHierarchyGroups
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListUserHierarchyGroups
ListUserHierarchyGroupsResponse
rs
          ListUserHierarchyGroupsResponse
-> Getting (First Text) ListUserHierarchyGroupsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListUserHierarchyGroupsResponse
-> Const (First Text) ListUserHierarchyGroupsResponse
Lens' ListUserHierarchyGroupsResponse (Maybe Text)
listUserHierarchyGroupsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListUserHierarchyGroupsResponse
 -> Const (First Text) ListUserHierarchyGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListUserHierarchyGroupsResponse 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 ListUserHierarchyGroups where
  type
    AWSResponse ListUserHierarchyGroups =
      ListUserHierarchyGroupsResponse
  request :: ListUserHierarchyGroups -> Request ListUserHierarchyGroups
request = Service
-> ListUserHierarchyGroups -> Request ListUserHierarchyGroups
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListUserHierarchyGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListUserHierarchyGroups)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListUserHierarchyGroups))
-> Logger
-> Service
-> Proxy ListUserHierarchyGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListUserHierarchyGroups)))
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 [HierarchyGroupSummary]
-> Int
-> ListUserHierarchyGroupsResponse
ListUserHierarchyGroupsResponse'
            (Maybe Text
 -> Maybe [HierarchyGroupSummary]
 -> Int
 -> ListUserHierarchyGroupsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [HierarchyGroupSummary]
      -> Int -> ListUserHierarchyGroupsResponse)
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
"NextToken")
            Either
  String
  (Maybe [HierarchyGroupSummary]
   -> Int -> ListUserHierarchyGroupsResponse)
-> Either String (Maybe [HierarchyGroupSummary])
-> Either String (Int -> ListUserHierarchyGroupsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [HierarchyGroupSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UserHierarchyGroupSummaryList"
                            Either String (Maybe (Maybe [HierarchyGroupSummary]))
-> Maybe [HierarchyGroupSummary]
-> Either String (Maybe [HierarchyGroupSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [HierarchyGroupSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListUserHierarchyGroupsResponse)
-> Either String Int
-> Either String ListUserHierarchyGroupsResponse
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 ListUserHierarchyGroups

instance Prelude.NFData ListUserHierarchyGroups

instance Core.ToHeaders ListUserHierarchyGroups where
  toHeaders :: ListUserHierarchyGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListUserHierarchyGroups -> 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.1" ::
                          Prelude.ByteString
                      )
          ]
      )

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

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

-- | /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
(ListUserHierarchyGroupsResponse
 -> ListUserHierarchyGroupsResponse -> Bool)
-> (ListUserHierarchyGroupsResponse
    -> ListUserHierarchyGroupsResponse -> Bool)
-> Eq ListUserHierarchyGroupsResponse
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]
(Int -> ReadS ListUserHierarchyGroupsResponse)
-> ReadS [ListUserHierarchyGroupsResponse]
-> ReadPrec ListUserHierarchyGroupsResponse
-> ReadPrec [ListUserHierarchyGroupsResponse]
-> Read 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
(Int -> ListUserHierarchyGroupsResponse -> ShowS)
-> (ListUserHierarchyGroupsResponse -> String)
-> ([ListUserHierarchyGroupsResponse] -> ShowS)
-> Show ListUserHierarchyGroupsResponse
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.
 ListUserHierarchyGroupsResponse
 -> Rep ListUserHierarchyGroupsResponse x)
-> (forall x.
    Rep ListUserHierarchyGroupsResponse x
    -> ListUserHierarchyGroupsResponse)
-> Generic ListUserHierarchyGroupsResponse
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' :: Maybe Text
-> Maybe [HierarchyGroupSummary]
-> Int
-> ListUserHierarchyGroupsResponse
ListUserHierarchyGroupsResponse'
    { $sel:nextToken:ListUserHierarchyGroupsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userHierarchyGroupSummaryList:ListUserHierarchyGroupsResponse' :: Maybe [HierarchyGroupSummary]
userHierarchyGroupSummaryList =
        Maybe [HierarchyGroupSummary]
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 :: (Maybe Text -> f (Maybe Text))
-> ListUserHierarchyGroupsResponse
-> f ListUserHierarchyGroupsResponse
listUserHierarchyGroupsResponse_nextToken = (ListUserHierarchyGroupsResponse -> Maybe Text)
-> (ListUserHierarchyGroupsResponse
    -> Maybe Text -> ListUserHierarchyGroupsResponse)
-> Lens' ListUserHierarchyGroupsResponse (Maybe Text)
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 :: (Maybe [HierarchyGroupSummary]
 -> f (Maybe [HierarchyGroupSummary]))
-> ListUserHierarchyGroupsResponse
-> f ListUserHierarchyGroupsResponse
listUserHierarchyGroupsResponse_userHierarchyGroupSummaryList = (ListUserHierarchyGroupsResponse -> Maybe [HierarchyGroupSummary])
-> (ListUserHierarchyGroupsResponse
    -> Maybe [HierarchyGroupSummary]
    -> ListUserHierarchyGroupsResponse)
-> Lens'
     ListUserHierarchyGroupsResponse (Maybe [HierarchyGroupSummary])
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) ((Maybe [HierarchyGroupSummary]
  -> f (Maybe [HierarchyGroupSummary]))
 -> ListUserHierarchyGroupsResponse
 -> f ListUserHierarchyGroupsResponse)
-> ((Maybe [HierarchyGroupSummary]
     -> f (Maybe [HierarchyGroupSummary]))
    -> Maybe [HierarchyGroupSummary]
    -> f (Maybe [HierarchyGroupSummary]))
-> (Maybe [HierarchyGroupSummary]
    -> f (Maybe [HierarchyGroupSummary]))
-> ListUserHierarchyGroupsResponse
-> f ListUserHierarchyGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [HierarchyGroupSummary]
  [HierarchyGroupSummary]
  [HierarchyGroupSummary]
  [HierarchyGroupSummary]
-> Iso
     (Maybe [HierarchyGroupSummary])
     (Maybe [HierarchyGroupSummary])
     (Maybe [HierarchyGroupSummary])
     (Maybe [HierarchyGroupSummary])
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
  [HierarchyGroupSummary]
  [HierarchyGroupSummary]
  [HierarchyGroupSummary]
  [HierarchyGroupSummary]
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 :: (Int -> f Int)
-> ListUserHierarchyGroupsResponse
-> f ListUserHierarchyGroupsResponse
listUserHierarchyGroupsResponse_httpStatus = (ListUserHierarchyGroupsResponse -> Int)
-> (ListUserHierarchyGroupsResponse
    -> Int -> ListUserHierarchyGroupsResponse)
-> Lens
     ListUserHierarchyGroupsResponse
     ListUserHierarchyGroupsResponse
     Int
     Int
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