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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about the hierarchy level to update.
--
-- /See:/ 'newHierarchyLevelUpdate' smart constructor.
data HierarchyLevelUpdate = HierarchyLevelUpdate'
  { -- | The name of the user hierarchy level. Must not be more than 50
    -- characters.
    HierarchyLevelUpdate -> Text
name :: Prelude.Text
  }
  deriving (HierarchyLevelUpdate -> HierarchyLevelUpdate -> Bool
(HierarchyLevelUpdate -> HierarchyLevelUpdate -> Bool)
-> (HierarchyLevelUpdate -> HierarchyLevelUpdate -> Bool)
-> Eq HierarchyLevelUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HierarchyLevelUpdate -> HierarchyLevelUpdate -> Bool
$c/= :: HierarchyLevelUpdate -> HierarchyLevelUpdate -> Bool
== :: HierarchyLevelUpdate -> HierarchyLevelUpdate -> Bool
$c== :: HierarchyLevelUpdate -> HierarchyLevelUpdate -> Bool
Prelude.Eq, ReadPrec [HierarchyLevelUpdate]
ReadPrec HierarchyLevelUpdate
Int -> ReadS HierarchyLevelUpdate
ReadS [HierarchyLevelUpdate]
(Int -> ReadS HierarchyLevelUpdate)
-> ReadS [HierarchyLevelUpdate]
-> ReadPrec HierarchyLevelUpdate
-> ReadPrec [HierarchyLevelUpdate]
-> Read HierarchyLevelUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HierarchyLevelUpdate]
$creadListPrec :: ReadPrec [HierarchyLevelUpdate]
readPrec :: ReadPrec HierarchyLevelUpdate
$creadPrec :: ReadPrec HierarchyLevelUpdate
readList :: ReadS [HierarchyLevelUpdate]
$creadList :: ReadS [HierarchyLevelUpdate]
readsPrec :: Int -> ReadS HierarchyLevelUpdate
$creadsPrec :: Int -> ReadS HierarchyLevelUpdate
Prelude.Read, Int -> HierarchyLevelUpdate -> ShowS
[HierarchyLevelUpdate] -> ShowS
HierarchyLevelUpdate -> String
(Int -> HierarchyLevelUpdate -> ShowS)
-> (HierarchyLevelUpdate -> String)
-> ([HierarchyLevelUpdate] -> ShowS)
-> Show HierarchyLevelUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HierarchyLevelUpdate] -> ShowS
$cshowList :: [HierarchyLevelUpdate] -> ShowS
show :: HierarchyLevelUpdate -> String
$cshow :: HierarchyLevelUpdate -> String
showsPrec :: Int -> HierarchyLevelUpdate -> ShowS
$cshowsPrec :: Int -> HierarchyLevelUpdate -> ShowS
Prelude.Show, (forall x. HierarchyLevelUpdate -> Rep HierarchyLevelUpdate x)
-> (forall x. Rep HierarchyLevelUpdate x -> HierarchyLevelUpdate)
-> Generic HierarchyLevelUpdate
forall x. Rep HierarchyLevelUpdate x -> HierarchyLevelUpdate
forall x. HierarchyLevelUpdate -> Rep HierarchyLevelUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HierarchyLevelUpdate x -> HierarchyLevelUpdate
$cfrom :: forall x. HierarchyLevelUpdate -> Rep HierarchyLevelUpdate x
Prelude.Generic)

-- |
-- Create a value of 'HierarchyLevelUpdate' 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:
--
-- 'name', 'hierarchyLevelUpdate_name' - The name of the user hierarchy level. Must not be more than 50
-- characters.
newHierarchyLevelUpdate ::
  -- | 'name'
  Prelude.Text ->
  HierarchyLevelUpdate
newHierarchyLevelUpdate :: Text -> HierarchyLevelUpdate
newHierarchyLevelUpdate Text
pName_ =
  HierarchyLevelUpdate' :: Text -> HierarchyLevelUpdate
HierarchyLevelUpdate' {$sel:name:HierarchyLevelUpdate' :: Text
name = Text
pName_}

-- | The name of the user hierarchy level. Must not be more than 50
-- characters.
hierarchyLevelUpdate_name :: Lens.Lens' HierarchyLevelUpdate Prelude.Text
hierarchyLevelUpdate_name :: (Text -> f Text) -> HierarchyLevelUpdate -> f HierarchyLevelUpdate
hierarchyLevelUpdate_name = (HierarchyLevelUpdate -> Text)
-> (HierarchyLevelUpdate -> Text -> HierarchyLevelUpdate)
-> Lens HierarchyLevelUpdate HierarchyLevelUpdate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HierarchyLevelUpdate' {Text
name :: Text
$sel:name:HierarchyLevelUpdate' :: HierarchyLevelUpdate -> Text
name} -> Text
name) (\s :: HierarchyLevelUpdate
s@HierarchyLevelUpdate' {} Text
a -> HierarchyLevelUpdate
s {$sel:name:HierarchyLevelUpdate' :: Text
name = Text
a} :: HierarchyLevelUpdate)

instance Prelude.Hashable HierarchyLevelUpdate

instance Prelude.NFData HierarchyLevelUpdate

instance Core.ToJSON HierarchyLevelUpdate where
  toJSON :: HierarchyLevelUpdate -> Value
toJSON HierarchyLevelUpdate' {Text
name :: Text
$sel:name:HierarchyLevelUpdate' :: HierarchyLevelUpdate -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
      )