{-# 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.HierarchyPath
-- 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.HierarchyPath where

import Amazonka.Connect.Types.HierarchyGroupSummary
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about the levels of a hierarchy group.
--
-- /See:/ 'newHierarchyPath' smart constructor.
data HierarchyPath = HierarchyPath'
  { -- | Information about level five.
    HierarchyPath -> Maybe HierarchyGroupSummary
levelFive :: Prelude.Maybe HierarchyGroupSummary,
    -- | Information about level three.
    HierarchyPath -> Maybe HierarchyGroupSummary
levelThree :: Prelude.Maybe HierarchyGroupSummary,
    -- | Information about level four.
    HierarchyPath -> Maybe HierarchyGroupSummary
levelFour :: Prelude.Maybe HierarchyGroupSummary,
    -- | Information about level two.
    HierarchyPath -> Maybe HierarchyGroupSummary
levelTwo :: Prelude.Maybe HierarchyGroupSummary,
    -- | Information about level one.
    HierarchyPath -> Maybe HierarchyGroupSummary
levelOne :: Prelude.Maybe HierarchyGroupSummary
  }
  deriving (HierarchyPath -> HierarchyPath -> Bool
(HierarchyPath -> HierarchyPath -> Bool)
-> (HierarchyPath -> HierarchyPath -> Bool) -> Eq HierarchyPath
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HierarchyPath -> HierarchyPath -> Bool
$c/= :: HierarchyPath -> HierarchyPath -> Bool
== :: HierarchyPath -> HierarchyPath -> Bool
$c== :: HierarchyPath -> HierarchyPath -> Bool
Prelude.Eq, ReadPrec [HierarchyPath]
ReadPrec HierarchyPath
Int -> ReadS HierarchyPath
ReadS [HierarchyPath]
(Int -> ReadS HierarchyPath)
-> ReadS [HierarchyPath]
-> ReadPrec HierarchyPath
-> ReadPrec [HierarchyPath]
-> Read HierarchyPath
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HierarchyPath]
$creadListPrec :: ReadPrec [HierarchyPath]
readPrec :: ReadPrec HierarchyPath
$creadPrec :: ReadPrec HierarchyPath
readList :: ReadS [HierarchyPath]
$creadList :: ReadS [HierarchyPath]
readsPrec :: Int -> ReadS HierarchyPath
$creadsPrec :: Int -> ReadS HierarchyPath
Prelude.Read, Int -> HierarchyPath -> ShowS
[HierarchyPath] -> ShowS
HierarchyPath -> String
(Int -> HierarchyPath -> ShowS)
-> (HierarchyPath -> String)
-> ([HierarchyPath] -> ShowS)
-> Show HierarchyPath
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HierarchyPath] -> ShowS
$cshowList :: [HierarchyPath] -> ShowS
show :: HierarchyPath -> String
$cshow :: HierarchyPath -> String
showsPrec :: Int -> HierarchyPath -> ShowS
$cshowsPrec :: Int -> HierarchyPath -> ShowS
Prelude.Show, (forall x. HierarchyPath -> Rep HierarchyPath x)
-> (forall x. Rep HierarchyPath x -> HierarchyPath)
-> Generic HierarchyPath
forall x. Rep HierarchyPath x -> HierarchyPath
forall x. HierarchyPath -> Rep HierarchyPath x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HierarchyPath x -> HierarchyPath
$cfrom :: forall x. HierarchyPath -> Rep HierarchyPath x
Prelude.Generic)

-- |
-- Create a value of 'HierarchyPath' 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:
--
-- 'levelFive', 'hierarchyPath_levelFive' - Information about level five.
--
-- 'levelThree', 'hierarchyPath_levelThree' - Information about level three.
--
-- 'levelFour', 'hierarchyPath_levelFour' - Information about level four.
--
-- 'levelTwo', 'hierarchyPath_levelTwo' - Information about level two.
--
-- 'levelOne', 'hierarchyPath_levelOne' - Information about level one.
newHierarchyPath ::
  HierarchyPath
newHierarchyPath :: HierarchyPath
newHierarchyPath =
  HierarchyPath' :: Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> HierarchyPath
