{-# 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.HierarchyGroup where
import Amazonka.Connect.Types.HierarchyPath
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HierarchyGroup = HierarchyGroup'
{
HierarchyGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
HierarchyGroup -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
HierarchyGroup -> Maybe HierarchyPath
hierarchyPath :: Prelude.Maybe HierarchyPath,
HierarchyGroup -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
HierarchyGroup -> Maybe Text
levelId :: Prelude.Maybe Prelude.Text
}
deriving (HierarchyGroup -> HierarchyGroup -> Bool
(HierarchyGroup -> HierarchyGroup -> Bool)
-> (HierarchyGroup -> HierarchyGroup -> Bool) -> Eq HierarchyGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HierarchyGroup -> HierarchyGroup -> Bool
$c/= :: HierarchyGroup -> HierarchyGroup -> Bool
== :: HierarchyGroup -> HierarchyGroup -> Bool
$c== :: HierarchyGroup -> HierarchyGroup -> Bool
Prelude.Eq, ReadPrec [HierarchyGroup]
ReadPrec HierarchyGroup
Int -> ReadS HierarchyGroup
ReadS [HierarchyGroup]
(Int -> ReadS HierarchyGroup)
-> ReadS [HierarchyGroup]
-> ReadPrec HierarchyGroup
-> ReadPrec [HierarchyGroup]
-> Read HierarchyGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HierarchyGroup]
$creadListPrec :: ReadPrec [HierarchyGroup]
readPrec :: ReadPrec HierarchyGroup
$creadPrec :: ReadPrec HierarchyGroup
readList :: ReadS [HierarchyGroup]
$creadList :: ReadS [HierarchyGroup]
readsPrec :: Int -> ReadS HierarchyGroup
$creadsPrec :: Int -> ReadS HierarchyGroup
Prelude.Read, Int -> HierarchyGroup -> ShowS
[HierarchyGroup] -> ShowS
HierarchyGroup -> String
(Int -> HierarchyGroup -> ShowS)
-> (HierarchyGroup -> String)
-> ([HierarchyGroup] -> ShowS)
-> Show HierarchyGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HierarchyGroup] -> ShowS
$cshowList :: [HierarchyGroup] -> ShowS
show :: HierarchyGroup -> String
$cshow :: HierarchyGroup -> String
showsPrec :: Int -> HierarchyGroup -> ShowS
$cshowsPrec :: Int -> HierarchyGroup -> ShowS
Prelude.Show, (forall x. HierarchyGroup -> Rep HierarchyGroup x)
-> (forall x. Rep HierarchyGroup x -> HierarchyGroup)
-> Generic HierarchyGroup
forall x. Rep HierarchyGroup x -> HierarchyGroup
forall x. HierarchyGroup -> Rep HierarchyGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HierarchyGroup x -> HierarchyGroup
$cfrom :: forall x. HierarchyGroup -> Rep HierarchyGroup x
Prelude.Generic)
newHierarchyGroup ::
HierarchyGroup
newHierarchyGroup :: HierarchyGroup
newHierarchyGroup =
HierarchyGroup' :: Maybe Text
-> Maybe Text
-> Maybe HierarchyPath
-> Maybe Text
-> Maybe Text
-> HierarchyGroup
HierarchyGroup'
{ $sel:arn:HierarchyGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:HierarchyGroup' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hierarchyPath:HierarchyGroup' :: Maybe HierarchyPath
hierarchyPath = Maybe HierarchyPath
forall a. Maybe a
Prelude.Nothing,
$sel:id:HierarchyGroup' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:levelId:HierarchyGroup' :: Maybe Text
levelId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
hierarchyGroup_arn :: Lens.Lens' HierarchyGroup (Prelude.Maybe Prelude.Text)
hierarchyGroup_arn :: (Maybe Text -> f (Maybe Text))
-> HierarchyGroup -> f HierarchyGroup
hierarchyGroup_arn = (HierarchyGroup -> Maybe Text)
-> (HierarchyGroup -> Maybe Text -> HierarchyGroup)
-> Lens HierarchyGroup HierarchyGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:HierarchyGroup' :: HierarchyGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: HierarchyGroup
s@HierarchyGroup' {} Maybe Text
a -> HierarchyGroup
s {$sel:arn:HierarchyGroup' :: Maybe Text
arn = Maybe Text
a} :: HierarchyGroup)
hierarchyGroup_name :: Lens.Lens' HierarchyGroup (Prelude.Maybe Prelude.Text)
hierarchyGroup_name :: (Maybe Text -> f (Maybe Text))
-> HierarchyGroup -> f HierarchyGroup
hierarchyGroup_name = (HierarchyGroup -> Maybe Text)
-> (HierarchyGroup -> Maybe Text -> HierarchyGroup)
-> Lens HierarchyGroup HierarchyGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyGroup' {Maybe Text
name :: Maybe Text
$sel:name:HierarchyGroup' :: HierarchyGroup -> Maybe Text
name} -> Maybe Text
name) (\s :: HierarchyGroup
s@HierarchyGroup' {} Maybe Text
a -> HierarchyGroup
s {$sel:name:HierarchyGroup' :: Maybe Text
name = Maybe Text
a} :: HierarchyGroup)
hierarchyGroup_hierarchyPath :: Lens.Lens' HierarchyGroup (Prelude.Maybe HierarchyPath)
hierarchyGroup_hierarchyPath :: (Maybe HierarchyPath -> f (Maybe HierarchyPath))
-> HierarchyGroup -> f HierarchyGroup
hierarchyGroup_hierarchyPath = (HierarchyGroup -> Maybe HierarchyPath)
-> (HierarchyGroup -> Maybe HierarchyPath -> HierarchyGroup)
-> Lens
HierarchyGroup
HierarchyGroup
(Maybe HierarchyPath)
(Maybe HierarchyPath)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyGroup' {Maybe HierarchyPath
hierarchyPath :: Maybe HierarchyPath
$sel:hierarchyPath:HierarchyGroup' :: HierarchyGroup -> Maybe HierarchyPath
hierarchyPath} -> Maybe HierarchyPath
hierarchyPath) (\s :: HierarchyGroup
s@HierarchyGroup' {} Maybe HierarchyPath
a -> HierarchyGroup
s {$sel:hierarchyPath:HierarchyGroup' :: Maybe HierarchyPath
hierarchyPath = Maybe HierarchyPath
a} :: HierarchyGroup)
hierarchyGroup_id :: Lens.Lens' HierarchyGroup (Prelude.Maybe Prelude.Text)
hierarchyGroup_id :: (Maybe Text -> f (Maybe Text))
-> HierarchyGroup -> f HierarchyGroup
hierarchyGroup_id = (HierarchyGroup -> Maybe Text)
-> (HierarchyGroup -> Maybe Text -> HierarchyGroup)
-> Lens HierarchyGroup HierarchyGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyGroup' {Maybe Text
id :: Maybe Text
$sel:id:HierarchyGroup' :: HierarchyGroup -> Maybe Text
id} -> Maybe Text
id) (\s :: HierarchyGroup
s@HierarchyGroup' {} Maybe Text
a -> HierarchyGroup
s {$sel:id:HierarchyGroup' :: Maybe Text
id = Maybe Text
a} :: HierarchyGroup)
hierarchyGroup_levelId :: Lens.Lens' HierarchyGroup (Prelude.Maybe Prelude.Text)
hierarchyGroup_levelId :: (Maybe Text -> f (Maybe Text))
-> HierarchyGroup -> f HierarchyGroup
hierarchyGroup_levelId = (HierarchyGroup -> Maybe Text)
-> (HierarchyGroup -> Maybe Text -> HierarchyGroup)
-> Lens HierarchyGroup HierarchyGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyGroup' {Maybe Text
levelId :: Maybe Text
$sel:levelId:HierarchyGroup' :: HierarchyGroup -> Maybe Text
levelId} -> Maybe Text
levelId) (\s :: HierarchyGroup
s@HierarchyGroup' {} Maybe Text
a -> HierarchyGroup
s {$sel:levelId:HierarchyGroup' :: Maybe Text
levelId = Maybe Text
a} :: HierarchyGroup)
instance Core.FromJSON HierarchyGroup where
parseJSON :: Value -> Parser HierarchyGroup
parseJSON =
String
-> (Object -> Parser HierarchyGroup)
-> Value
-> Parser HierarchyGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HierarchyGroup"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe HierarchyPath
-> Maybe Text
-> Maybe Text
-> HierarchyGroup
HierarchyGroup'
(Maybe Text
-> Maybe Text
-> Maybe HierarchyPath
-> Maybe Text
-> Maybe Text
-> HierarchyGroup)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe HierarchyPath
-> Maybe Text
-> Maybe Text
-> HierarchyGroup)
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 HierarchyPath
-> Maybe Text
-> Maybe Text
-> HierarchyGroup)
-> Parser (Maybe Text)
-> Parser
(Maybe HierarchyPath -> Maybe Text -> Maybe Text -> HierarchyGroup)
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 HierarchyPath -> Maybe Text -> Maybe Text -> HierarchyGroup)
-> Parser (Maybe HierarchyPath)
-> Parser (Maybe Text -> Maybe Text -> HierarchyGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HierarchyPath)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HierarchyPath")
Parser (Maybe Text -> Maybe Text -> HierarchyGroup)
-> Parser (Maybe Text) -> Parser (Maybe Text -> HierarchyGroup)
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")
Parser (Maybe Text -> HierarchyGroup)
-> Parser (Maybe Text) -> Parser HierarchyGroup
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
"LevelId")
)
instance Prelude.Hashable HierarchyGroup
instance Prelude.NFData HierarchyGroup