{-# 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.Redshift.Types.ClusterParameterGroupNameMessage
-- 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.Redshift.Types.ClusterParameterGroupNameMessage where

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

-- |
--
-- /See:/ 'newClusterParameterGroupNameMessage' smart constructor.
data ClusterParameterGroupNameMessage = ClusterParameterGroupNameMessage'
  { -- | The status of the parameter group. For example, if you made a change to
    -- a parameter group name-value pair, then the change could be pending a
    -- reboot of an associated cluster.
    ClusterParameterGroupNameMessage -> Maybe Text
parameterGroupStatus :: Prelude.Maybe Prelude.Text,
    -- | The name of the cluster parameter group.
    ClusterParameterGroupNameMessage -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text
  }
  deriving (ClusterParameterGroupNameMessage
-> ClusterParameterGroupNameMessage -> Bool
(ClusterParameterGroupNameMessage
 -> ClusterParameterGroupNameMessage -> Bool)
-> (ClusterParameterGroupNameMessage
    -> ClusterParameterGroupNameMessage -> Bool)
-> Eq ClusterParameterGroupNameMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterParameterGroupNameMessage
-> ClusterParameterGroupNameMessage -> Bool
$c/= :: ClusterParameterGroupNameMessage
-> ClusterParameterGroupNameMessage -> Bool
== :: ClusterParameterGroupNameMessage
-> ClusterParameterGroupNameMessage -> Bool
$c== :: ClusterParameterGroupNameMessage
-> ClusterParameterGroupNameMessage -> Bool
Prelude.Eq, ReadPrec [ClusterParameterGroupNameMessage]
ReadPrec ClusterParameterGroupNameMessage
Int -> ReadS ClusterParameterGroupNameMessage
ReadS [ClusterParameterGroupNameMessage]
(Int -> ReadS ClusterParameterGroupNameMessage)
-> ReadS [ClusterParameterGroupNameMessage]
-> ReadPrec ClusterParameterGroupNameMessage
-> ReadPrec [ClusterParameterGroupNameMessage]
-> Read ClusterParameterGroupNameMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterParameterGroupNameMessage]
$creadListPrec :: ReadPrec [ClusterParameterGroupNameMessage]
readPrec :: ReadPrec ClusterParameterGroupNameMessage
$creadPrec :: ReadPrec ClusterParameterGroupNameMessage
readList :: ReadS [ClusterParameterGroupNameMessage]
$creadList :: ReadS [ClusterParameterGroupNameMessage]
readsPrec :: Int -> ReadS ClusterParameterGroupNameMessage
$creadsPrec :: Int -> ReadS ClusterParameterGroupNameMessage
Prelude.Read, Int -> ClusterParameterGroupNameMessage -> ShowS
[ClusterParameterGroupNameMessage] -> ShowS
ClusterParameterGroupNameMessage -> String
(Int -> ClusterParameterGroupNameMessage -> ShowS)
-> (ClusterParameterGroupNameMessage -> String)
-> ([ClusterParameterGroupNameMessage] -> ShowS)
-> Show ClusterParameterGroupNameMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterParameterGroupNameMessage] -> ShowS
$cshowList :: [ClusterParameterGroupNameMessage] -> ShowS
show :: ClusterParameterGroupNameMessage -> String
$cshow :: ClusterParameterGroupNameMessage -> String
showsPrec :: Int -> ClusterParameterGroupNameMessage -> ShowS
$cshowsPrec :: Int -> ClusterParameterGroupNameMessage -> ShowS
Prelude.Show, (forall x.
 ClusterParameterGroupNameMessage
 -> Rep ClusterParameterGroupNameMessage x)
-> (forall x.
    Rep ClusterParameterGroupNameMessage x
    -> ClusterParameterGroupNameMessage)
-> Generic ClusterParameterGroupNameMessage
forall x.
Rep ClusterParameterGroupNameMessage x
-> ClusterParameterGroupNameMessage
forall x.
ClusterParameterGroupNameMessage
-> Rep ClusterParameterGroupNameMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ClusterParameterGroupNameMessage x
-> ClusterParameterGroupNameMessage
$cfrom :: forall x.
ClusterParameterGroupNameMessage
-> Rep ClusterParameterGroupNameMessage x
Prelude.Generic)

-- |
-- Create a value of 'ClusterParameterGroupNameMessage' 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:
--
-- 'parameterGroupStatus', 'clusterParameterGroupNameMessage_parameterGroupStatus' - The status of the parameter group. For example, if you made a change to
-- a parameter group name-value pair, then the change could be pending a
-- reboot of an associated cluster.
--
-- 'parameterGroupName', 'clusterParameterGroupNameMessage_parameterGroupName' - The name of the cluster parameter group.
newClusterParameterGroupNameMessage ::
  ClusterParameterGroupNameMessage
newClusterParameterGroupNameMessage :: ClusterParameterGroupNameMessage
newClusterParameterGroupNameMessage =
  ClusterParameterGroupNameMessage' :: Maybe Text -> Maybe Text -> ClusterParameterGroupNameMessage
ClusterParameterGroupNameMessage'
    { $sel:parameterGroupStatus:ClusterParameterGroupNameMessage' :: Maybe Text
parameterGroupStatus =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupName:ClusterParameterGroupNameMessage' :: Maybe Text
parameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the parameter group. For example, if you made a change to
-- a parameter group name-value pair, then the change could be pending a
-- reboot of an associated cluster.
clusterParameterGroupNameMessage_parameterGroupStatus :: Lens.Lens' ClusterParameterGroupNameMessage (Prelude.Maybe Prelude.Text)
clusterParameterGroupNameMessage_parameterGroupStatus :: (Maybe Text -> f (Maybe Text))
-> ClusterParameterGroupNameMessage
-> f ClusterParameterGroupNameMessage
clusterParameterGroupNameMessage_parameterGroupStatus = (ClusterParameterGroupNameMessage -> Maybe Text)
-> (ClusterParameterGroupNameMessage
    -> Maybe Text -> ClusterParameterGroupNameMessage)
-> Lens
     ClusterParameterGroupNameMessage
     ClusterParameterGroupNameMessage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterParameterGroupNameMessage' {Maybe Text
parameterGroupStatus :: Maybe Text
$sel:parameterGroupStatus:ClusterParameterGroupNameMessage' :: ClusterParameterGroupNameMessage -> Maybe Text
parameterGroupStatus} -> Maybe Text
parameterGroupStatus) (\s :: ClusterParameterGroupNameMessage
s@ClusterParameterGroupNameMessage' {} Maybe Text
a -> ClusterParameterGroupNameMessage
s {$sel:parameterGroupStatus:ClusterParameterGroupNameMessage' :: Maybe Text
parameterGroupStatus = Maybe Text
a} :: ClusterParameterGroupNameMessage)

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

instance
  Core.FromXML
    ClusterParameterGroupNameMessage
  where
  parseXML :: [Node] -> Either String ClusterParameterGroupNameMessage
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> ClusterParameterGroupNameMessage
ClusterParameterGroupNameMessage'
      (Maybe Text -> Maybe Text -> ClusterParameterGroupNameMessage)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> ClusterParameterGroupNameMessage)
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
"ParameterGroupStatus")
      Either String (Maybe Text -> ClusterParameterGroupNameMessage)
-> Either String (Maybe Text)
-> Either String ClusterParameterGroupNameMessage
forall (f :: * -> *) a b. Applicative f => 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
"ParameterGroupName")

instance
  Prelude.Hashable
    ClusterParameterGroupNameMessage

instance
  Prelude.NFData
    ClusterParameterGroupNameMessage