HierarchyPath'
    { $sel:levelFive:HierarchyPath' :: Maybe HierarchyGroupSummary
levelFive = Maybe HierarchyGroupSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:levelThree:HierarchyPath' :: Maybe HierarchyGroupSummary
levelThree = Maybe HierarchyGroupSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:levelFour:HierarchyPath' :: Maybe HierarchyGroupSummary
levelFour = Maybe HierarchyGroupSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:levelTwo:HierarchyPath' :: Maybe HierarchyGroupSummary
levelTwo = Maybe HierarchyGroupSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:levelOne:HierarchyPath' :: Maybe HierarchyGroupSummary
levelOne = Maybe HierarchyGroupSummary
forall a. Maybe a
Prelude.Nothing
    }

-- | Information about level five.
hierarchyPath_levelFive :: Lens.Lens' HierarchyPath (Prelude.Maybe HierarchyGroupSummary)
hierarchyPath_levelFive :: (Maybe HierarchyGroupSummary -> f (Maybe HierarchyGroupSummary))
-> HierarchyPath -> f HierarchyPath
hierarchyPath_levelFive = (HierarchyPath -> Maybe HierarchyGroupSummary)
-> (HierarchyPath -> Maybe HierarchyGroupSummary -> HierarchyPath)
-> Lens
     HierarchyPath
     HierarchyPath
     (Maybe HierarchyGroupSummary)
     (Maybe HierarchyGroupSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyPath' {Maybe HierarchyGroupSummary
levelFive :: Maybe HierarchyGroupSummary
$sel:levelFive:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
levelFive} -> Maybe HierarchyGroupSummary
levelFive) (\s :: HierarchyPath
s@HierarchyPath' {} Maybe HierarchyGroupSummary
a -> HierarchyPath
s {$sel:levelFive:HierarchyPath' :: Maybe HierarchyGroupSummary
levelFive = Maybe HierarchyGroupSummary
a} :: HierarchyPath)

-- | Information about level three.
hierarchyPath_levelThree :: Lens.Lens' HierarchyPath (Prelude.Maybe HierarchyGroupSummary)
hierarchyPath_levelThree :: (Maybe HierarchyGroupSummary -> f (Maybe HierarchyGroupSummary))
-> HierarchyPath -> f HierarchyPath
hierarchyPath_levelThree = (HierarchyPath -> Maybe HierarchyGroupSummary)
-> (HierarchyPath -> Maybe HierarchyGroupSummary -> HierarchyPath)
-> Lens
     HierarchyPath
     HierarchyPath
     (Maybe HierarchyGroupSummary)
     (Maybe HierarchyGroupSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyPath' {Maybe HierarchyGroupSummary
levelThree :: Maybe HierarchyGroupSummary
$sel:levelThree:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
levelThree} -> Maybe HierarchyGroupSummary
levelThree) (\s :: HierarchyPath
s@HierarchyPath' {} Maybe HierarchyGroupSummary
a -> HierarchyPath
s {$sel:levelThree:HierarchyPath' :: Maybe HierarchyGroupSummary
levelThree = Maybe HierarchyGroupSummary
a} :: HierarchyPath)

-- | Information about level four.
hierarchyPath_levelFour :: Lens.Lens' HierarchyPath (Prelude.Maybe HierarchyGroupSummary)
hierarchyPath_levelFour :: (Maybe HierarchyGroupSummary -> f (Maybe HierarchyGroupSummary))
-> HierarchyPath -> f HierarchyPath
hierarchyPath_levelFour = (HierarchyPath -> Maybe HierarchyGroupSummary)
-> (HierarchyPath -> Maybe HierarchyGroupSummary -> HierarchyPath)
-> Lens
     HierarchyPath
     HierarchyPath
     (Maybe HierarchyGroupSummary)
     (Maybe HierarchyGroupSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyPath' {Maybe HierarchyGroupSummary
levelFour :: Maybe HierarchyGroupSummary
$sel:levelFour:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
levelFour} -> Maybe HierarchyGroupSummary
levelFour) (\s :: HierarchyPath
s@HierarchyPath' {} Maybe HierarchyGroupSummary
a -> HierarchyPath
s {$sel:levelFour:HierarchyPath' :: Maybe HierarchyGroupSummary
levelFour = Maybe HierarchyGroupSummary
a} :: HierarchyPath)

