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

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

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

-- |
-- Create a value of 'HierarchyStructureUpdate' 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', 'hierarchyStructureUpdate_levelFive' - The update for level five.
--
-- 'levelThree', 'hierarchyStructureUpdate_levelThree' - The update for level three.
--
-- 'levelFour', 'hierarchyStructureUpdate_levelFour' - The update for level four.
--
-- 'levelTwo', 'hierarchyStructureUpdate_levelTwo' - The update for level two.
--
-- 'levelOne', 'hierarchyStructureUpdate_levelOne' - The update for level one.
newHierarchyStructureUpdate ::
  HierarchyStructureUpdate
newHierarchyStructureUpdate :: HierarchyStructureUpdate
newHierarchyStructureUpdate =
  HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
-> Maybe HierarchyLevelUpdate
-> Maybe HierarchyLevelUpdate
-> Maybe HierarchyLevelUpdate
-> Maybe HierarchyLevelUpdate
-> HierarchyStructureUpdate
HierarchyStructureUpdate'
    { $sel:levelFive:HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
levelFive =
        Maybe HierarchyLevelUpdate
forall a. Maybe a
Prelude.Nothing,
      $sel:levelThree:HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
levelThree = Maybe HierarchyLevelUpdate
forall a. Maybe a
Prelude.Nothing,
      $sel:levelFour:HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
levelFour = Maybe HierarchyLevelUpdate
forall a. Maybe a
Prelude.Nothing,
      $sel:levelTwo:HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
levelTwo = Maybe HierarchyLevelUpdate
forall a. Maybe a
Prelude.Nothing,
      $sel:levelOne:HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
levelOne = Maybe HierarchyLevelUpdate
forall a. Maybe a
Prelude.Nothing
    }

-- | The update for level five.
hierarchyStructureUpdate_levelFive :: Lens.Lens' HierarchyStructureUpdate (Prelude.Maybe HierarchyLevelUpdate)
hierarchyStructureUpdate_levelFive :: (Maybe HierarchyLevelUpdate -> f (Maybe HierarchyLevelUpdate))
-> HierarchyStructureUpdate -> f HierarchyStructureUpdate
hierarchyStructureUpdate_levelFive = (HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate)
-> (HierarchyStructureUpdate
    -> Maybe HierarchyLevelUpdate -> HierarchyStructureUpdate)
-> Lens
     HierarchyStructureUpdate
     HierarchyStructureUpdate
     (Maybe HierarchyLevelUpdate)
     (Maybe HierarchyLevelUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyStructureUpdate' {Maybe HierarchyLevelUpdate
levelFive :: Maybe HierarchyLevelUpdate
$sel:levelFive:HierarchyStructureUpdate' :: HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate
levelFive} -> Maybe HierarchyLevelUpdate
levelFive) (\s :: HierarchyStructureUpdate
s@HierarchyStructureUpdate' {} Maybe HierarchyLevelUpdate
a -> HierarchyStructureUpdate
s {$sel:levelFive:HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
levelFive = Maybe HierarchyLevelUpdate
a} :: HierarchyStructureUpdate)

-- | The update for level three.
hierarchyStructureUpdate_levelThree :: Lens.Lens' HierarchyStructureUpdate (Prelude.Maybe HierarchyLevelUpdate)
hierarchyStructureUpdate_levelThree :: (Maybe HierarchyLevelUpdate -> f (Maybe HierarchyLevelUpdate))
-> HierarchyStructureUpdate -> f HierarchyStructureUpdate
hierarchyStructureUpdate_levelThree = (HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate)
-> (HierarchyStructureUpdate
    -> Maybe HierarchyLevelUpdate -> HierarchyStructureUpdate)
-> Lens
     HierarchyStructureUpdate
     HierarchyStructureUpdate
     (Maybe HierarchyLevelUpdate)
     (Maybe HierarchyLevelUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyStructureUpdate' {Maybe HierarchyLevelUpdate
levelThree :: Maybe HierarchyLevelUpdate
$sel:levelThree:HierarchyStructureUpdate' :: HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate
levelThree} -> Maybe HierarchyLevelUpdate
levelThree) (\s :: HierarchyStructureUpdate
s@HierarchyStructureUpdate' {} Maybe HierarchyLevelUpdate
a -> HierarchyStructureUpdate
s {$sel:levelThree:HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
levelThree = Maybe HierarchyLevelUpdate
a} :: HierarchyStructureUpdate)

-- | The update for level four.
hierarchyStructureUpdate_levelFour :: Lens.Lens' HierarchyStructureUpdate (Prelude.Maybe HierarchyLevelUpdate)
hierarchyStructureUpdate_levelFour :: (Maybe HierarchyLevelUpdate -> f (Maybe HierarchyLevelUpdate))
-> HierarchyStructureUpdate -> f HierarchyStructureUpdate
hierarchyStructureUpdate_levelFour = (HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate)
-> (HierarchyStructureUpdate
    -> Maybe HierarchyLevelUpdate -> HierarchyStructureUpdate)
