{-# 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.ElastiCache.Types.CacheParameterGroupNameMessage
-- 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.ElastiCache.Types.CacheParameterGroupNameMessage where

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

-- | Represents the output of one of the following operations:
--
-- -   @ModifyCacheParameterGroup@
--
-- -   @ResetCacheParameterGroup@
--
-- /See:/ 'newCacheParameterGroupNameMessage' smart constructor.
data CacheParameterGroupNameMessage = CacheParameterGroupNameMessage'
  { -- | The name of the cache parameter group.
    CacheParameterGroupNameMessage -> Maybe Text
cacheParameterGroupName :: Prelude.Maybe Prelude.Text
  }
  deriving (CacheParameterGroupNameMessage
-> CacheParameterGroupNameMessage -> Bool
(CacheParameterGroupNameMessage
 -> CacheParameterGroupNameMessage -> Bool)
-> (CacheParameterGroupNameMessage
    -> CacheParameterGroupNameMessage -> Bool)
-> Eq CacheParameterGroupNameMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CacheParameterGroupNameMessage
-> CacheParameterGroupNameMessage -> Bool
$c/= :: CacheParameterGroupNameMessage
-> CacheParameterGroupNameMessage -> Bool
== :: CacheParameterGroupNameMessage
-> CacheParameterGroupNameMessage -> Bool
$c== :: CacheParameterGroupNameMessage
-> CacheParameterGroupNameMessage -> Bool
Prelude.Eq, ReadPrec [CacheParameterGroupNameMessage]
ReadPrec CacheParameterGroupNameMessage
Int -> ReadS CacheParameterGroupNameMessage
ReadS [CacheParameterGroupNameMessage]
(Int -> ReadS CacheParameterGroupNameMessage)
-> ReadS [CacheParameterGroupNameMessage]
-> ReadPrec CacheParameterGroupNameMessage
-> ReadPrec [CacheParameterGroupNameMessage]
-> Read CacheParameterGroupNameMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CacheParameterGroupNameMessage]
$creadListPrec :: ReadPrec [CacheParameterGroupNameMessage]
readPrec :: ReadPrec CacheParameterGroupNameMessage
$creadPrec :: ReadPrec CacheParameterGroupNameMessage
readList :: ReadS [CacheParameterGroupNameMessage]
$creadList :: ReadS [CacheParameterGroupNameMessage]
readsPrec :: Int -> ReadS CacheParameterGroupNameMessage
$creadsPrec :: Int -> ReadS CacheParameterGroupNameMessage
Prelude.Read, Int -> CacheParameterGroupNameMessage -> ShowS
[CacheParameterGroupNameMessage] -> ShowS
CacheParameterGroupNameMessage -> String
(Int -> CacheParameterGroupNameMessage -> ShowS)
-> (CacheParameterGroupNameMessage -> String)
-> ([CacheParameterGroupNameMessage] -> ShowS)
-> Show CacheParameterGroupNameMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CacheParameterGroupNameMessage] -> ShowS
$cshowList :: [CacheParameterGroupNameMessage] -> ShowS
show :: CacheParameterGroupNameMessage -> String
$cshow :: CacheParameterGroupNameMessage -> String
showsPrec :: Int -> CacheParameterGroupNameMessage -> ShowS
$cshowsPrec :: Int -> CacheParameterGroupNameMessage -> ShowS
Prelude.Show, (forall x.
 CacheParameterGroupNameMessage
 -> Rep CacheParameterGroupNameMessage x)
-> (forall x.
    Rep CacheParameterGroupNameMessage x
    -> CacheParameterGroupNameMessage)
-> Generic CacheParameterGroupNameMessage
forall x.
Rep CacheParameterGroupNameMessage x
-> CacheParameterGroupNameMessage
forall x.
CacheParameterGroupNameMessage
-> Rep CacheParameterGroupNameMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CacheParameterGroupNameMessage x
-> CacheParameterGroupNameMessage
$cfrom :: forall x.
CacheParameterGroupNameMessage
-> Rep CacheParameterGroupNameMessage x
Prelude.Generic)

-- |
-- Create a value of 'CacheParameterGroupNameMessage' 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:
--
-- 'cacheParameterGroupName', 'cacheParameterGroupNameMessage_cacheParameterGroupName' - The name of the cache parameter group.
newCacheParameterGroupNameMessage ::
  CacheParameterGroupNameMessage
newCacheParameterGroupNameMessage :: CacheParameterGroupNameMessage
newCacheParameterGroupNameMessage =
  CacheParameterGroupNameMessage' :: Maybe Text -> CacheParameterGroupNameMessage
CacheParameterGroupNameMessage'
    { $sel:cacheParameterGroupName:CacheParameterGroupNameMessage' :: Maybe Text
cacheParameterGroupName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the cache parameter group.
cacheParameterGroupNameMessage_cacheParameterGroupName :: Lens.Lens' CacheParameterGroupNameMessage (Prelude.Maybe Prelude.Text)
cacheParameterGroupNameMessage_cacheParameterGroupName :: (Maybe Text -> f (Maybe Text))
-> CacheParameterGroupNameMessage
-> f CacheParameterGroupNameMessage
cacheParameterGroupNameMessage_cacheParameterGroupName = (CacheParameterGroupNameMessage -> Maybe Text)
-> (CacheParameterGroupNameMessage
    -> Maybe Text -> CacheParameterGroupNameMessage)
-> Lens
     CacheParameterGroupNameMessage
     CacheParameterGroupNameMessage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheParameterGroupNameMessage' {Maybe Text
cacheParameterGroupName :: Maybe Text
$sel:cacheParameterGroupName:CacheParameterGroupNameMessage' :: CacheParameterGroupNameMessage -> Maybe Text
cacheParameterGroupName} -> Maybe Text
cacheParameterGroupName) (\s :: CacheParameterGroupNameMessage
s@CacheParameterGroupNameMessage' {} Maybe Text
a -> CacheParameterGroupNameMessage
s {$sel:cacheParameterGroupName:CacheParameterGroupNameMessage' :: Maybe Text
cacheParameterGroupName = Maybe Text
a} :: CacheParameterGroupNameMessage)

instance Core.FromXML CacheParameterGroupNameMessage where
  parseXML :: [Node] -> Either String CacheParameterGroupNameMessage
parseXML [Node]
x =
    Maybe Text -> CacheParameterGroupNameMessage
CacheParameterGroupNameMessage'
      (Maybe Text -> CacheParameterGroupNameMessage)
-> Either String (Maybe Text)
-> Either String CacheParameterGroupNameMessage
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CacheParameterGroupName")

instance
  Prelude.Hashable
    CacheParameterGroupNameMessage

instance
  Prelude.NFData
    CacheParameterGroupNameMessage