{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Redshift.Types.ClusterParameterGroupNameMessage where

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

-- |
--
-- /See:/ 'newClusterParameterGroupNameMessage' smart constructor.
data ClusterParameterGroupNameMessage = ClusterParameterGroupNameMessage'
  { -- | The name of the cluster parameter group.
    ClusterParameterGroupNameMessage -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | 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
  }
  deriving (ClusterParameterGroupNameMessage
-> ClusterParameterGroupNameMessage -> Bool
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]
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
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.
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:
--
-- 'parameterGroupName', 'clusterParameterGroupNameMessage_parameterGroupName' - The name of the cluster parameter group.
--
-- '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.
newClusterParameterGroupNameMessage ::
  ClusterParameterGroupNameMessage
newClusterParameterGroupNameMessage :: ClusterParameterGroupNameMessage
newClusterParameterGroupNameMessage =
  ClusterParameterGroupNameMessage'
    { $sel:parameterGroupName:ClusterParameterGroupNameMessage' :: Maybe Text
parameterGroupName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupStatus:ClusterParameterGroupNameMessage' :: Maybe Text
parameterGroupStatus = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the cluster parameter group.
clusterParameterGroupNameMessage_parameterGroupName :: Lens.Lens' ClusterParameterGroupNameMessage (Prelude.Maybe Prelude.Text)
clusterParameterGroupNameMessage_parameterGroupName :: Lens' ClusterParameterGroupNameMessage (Maybe Text)
clusterParameterGroupNameMessage_parameterGroupName = 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)

-- | 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 :: Lens' ClusterParameterGroupNameMessage (Maybe Text)
clusterParameterGroupNameMessage_parameterGroupStatus = 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)

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

instance
  Prelude.Hashable
    ClusterParameterGroupNameMessage
  where
  hashWithSalt :: Int -> ClusterParameterGroupNameMessage -> Int
hashWithSalt
    Int
_salt
    ClusterParameterGroupNameMessage' {Maybe Text
parameterGroupStatus :: Maybe Text
parameterGroupName :: Maybe Text
$sel:parameterGroupStatus:ClusterParameterGroupNameMessage' :: ClusterParameterGroupNameMessage -> Maybe Text
$sel:parameterGroupName:ClusterParameterGroupNameMessage' :: ClusterParameterGroupNameMessage -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterGroupName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterGroupStatus

instance
  Prelude.NFData
    ClusterParameterGroupNameMessage
  where
  rnf :: ClusterParameterGroupNameMessage -> ()
rnf ClusterParameterGroupNameMessage' {Maybe Text
parameterGroupStatus :: Maybe Text
parameterGroupName :: Maybe Text
$sel:parameterGroupStatus:ClusterParameterGroupNameMessage' :: ClusterParameterGroupNameMessage -> Maybe Text
$sel:parameterGroupName:ClusterParameterGroupNameMessage' :: ClusterParameterGroupNameMessage -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterGroupStatus