{-# 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.HierarchyGroupSummaryReference
-- 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.HierarchyGroupSummaryReference 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

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

-- |
-- Create a value of 'HierarchyGroupSummaryReference' 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', 'hierarchyGroupSummaryReference_arn' - The Amazon Resource Name (ARN) for the hierarchy group.
--
-- 'id', 'hierarchyGroupSummaryReference_id' - The unique identifier for the hierarchy group.
newHierarchyGroupSummaryReference ::
  HierarchyGroupSummaryReference
newHierarchyGroupSummaryReference :: HierarchyGroupSummaryReference
newHierarchyGroupSummaryReference =
  HierarchyGroupSummaryReference'
    { $sel:arn:HierarchyGroupSummaryReference' :: Maybe Text
arn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:id:HierarchyGroupSummaryReference' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Data.FromJSON HierarchyGroupSummaryReference where
  parseJSON :: Value -> Parser HierarchyGroupSummaryReference
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HierarchyGroupSummaryReference"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> HierarchyGroupSummaryReference
HierarchyGroupSummaryReference'
            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")
      )

instance
  Prelude.Hashable
    HierarchyGroupSummaryReference
  where
  hashWithSalt :: Int -> HierarchyGroupSummaryReference -> Int
hashWithSalt
    Int
_salt
    HierarchyGroupSummaryReference' {Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:id:HierarchyGroupSummaryReference' :: HierarchyGroupSummaryReference -> Maybe Text
$sel:arn:HierarchyGroupSummaryReference' :: HierarchyGroupSummaryReference -> 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

instance
  Prelude.NFData
    HierarchyGroupSummaryReference
  where
  rnf :: HierarchyGroupSummaryReference -> ()
rnf HierarchyGroupSummaryReference' {Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:id:HierarchyGroupSummaryReference' :: HierarchyGroupSummaryReference -> Maybe Text
$sel:arn:HierarchyGroupSummaryReference' :: HierarchyGroupSummaryReference -> 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