{-# 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 #-}
module Amazonka.Connect.Types.HierarchyStructure where
import Amazonka.Connect.Types.HierarchyLevel
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HierarchyStructure = HierarchyStructure'
{
HierarchyStructure -> Maybe HierarchyLevel
levelFive :: Prelude.Maybe HierarchyLevel,
HierarchyStructure -> Maybe HierarchyLevel
levelThree :: Prelude.Maybe HierarchyLevel,
HierarchyStructure -> Maybe HierarchyLevel
levelFour :: Prelude.Maybe HierarchyLevel,
HierarchyStructure -> Maybe HierarchyLevel
levelTwo :: Prelude.Maybe HierarchyLevel,
HierarchyStructure -> Maybe HierarchyLevel
levelOne :: Prelude.Maybe HierarchyLevel
}
deriving (HierarchyStructure -> HierarchyStructure -> Bool
(HierarchyStructure -> HierarchyStructure -> Bool)
-> (HierarchyStructure -> HierarchyStructure -> Bool)
-> Eq HierarchyStructure
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HierarchyStructure -> HierarchyStructure -> Bool
$c/= :: HierarchyStructure -> HierarchyStructure -> Bool
== :: HierarchyStructure -> HierarchyStructure -> Bool
$c== :: HierarchyStructure -> HierarchyStructure -> Bool
Prelude.Eq, ReadPrec [HierarchyStructure]
ReadPrec HierarchyStructure
Int -> ReadS HierarchyStructure
ReadS [HierarchyStructure]
(Int -> ReadS HierarchyStructure)
-> ReadS [HierarchyStructure]
-> ReadPrec HierarchyStructure
-> ReadPrec [HierarchyStructure]
-> Read HierarchyStructure
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HierarchyStructure]
$creadListPrec :: ReadPrec [HierarchyStructure]
readPrec :: ReadPrec HierarchyStructure
$creadPrec :: ReadPrec HierarchyStructure
readList :: ReadS [HierarchyStructure]
$creadList :: ReadS [HierarchyStructure]
readsPrec :: Int -> ReadS HierarchyStructure
$creadsPrec :: Int -> ReadS HierarchyStructure
Prelude.Read, Int -> HierarchyStructure -> ShowS
[HierarchyStructure] -> ShowS
HierarchyStructure -> String
(Int -> HierarchyStructure -> ShowS)
-> (HierarchyStructure -> String)
-> ([HierarchyStructure] -> ShowS)
-> Show HierarchyStructure
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HierarchyStructure] -> ShowS
$cshowList :: [HierarchyStructure] -> ShowS
show :: HierarchyStructure -> String
$cshow :: HierarchyStructure -> String
showsPrec :: Int -> HierarchyStructure -> ShowS
$cshowsPrec :: Int -> HierarchyStructure -> ShowS
Prelude.Show, (forall x. HierarchyStructure -> Rep HierarchyStructure x)
-> (forall x. Rep HierarchyStructure x -> HierarchyStructure)
-> Generic HierarchyStructure
forall x. Rep HierarchyStructure x -> HierarchyStructure
forall x. HierarchyStructure -> Rep HierarchyStructure x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HierarchyStructure x -> HierarchyStructure
$cfrom :: forall x. HierarchyStructure -> Rep HierarchyStructure x
Prelude.Generic)
newHierarchyStructure ::
HierarchyStructure
newHierarchyStructure :: HierarchyStructure
newHierarchyStructure =
HierarchyStructure' :: Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> HierarchyStructure
HierarchyStructure'
{ $sel:levelFive:HierarchyStructure' :: Maybe HierarchyLevel
levelFive = Maybe HierarchyLevel
forall a. Maybe a
Prelude.Nothing,
$sel:levelThree:HierarchyStructure' :: Maybe HierarchyLevel
levelThree = Maybe HierarchyLevel
forall a. Maybe a
Prelude.Nothing,
$sel:levelFour:HierarchyStructure' :: Maybe HierarchyLevel
levelFour = Maybe HierarchyLevel
forall a. Maybe a
Prelude.Nothing,
$sel:levelTwo:HierarchyStructure' :: Maybe HierarchyLevel
levelTwo = Maybe HierarchyLevel
forall a. Maybe a
Prelude.Nothing,
$sel:levelOne:HierarchyStructure' :: Maybe HierarchyLevel
levelOne = Maybe HierarchyLevel
forall a. Maybe a
Prelude.Nothing
}
hierarchyStructure_levelFive :: Lens.Lens' HierarchyStructure (Prelude.Maybe HierarchyLevel)
hierarchyStructure_levelFive :: (Maybe HierarchyLevel -> f (Maybe HierarchyLevel))
-> HierarchyStructure -> f HierarchyStructure
hierarchyStructure_levelFive = (HierarchyStructure -> Maybe HierarchyLevel)
-> (HierarchyStructure
-> Maybe HierarchyLevel -> HierarchyStructure)
-> Lens
HierarchyStructure
HierarchyStructure
(Maybe HierarchyLevel)
(Maybe HierarchyLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyStructure' {Maybe HierarchyLevel
levelFive :: Maybe HierarchyLevel
$sel:levelFive:HierarchyStructure' :: HierarchyStructure -> Maybe HierarchyLevel
levelFive} -> Maybe HierarchyLevel
levelFive) (\s :: HierarchyStructure
s@HierarchyStructure' {} Maybe HierarchyLevel
a -> HierarchyStructure
s {$sel:levelFive:HierarchyStructure' :: Maybe HierarchyLevel
levelFive = Maybe HierarchyLevel
a} :: HierarchyStructure)
hierarchyStructure_levelThree :: Lens.Lens' HierarchyStructure (Prelude.Maybe HierarchyLevel)
hierarchyStructure_levelThree :: (Maybe HierarchyLevel -> f (Maybe HierarchyLevel))
-> HierarchyStructure -> f HierarchyStructure
hierarchyStructure_levelThree = (HierarchyStructure -> Maybe HierarchyLevel)
-> (HierarchyStructure
-> Maybe HierarchyLevel -> HierarchyStructure)
-> Lens
HierarchyStructure
HierarchyStructure
(Maybe HierarchyLevel)
(Maybe HierarchyLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyStructure' {Maybe HierarchyLevel
levelThree :: Maybe HierarchyLevel
$sel:levelThree:HierarchyStructure' :: HierarchyStructure -> Maybe HierarchyLevel
levelThree} -> Maybe HierarchyLevel
levelThree) (\s :: HierarchyStructure
s@HierarchyStructure' {} Maybe HierarchyLevel
a -> HierarchyStructure
s {$sel:levelThree:HierarchyStructure' :: Maybe HierarchyLevel
levelThree = Maybe HierarchyLevel
a} :: HierarchyStructure)
hierarchyStructure_levelFour :: Lens.Lens' HierarchyStructure (Prelude.Maybe HierarchyLevel)
hierarchyStructure_levelFour :: (Maybe HierarchyLevel -> f (Maybe HierarchyLevel))
-> HierarchyStructure -> f HierarchyStructure
hierarchyStructure_levelFour = (HierarchyStructure -> Maybe HierarchyLevel)
-> (HierarchyStructure
-> Maybe HierarchyLevel -> HierarchyStructure)
-> Lens
HierarchyStructure
HierarchyStructure
(Maybe HierarchyLevel)
(Maybe HierarchyLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyStructure' {Maybe HierarchyLevel
levelFour :: Maybe HierarchyLevel
$sel:levelFour:HierarchyStructure' :: HierarchyStructure -> Maybe HierarchyLevel
levelFour} -> Maybe HierarchyLevel
levelFour) (\s :: HierarchyStructure
s@HierarchyStructure' {} Maybe HierarchyLevel
a -> HierarchyStructure
s {$sel:levelFour:HierarchyStructure' :: Maybe HierarchyLevel
levelFour = Maybe HierarchyLevel
a} :: HierarchyStructure)
hierarchyStructure_levelTwo :: Lens.Lens' HierarchyStructure (Prelude.Maybe HierarchyLevel)
hierarchyStructure_levelTwo :: (Maybe HierarchyLevel -> f (Maybe HierarchyLevel))
-> HierarchyStructure -> f HierarchyStructure
hierarchyStructure_levelTwo = (HierarchyStructure -> Maybe HierarchyLevel)
-> (HierarchyStructure
-> Maybe HierarchyLevel -> HierarchyStructure)
-> Lens
HierarchyStructure
HierarchyStructure
(Maybe HierarchyLevel)
(Maybe HierarchyLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyStructure' {Maybe HierarchyLevel
levelTwo :: Maybe HierarchyLevel
$sel:levelTwo:HierarchyStructure' :: HierarchyStructure -> Maybe HierarchyLevel
levelTwo} -> Maybe HierarchyLevel
levelTwo) (\s :: HierarchyStructure
s@HierarchyStructure' {} Maybe HierarchyLevel
a -> HierarchyStructure
s {$sel:levelTwo:HierarchyStructure' :: Maybe HierarchyLevel
levelTwo = Maybe HierarchyLevel
a} :: HierarchyStructure)
hierarchyStructure_levelOne :: Lens.Lens' HierarchyStructure (Prelude.Maybe HierarchyLevel)
hierarchyStructure_levelOne :: (Maybe HierarchyLevel -> f (Maybe HierarchyLevel))
-> HierarchyStructure -> f HierarchyStructure
hierarchyStructure_levelOne = (HierarchyStructure -> Maybe HierarchyLevel)
-> (HierarchyStructure
-> Maybe HierarchyLevel -> HierarchyStructure)
-> Lens
HierarchyStructure
HierarchyStructure
(Maybe HierarchyLevel)
(Maybe HierarchyLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyStructure' {Maybe HierarchyLevel
levelOne :: Maybe HierarchyLevel
$sel:levelOne:HierarchyStructure' :: HierarchyStructure -> Maybe HierarchyLevel
levelOne} -> Maybe HierarchyLevel
levelOne) (\s :: HierarchyStructure
s@HierarchyStructure' {} Maybe HierarchyLevel
a -> HierarchyStructure
s {$sel:levelOne:HierarchyStructure' :: Maybe HierarchyLevel
levelOne = Maybe HierarchyLevel
a} :: HierarchyStructure)
instance Core.FromJSON HierarchyStructure where
parseJSON :: Value -> Parser HierarchyStructure
parseJSON =
String
-> (Object -> Parser HierarchyStructure)
-> Value
-> Parser HierarchyStructure
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HierarchyStructure"
( \Object
x ->
Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> HierarchyStructure
HierarchyStructure'
(Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> HierarchyStructure)
-> Parser (Maybe HierarchyLevel)
-> Parser
(Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> HierarchyStructure)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe HierarchyLevel)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LevelFive")
Parser
(Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> HierarchyStructure)
-> Parser (Maybe HierarchyLevel)
-> Parser
(Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> HierarchyStructure)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HierarchyLevel)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LevelThree")
Parser
(Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> Maybe HierarchyLevel
-> HierarchyStructure)
-> Parser (Maybe HierarchyLevel)
-> Parser
(Maybe HierarchyLevel
-> Maybe HierarchyLevel -> HierarchyStructure)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HierarchyLevel)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LevelFour")
Parser
(Maybe HierarchyLevel
-> Maybe HierarchyLevel -> HierarchyStructure)
-> Parser (Maybe HierarchyLevel)
-> Parser (Maybe HierarchyLevel -> HierarchyStructure)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HierarchyLevel)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LevelTwo")
Parser (Maybe HierarchyLevel -> HierarchyStructure)
-> Parser (Maybe HierarchyLevel) -> Parser HierarchyStructure
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HierarchyLevel)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LevelOne")
)
instance Prelude.Hashable HierarchyStructure
instance Prelude.NFData HierarchyStructure