-> Lens
     HierarchyStructureUpdate
     HierarchyStructureUpdate
     (Maybe HierarchyLevelUpdate)
     (Maybe HierarchyLevelUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyStructureUpdate' {Maybe HierarchyLevelUpdate
levelFour :: Maybe HierarchyLevelUpdate
$sel:levelFour:HierarchyStructureUpdate' :: HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate
levelFour} -> Maybe HierarchyLevelUpdate
levelFour) (\s :: HierarchyStructureUpdate
s@HierarchyStructureUpdate' {} Maybe HierarchyLevelUpdate
a -> HierarchyStructureUpdate
s {$sel:levelFour:HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
levelFour = Maybe HierarchyLevelUpdate
a} :: HierarchyStructureUpdate)

-- | The update for level two.
hierarchyStructureUpdate_levelTwo :: Lens.Lens' HierarchyStructureUpdate (Prelude.Maybe HierarchyLevelUpdate)
hierarchyStructureUpdate_levelTwo :: (Maybe HierarchyLevelUpdate -> f (Maybe HierarchyLevelUpdate))
-> HierarchyStructureUpdate -> f HierarchyStructureUpdate
hierarchyStructureUpdate_levelTwo = (HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate)
-> (HierarchyStructureUpdate
    -> Maybe HierarchyLevelUpdate -> HierarchyStructureUpdate)
-> Lens
     HierarchyStructureUpdate
     HierarchyStructureUpdate
     (Maybe HierarchyLevelUpdate)
     (Maybe HierarchyLevelUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyStructureUpdate' {Maybe HierarchyLevelUpdate
levelTwo :: Maybe HierarchyLevelUpdate
$sel:levelTwo:HierarchyStructureUpdate' :: HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate
levelTwo} -> Maybe HierarchyLevelUpdate
levelTwo) (\s :: HierarchyStructureUpdate
s@HierarchyStructureUpdate' {} Maybe HierarchyLevelUpdate
a -> HierarchyStructureUpdate
s {$sel:levelTwo:HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
levelTwo = Maybe HierarchyLevelUpdate
a} :: HierarchyStructureUpdate)

-- | The update for level one.
hierarchyStructureUpdate_levelOne :: Lens.Lens' HierarchyStructureUpdate (Prelude.Maybe HierarchyLevelUpdate)
hierarchyStructureUpdate_levelOne :: (Maybe HierarchyLevelUpdate -> f (Maybe HierarchyLevelUpdate))
-> HierarchyStructureUpdate -> f HierarchyStructureUpdate
hierarchyStructureUpdate_levelOne = (HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate)
-> (HierarchyStructureUpdate
    -> Maybe HierarchyLevelUpdate -> HierarchyStructureUpdate)
-> Lens
     HierarchyStructureUpdate
     HierarchyStructureUpdate
     (Maybe HierarchyLevelUpdate)
     (Maybe HierarchyLevelUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyStructureUpdate' {Maybe HierarchyLevelUpdate
levelOne :: Maybe HierarchyLevelUpdate
$sel:levelOne:HierarchyStructureUpdate' :: HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate
levelOne} -> Maybe HierarchyLevelUpdate
levelOne) (\s :: HierarchyStructureUpdate
s@HierarchyStructureUpdate' {} Maybe HierarchyLevelUpdate
a -> HierarchyStructureUpdate
s {$sel:levelOne:HierarchyStructureUpdate' :: Maybe HierarchyLevelUpdate
levelOne = Maybe HierarchyLevelUpdate
a} :: HierarchyStructureUpdate)

instance Prelude.Hashable HierarchyStructureUpdate

instance Prelude.NFData HierarchyStructureUpdate

instance Core.ToJSON HierarchyStructureUpdate where
  toJSON :: HierarchyStructureUpdate -> Value
toJSON HierarchyStructureUpdate' {Maybe HierarchyLevelUpdate
levelOne :: Maybe HierarchyLevelUpdate
levelTwo :: Maybe HierarchyLevelUpdate
levelFour :: Maybe HierarchyLevelUpdate
levelThree :: Maybe HierarchyLevelUpdate
levelFive :: Maybe HierarchyLevelUpdate
$sel:levelOne:HierarchyStructureUpdate' :: HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate
$sel:levelTwo:HierarchyStructureUpdate' :: HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate
$sel:levelFour:HierarchyStructureUpdate' :: HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate
$sel:levelThree:HierarchyStructureUpdate' :: HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate
$sel:levelFive:HierarchyStructureUpdate' :: HierarchyStructureUpdate -> Maybe HierarchyLevelUpdate
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"LevelFive" Text -> HierarchyLevelUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HierarchyLevelUpdate -> Pair)
-> Maybe HierarchyLevelUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HierarchyLevelUpdate
levelFive,
            (Text
"LevelThree" Text -> HierarchyLevelUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HierarchyLevelUpdate -> Pair)
-> Maybe HierarchyLevelUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HierarchyLevelUpdate
levelThree,
            (Text
"LevelFour" Text -> HierarchyLevelUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HierarchyLevelUpdate -> Pair)
-> Maybe HierarchyLevelUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HierarchyLevelUpdate
levelFour,
            (Text
"LevelTwo" Text -> HierarchyLevelUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HierarchyLevelUpdate -> Pair)
-> Maybe HierarchyLevelUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HierarchyLevelUpdate
levelTwo,
            (Text
"LevelOne" Text -> HierarchyLevelUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HierarchyLevelUpdate -> Pair)
-> Maybe HierarchyLevelUpdate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HierarchyLevelUpdate
levelOne
          ]
      )