{-# 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-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)
module Amazonka.Connect.Types.HierarchyGroupSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 name of the hierarchy group.
    HierarchyGroupSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the hierarchy group.
    HierarchyGroupSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (HierarchyGroupSummary -> HierarchyGroupSummary -> Bool
(HierarchyGroupSummary -> HierarchyGroupSummary -> Bool)
-> (HierarchyGroupSummary -> HierarchyGroupSummary -> Bool)
-> Eq HierarchyGroupSummary
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]
(Int -> ReadS HierarchyGroupSummary)
-> ReadS [HierarchyGroupSummary]
-> ReadPrec HierarchyGroupSummary
-> ReadPrec [HierarchyGroupSummary]
-> Read 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
(Int -> HierarchyGroupSummary -> ShowS)
-> (HierarchyGroupSummary -> String)
-> ([HierarchyGroupSummary] -> ShowS)
-> Show HierarchyGroupSummary
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. HierarchyGroupSummary -> Rep HierarchyGroupSummary x)
-> (forall x. Rep HierarchyGroupSummary x -> HierarchyGroupSummary)
-> Generic HierarchyGroupSummary
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.
--
-- 'name', 'hierarchyGroupSummary_name' - The name of the hierarchy group.
--
-- 'id', 'hierarchyGroupSummary_id' - The identifier of the hierarchy group.
newHierarchyGroupSummary ::
  HierarchyGroupSummary
newHierarchyGroupSummary :: HierarchyGroupSummary
newHierarchyGroupSummary =
  HierarchyGroupSummary' :: Maybe Text -> Maybe Text -> Maybe Text -> HierarchyGroupSummary
HierarchyGroupSummary'
    { $sel:arn:HierarchyGroupSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:HierarchyGroupSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:HierarchyGroupSummary' :: Maybe Text
id = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> HierarchyGroupSummary -> f HierarchyGroupSummary
hierarchyGroupSummary_arn = (HierarchyGroupSummary -> Maybe Text)
-> (HierarchyGroupSummary -> Maybe Text -> HierarchyGroupSummary)
-> Lens
     HierarchyGroupSummary
     HierarchyGroupSummary
     (Maybe Text)
     (Maybe Text)
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 name of the hierarchy group.
hierarchyGroupSummary_name :: Lens.Lens' HierarchyGroupSummary (Prelude.Maybe Prelude.Text)
hierarchyGroupSummary_name :: (Maybe Text -> f (Maybe Text))
-> HierarchyGroupSummary -> f HierarchyGroupSummary
hierarchyGroupSummary_name = (HierarchyGroupSummary -> Maybe Text)
-> (HierarchyGroupSummary -> Maybe Text -> HierarchyGroupSummary)
-> Lens
     HierarchyGroupSummary
     HierarchyGroupSummary
     (Maybe Text)
     (Maybe Text)
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)

-- | The identifier of the hierarchy group.
hierarchyGroupSummary_id :: Lens.Lens' HierarchyGroupSummary (Prelude.Maybe Prelude.Text)
hierarchyGroupSummary_id :: (Maybe Text -> f (Maybe Text))
-> HierarchyGroupSummary -> f HierarchyGroupSummary
hierarchyGroupSummary_id = (HierarchyGroupSummary -> Maybe Text)
-> (HierarchyGroupSummary -> Maybe Text -> HierarchyGroupSummary)
-> Lens
     HierarchyGroupSummary
     HierarchyGroupSummary
     (Maybe Text)
     (Maybe Text)
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)

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

instance Prelude.Hashable HierarchyGroupSummary

instance Prelude.NFData HierarchyGroupSummary