{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.HierarchyGroupSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Connect.Types.HierarchyGroupSummary where

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

-- | Contains summary information about a hierarchy group.
--
-- /See:/ 'newHierarchyGroupSummary' smart constructor.
data HierarchyGroupSummary = HierarchyGroupSummary'
  { -- | The Amazon Resource Name (ARN) of the hierarchy group.
    HierarchyGroupSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the hierarchy group.
    HierarchyGroupSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the hierarchy group.
    HierarchyGroupSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (HierarchyGroupSummary -> HierarchyGroupSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HierarchyGroupSummary -> HierarchyGroupSummary -> Bool
$c/= :: HierarchyGroupSummary -> HierarchyGroupSummary -> Bool
== :: HierarchyGroupSummary -> HierarchyGroupSummary -> Bool
$c== :: HierarchyGroupSummary -> HierarchyGroupSummary -> Bool
Prelude.Eq, ReadPrec [HierarchyGroupSummary]
ReadPrec HierarchyGroupSummary
Int -> ReadS HierarchyGroupSummary
ReadS [HierarchyGroupSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HierarchyGroupSummary]
$creadListPrec :: ReadPrec [HierarchyGroupSummary]
readPrec :: ReadPrec HierarchyGroupSummary
$creadPrec :: ReadPrec HierarchyGroupSummary
readList :: ReadS [HierarchyGroupSummary]
$creadList :: ReadS [HierarchyGroupSummary]
readsPrec :: Int -> ReadS HierarchyGroupSummary
$creadsPrec :: Int -> ReadS HierarchyGroupSummary
Prelude.Read, Int -> HierarchyGroupSummary -> ShowS
[HierarchyGroupSummary] -> ShowS
HierarchyGroupSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HierarchyGroupSummary] -> ShowS
$cshowList :: [HierarchyGroupSummary] -> ShowS
show :: HierarchyGroupSummary -> String
$cshow :: HierarchyGroupSummary -> String
showsPrec :: Int -> HierarchyGroupSummary -> ShowS
$cshowsPrec :: Int -> HierarchyGroupSummary -> ShowS
Prelude.Show, forall x. Rep HierarchyGroupSummary x -> HierarchyGroupSummary
forall x. HierarchyGroupSummary -> Rep HierarchyGroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HierarchyGroupSummary x -> HierarchyGroupSummary
$cfrom :: forall x. HierarchyGroupSummary -> Rep HierarchyGroupSummary x
Prelude.Generic)

-- |
-- Create a value of 'HierarchyGroupSummary' 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:
--
-- 'arn', 'hierarchyGroupSummary_arn' - The Amazon Resource Name (ARN) of the hierarchy group.
--
-- 'id', 'hierarchyGroupSummary_id' - The identifier of the hierarchy group.
--
-- 'name', 'hierarchyGroupSummary_name' - The name of the hierarchy group.
newHierarchyGroupSummary ::
  HierarchyGroupSummary
newHierarchyGroupSummary :: HierarchyGroupSummary
newHierarchyGroupSummary =
  HierarchyGroupSummary'
    { $sel:arn:HierarchyGroupSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:id:HierarchyGroupSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:HierarchyGroupSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the hierarchy group.
hierarchyGroupSummary_arn :: Lens.Lens' HierarchyGroupSummary (Prelude.Maybe Prelude.Text)
hierarchyGroupSummary_arn :: Lens' HierarchyGroupSummary (Maybe Text)
hierarchyGroupSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyGroupSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:HierarchyGroupSummary' :: HierarchyGroupSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: HierarchyGroupSummary
s@HierarchyGroupSummary' {} Maybe Text
a -> HierarchyGroupSummary
s {$sel:arn:HierarchyGroupSummary' :: Maybe Text
arn = Maybe Text
a} :: HierarchyGroupSummary)

-- | The identifier of the hierarchy group.
hierarchyGroupSummary_id :: Lens.Lens' HierarchyGroupSummary (Prelude.Maybe Prelude.Text)
hierarchyGroupSummary_id :: Lens' HierarchyGroupSummary (Maybe Text)
hierarchyGroupSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyGroupSummary' {Maybe Text
id :: Maybe Text
$sel:id:HierarchyGroupSummary' :: HierarchyGroupSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: HierarchyGroupSummary
s@HierarchyGroupSummary' {} Maybe Text
a -> HierarchyGroupSummary
s {$sel:id:HierarchyGroupSummary' :: Maybe Text
id = Maybe Text
a} :: HierarchyGroupSummary)

-- | The name of the hierarchy group.
hierarchyGroupSummary_name :: Lens.Lens' HierarchyGroupSummary (Prelude.Maybe Prelude.Text)
hierarchyGroupSummary_name :: Lens' HierarchyGroupSummary (Maybe Text)
hierarchyGroupSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyGroupSummary' {Maybe Text
name :: Maybe Text
$sel:name:HierarchyGroupSummary' :: HierarchyGroupSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: HierarchyGroupSummary
s@HierarchyGroupSummary' {} Maybe Text
a -> HierarchyGroupSummary
s {$sel:name:HierarchyGroupSummary' :: Maybe Text
name = Maybe Text
a} :: HierarchyGroupSummary)

instance Data.FromJSON HierarchyGroupSummary where
  parseJSON :: Value -> Parser HierarchyGroupSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HierarchyGroupSummary"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> HierarchyGroupSummary
HierarchyGroupSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
      )

instance Prelude.Hashable HierarchyGroupSummary where
  hashWithSalt :: Int -> HierarchyGroupSummary -> Int
hashWithSalt Int
_salt HierarchyGroupSummary' {Maybe Text
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:name:HierarchyGroupSummary' :: HierarchyGroupSummary -> Maybe Text
$sel:id:HierarchyGroupSummary' :: HierarchyGroupSummary -> Maybe Text
$sel:arn:HierarchyGroupSummary' :: HierarchyGroupSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData HierarchyGroupSummary where
  rnf :: HierarchyGroupSummary -> ()
rnf HierarchyGroupSummary' {Maybe Text
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:name:HierarchyGroupSummary' :: HierarchyGroupSummary -> Maybe Text
$sel:id:HierarchyGroupSummary' :: HierarchyGroupSummary -> Maybe Text
$sel:arn:HierarchyGroupSummary' :: HierarchyGroupSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name