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

import Amazonka.Connect.Types.HierarchyGroupSummary
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 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 four.
    HierarchyPath -> Maybe HierarchyGroupSummary
levelFour :: Prelude.Maybe HierarchyGroupSummary,
    -- | Information about level one.
    HierarchyPath -> Maybe HierarchyGroupSummary
levelOne :: Prelude.Maybe HierarchyGroupSummary,
    -- | Information about level three.
    HierarchyPath -> Maybe HierarchyGroupSummary
levelThree :: Prelude.Maybe HierarchyGroupSummary,
    -- | Information about level two.
    HierarchyPath -> Maybe HierarchyGroupSummary
levelTwo :: Prelude.Maybe HierarchyGroupSummary
  }
  deriving (HierarchyPath -> HierarchyPath -> Bool
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]
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
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. 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.
--
-- 'levelFour', 'hierarchyPath_levelFour' - Information about level four.
--
-- 'levelOne', 'hierarchyPath_levelOne' - Information about level one.
--
-- 'levelThree', 'hierarchyPath_levelThree' - Information about level three.
--
-- 'levelTwo', 'hierarchyPath_levelTwo' - Information about level two.
newHierarchyPath ::
  HierarchyPath
newHierarchyPath :: HierarchyPath
newHierarchyPath =
  HierarchyPath'
    { $sel:levelFive:HierarchyPath' :: Maybe HierarchyGroupSummary
levelFive = forall a. Maybe a
Prelude.Nothing,
      $sel:levelFour:HierarchyPath' :: Maybe HierarchyGroupSummary
levelFour = forall a. Maybe a
Prelude.Nothing,
      $sel:levelOne:HierarchyPath' :: Maybe HierarchyGroupSummary
levelOne = forall a. Maybe a
Prelude.Nothing,
      $sel:levelThree:HierarchyPath' :: Maybe HierarchyGroupSummary
levelThree = forall a. Maybe a
Prelude.Nothing,
      $sel:levelTwo:HierarchyPath' :: Maybe HierarchyGroupSummary
levelTwo = forall a. Maybe a
Prelude.Nothing
    }

-- | Information about level five.
hierarchyPath_levelFive :: Lens.Lens' HierarchyPath (Prelude.Maybe HierarchyGroupSummary)
hierarchyPath_levelFive :: Lens' HierarchyPath (Maybe HierarchyGroupSummary)
hierarchyPath_levelFive = 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 four.
hierarchyPath_levelFour :: Lens.Lens' HierarchyPath (Prelude.Maybe HierarchyGroupSummary)
hierarchyPath_levelFour :: Lens' HierarchyPath (Maybe HierarchyGroupSummary)
hierarchyPath_levelFour = 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 one.
hierarchyPath_levelOne :: Lens.Lens' HierarchyPath (Prelude.Maybe HierarchyGroupSummary)
hierarchyPath_levelOne :: Lens' HierarchyPath (Maybe HierarchyGroupSummary)
hierarchyPath_levelOne = 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)

-- | Information about level three.
hierarchyPath_levelThree :: Lens.Lens' HierarchyPath (Prelude.Maybe HierarchyGroupSummary)
hierarchyPath_levelThree :: Lens' HierarchyPath (Maybe HierarchyGroupSummary)
hierarchyPath_levelThree = 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 two.
hierarchyPath_levelTwo :: Lens.Lens' HierarchyPath (Prelude.Maybe HierarchyGroupSummary)
hierarchyPath_levelTwo :: Lens' HierarchyPath (Maybe HierarchyGroupSummary)
hierarchyPath_levelTwo = 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)

instance Data.FromJSON HierarchyPath where
  parseJSON :: Value -> Parser HierarchyPath
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HierarchyPath"
      ( \Object
x ->
          Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> Maybe HierarchyGroupSummary
-> HierarchyPath
HierarchyPath'
            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
"LevelFive")
            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
"LevelFour")
            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
"LevelOne")
            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
"LevelThree")
            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
"LevelTwo")
      )

instance Prelude.Hashable HierarchyPath where
  hashWithSalt :: Int -> HierarchyPath -> Int
hashWithSalt Int
_salt HierarchyPath' {Maybe HierarchyGroupSummary
levelTwo :: Maybe HierarchyGroupSummary
levelThree :: Maybe HierarchyGroupSummary
levelOne :: Maybe HierarchyGroupSummary
levelFour :: Maybe HierarchyGroupSummary
levelFive :: Maybe HierarchyGroupSummary
$sel:levelTwo:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
$sel:levelThree:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
$sel:levelOne:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
$sel:levelFour:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
$sel:levelFive:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HierarchyGroupSummary
levelFive
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HierarchyGroupSummary
levelFour
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HierarchyGroupSummary
levelOne
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HierarchyGroupSummary
levelThree
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HierarchyGroupSummary
levelTwo

instance Prelude.NFData HierarchyPath where
  rnf :: HierarchyPath -> ()
rnf HierarchyPath' {Maybe HierarchyGroupSummary
levelTwo :: Maybe HierarchyGroupSummary
levelThree :: Maybe HierarchyGroupSummary
levelOne :: Maybe HierarchyGroupSummary
levelFour :: Maybe HierarchyGroupSummary
levelFive :: Maybe HierarchyGroupSummary
$sel:levelTwo:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
$sel:levelThree:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
$sel:levelOne:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
$sel:levelFour:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
$sel:levelFive:HierarchyPath' :: HierarchyPath -> Maybe HierarchyGroupSummary
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe HierarchyGroupSummary
levelFive
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HierarchyGroupSummary
levelFour
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HierarchyGroupSummary
levelOne
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HierarchyGroupSummary
levelThree
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HierarchyGroupSummary
levelTwo