-- | Information about level two.
hierarchyPath_levelTwo :: Lens.Lens' HierarchyPath (Prelude.Maybe HierarchyGroupSummary)
hierarchyPath_levelTwo :: (Maybe HierarchyGroupSummary -> f (Maybe HierarchyGroupSummary))
-> HierarchyPath -> f HierarchyPath
hierarchyPath_levelTwo = (HierarchyPath -> Maybe HierarchyGroupSummary)
-> (HierarchyPath -> Maybe HierarchyGroupSummary -> HierarchyPath)
-> Lens
     HierarchyPath
     HierarchyPath
     (Maybe HierarchyGroupSummary)
     (Maybe HierarchyGroupSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyPath' {Maybe HierarchyGroupSummary
levelTwo :: Maybe HierarchyGroupSummary
$sel:levelTwo:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
levelTwo} -> Maybe HierarchyGroupSummary
levelTwo) (\s :: HierarchyPath
s@HierarchyPath' {} Maybe HierarchyGroupSummary
a -> HierarchyPath
s {$sel:levelTwo:HierarchyPath' :: Maybe HierarchyGroupSummary
levelTwo = Maybe HierarchyGroupSummary
a} :: HierarchyPath)

-- | Information about level one.
hierarchyPath_levelOne :: Lens.Lens' HierarchyPath (Prelude.Maybe HierarchyGroupSummary)
hierarchyPath_levelOne :: (Maybe HierarchyGroupSummary -> f (Maybe HierarchyGroupSummary))
-> HierarchyPath -> f HierarchyPath
hierarchyPath_levelOne = (HierarchyPath -> Maybe HierarchyGroupSummary)
-> (HierarchyPath -> Maybe HierarchyGroupSummary -> HierarchyPath)
-> Lens
     HierarchyPath
     HierarchyPath
     (Maybe HierarchyGroupSummary)
     (Maybe HierarchyGroupSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyPath' {Maybe HierarchyGroupSummary
levelOne :: Maybe HierarchyGroupSummary
$sel:levelOne:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
levelOne} -> Maybe HierarchyGroupSummary
levelOne) (\s :: HierarchyPath
s@HierarchyPath' {} Maybe HierarchyGroupSummary
a -> HierarchyPath
s {$sel:levelOne:HierarchyPath' :: Maybe HierarchyGroupSummary
levelOne = Maybe HierarchyGroupSummary
a} :: HierarchyPath)

instance Core.FromJSON HierarchyPath where
  parseJSON :: Value -> Parser HierarchyPath
parseJSON =
    String
-> (Object -> Parser HierarchyPath)
-> Value
-> Parser HierarchyPath
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"HierarchyPath"
      ( \Object
x ->
          Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> HierarchyPath
HierarchyPath'
            (Maybe HierarchyGroupSummary
 -> Maybe HierarchyGroupSummary
 -> Maybe HierarchyGroupSummary
 -> Maybe HierarchyGroupSummary
 -> Maybe HierarchyGroupSummary
 -> HierarchyPath)
-> Parser (Maybe HierarchyGroupSummary)
-> Parser
     (Maybe HierarchyGroupSummary
      -> Maybe HierarchyGroupSummary
      -> Maybe HierarchyGroupSummary
      -> Maybe HierarchyGroupSummary
      -> HierarchyPath)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe HierarchyGroupSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LevelFive")
            Parser
  (Maybe HierarchyGroupSummary
   -> Maybe HierarchyGroupSummary
   -> Maybe HierarchyGroupSummary
   -> Maybe HierarchyGroupSummary
   -> HierarchyPath)
-> Parser (Maybe HierarchyGroupSummary)
-> Parser
     (Maybe HierarchyGroupSummary
      -> Maybe HierarchyGroupSummary
      -> Maybe HierarchyGroupSummary
      -> HierarchyPath)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HierarchyGroupSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LevelThree")
            Parser
  (Maybe HierarchyGroupSummary
   -> Maybe HierarchyGroupSummary
   -> Maybe HierarchyGroupSummary
   -> HierarchyPath)
-> Parser (Maybe HierarchyGroupSummary)
-> Parser
     (Maybe HierarchyGroupSummary
      -> Maybe HierarchyGroupSummary -> HierarchyPath)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HierarchyGroupSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LevelFour")
            Parser
  (Maybe HierarchyGroupSummary
   -> Maybe HierarchyGroupSummary -> HierarchyPath)
-> Parser (Maybe HierarchyGroupSummary)
-> Parser (Maybe HierarchyGroupSummary -> HierarchyPath)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HierarchyGroupSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LevelTwo")
            Parser (Maybe HierarchyGroupSummary -> HierarchyPath)
-> Parser (Maybe HierarchyGroupSummary) -> Parser HierarchyPath
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HierarchyGroupSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LevelOne")
      )

instance Prelude.Hashable HierarchyPath

instance Prelude.NFData HierarchyPath