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

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

-- | Describes the status of a parameter group.
--
-- /See:/ 'newClusterParameterGroupStatus' smart constructor.
data ClusterParameterGroupStatus = ClusterParameterGroupStatus'
  { -- | The list of parameter statuses.
    --
    -- For more information about parameters and parameter groups, go to
    -- <https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html Amazon Redshift Parameter Groups>
    -- in the /Amazon Redshift Cluster Management Guide/.
    ClusterParameterGroupStatus -> Maybe [ClusterParameterStatus]
clusterParameterStatusList :: Prelude.Maybe [ClusterParameterStatus],
    -- | The status of parameter updates.
    ClusterParameterGroupStatus -> Maybe Text
parameterApplyStatus :: Prelude.Maybe Prelude.Text,
    -- | The name of the cluster parameter group.
    ClusterParameterGroupStatus -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text
  }
  deriving (ClusterParameterGroupStatus -> ClusterParameterGroupStatus -> Bool
(ClusterParameterGroupStatus
 -> ClusterParameterGroupStatus -> Bool)
-> (ClusterParameterGroupStatus
    -> ClusterParameterGroupStatus -> Bool)
-> Eq ClusterParameterGroupStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterParameterGroupStatus -> ClusterParameterGroupStatus -> Bool
$c/= :: ClusterParameterGroupStatus -> ClusterParameterGroupStatus -> Bool
== :: ClusterParameterGroupStatus -> ClusterParameterGroupStatus -> Bool
$c== :: ClusterParameterGroupStatus -> ClusterParameterGroupStatus -> Bool
Prelude.Eq, ReadPrec [ClusterParameterGroupStatus]
ReadPrec ClusterParameterGroupStatus
Int -> ReadS ClusterParameterGroupStatus
ReadS [ClusterParameterGroupStatus]
(Int -> ReadS ClusterParameterGroupStatus)
-> ReadS [ClusterParameterGroupStatus]
-> ReadPrec ClusterParameterGroupStatus
-> ReadPrec [ClusterParameterGroupStatus]
-> Read ClusterParameterGroupStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterParameterGroupStatus]
$creadListPrec :: ReadPrec [ClusterParameterGroupStatus]
readPrec :: ReadPrec ClusterParameterGroupStatus
$creadPrec :: ReadPrec ClusterParameterGroupStatus
readList :: ReadS [ClusterParameterGroupStatus]
$creadList :: ReadS [ClusterParameterGroupStatus]
readsPrec :: Int -> ReadS ClusterParameterGroupStatus
$creadsPrec :: Int -> ReadS ClusterParameterGroupStatus
Prelude.Read, Int -> ClusterParameterGroupStatus -> ShowS
[ClusterParameterGroupStatus] -> ShowS
ClusterParameterGroupStatus -> String
(Int -> ClusterParameterGroupStatus -> ShowS)
-> (ClusterParameterGroupStatus -> String)
-> ([ClusterParameterGroupStatus] -> ShowS)
-> Show ClusterParameterGroupStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterParameterGroupStatus] -> ShowS
$cshowList :: [ClusterParameterGroupStatus] -> ShowS
show :: ClusterParameterGroupStatus -> String
$cshow :: ClusterParameterGroupStatus -> String
showsPrec :: Int -> ClusterParameterGroupStatus -> ShowS
$cshowsPrec :: Int -> ClusterParameterGroupStatus -> ShowS
Prelude.Show, (forall x.
 ClusterParameterGroupStatus -> Rep ClusterParameterGroupStatus x)
-> (forall x.
    Rep ClusterParameterGroupStatus x -> ClusterParameterGroupStatus)
-> Generic ClusterParameterGroupStatus
forall x.
Rep ClusterParameterGroupStatus x -> ClusterParameterGroupStatus
forall x.
ClusterParameterGroupStatus -> Rep ClusterParameterGroupStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ClusterParameterGroupStatus x -> ClusterParameterGroupStatus
$cfrom :: forall x.
ClusterParameterGroupStatus -> Rep ClusterParameterGroupStatus x
Prelude.Generic)

-- |
-- Create a value of 'ClusterParameterGroupStatus' 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:
--
-- 'clusterParameterStatusList', 'clusterParameterGroupStatus_clusterParameterStatusList' - The list of parameter statuses.
--
-- For more information about parameters and parameter groups, go to
-- <https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html Amazon Redshift Parameter Groups>
-- in the /Amazon Redshift Cluster Management Guide/.
--
-- 'parameterApplyStatus', 'clusterParameterGroupStatus_parameterApplyStatus' - The status of parameter updates.
--
-- 'parameterGroupName', 'clusterParameterGroupStatus_parameterGroupName' - The name of the cluster parameter group.
newClusterParameterGroupStatus ::
  ClusterParameterGroupStatus
newClusterParameterGroupStatus :: ClusterParameterGroupStatus
newClusterParameterGroupStatus =
  ClusterParameterGroupStatus' :: Maybe [ClusterParameterStatus]
-> Maybe Text -> Maybe Text -> ClusterParameterGroupStatus
ClusterParameterGroupStatus'
    { $sel:clusterParameterStatusList:ClusterParameterGroupStatus' :: Maybe [ClusterParameterStatus]
clusterParameterStatusList =
        Maybe [ClusterParameterStatus]
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterApplyStatus:ClusterParameterGroupStatus' :: Maybe Text
parameterApplyStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupName:ClusterParameterGroupStatus' :: Maybe Text
parameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The list of parameter statuses.
--
-- For more information about parameters and parameter groups, go to
-- <https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html Amazon Redshift Parameter Groups>
-- in the /Amazon Redshift Cluster Management Guide/.
clusterParameterGroupStatus_clusterParameterStatusList :: Lens.Lens' ClusterParameterGroupStatus (Prelude.Maybe [ClusterParameterStatus])
clusterParameterGroupStatus_clusterParameterStatusList :: (Maybe [ClusterParameterStatus]
 -> f (Maybe [ClusterParameterStatus]))
-> ClusterParameterGroupStatus -> f ClusterParameterGroupStatus
clusterParameterGroupStatus_clusterParameterStatusList = (ClusterParameterGroupStatus -> Maybe [ClusterParameterStatus])
-> (ClusterParameterGroupStatus
    -> Maybe [ClusterParameterStatus] -> ClusterParameterGroupStatus)
-> Lens
     ClusterParameterGroupStatus
     ClusterParameterGroupStatus
     (Maybe [ClusterParameterStatus])
     (Maybe [ClusterParameterStatus])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterParameterGroupStatus' {Maybe [ClusterParameterStatus]
clusterParameterStatusList :: Maybe [ClusterParameterStatus]
$sel:clusterParameterStatusList:ClusterParameterGroupStatus' :: ClusterParameterGroupStatus -> Maybe [ClusterParameterStatus]
clusterParameterStatusList} -> Maybe [ClusterParameterStatus]
clusterParameterStatusList) (\s :: ClusterParameterGroupStatus
s@ClusterParameterGroupStatus' {} Maybe [ClusterParameterStatus]
a -> ClusterParameterGroupStatus
s {$sel:clusterParameterStatusList:ClusterParameterGroupStatus' :: Maybe [ClusterParameterStatus]
clusterParameterStatusList = Maybe [ClusterParameterStatus]
a} :: ClusterParameterGroupStatus) ((Maybe [ClusterParameterStatus]
  -> f (Maybe [ClusterParameterStatus]))
 -> ClusterParameterGroupStatus -> f ClusterParameterGroupStatus)
-> ((Maybe [ClusterParameterStatus]
     -> f (Maybe [ClusterParameterStatus]))
    -> Maybe [ClusterParameterStatus]
    -> f (Maybe [ClusterParameterStatus]))
-> (Maybe [ClusterParameterStatus]
    -> f (Maybe [ClusterParameterStatus]))
-> ClusterParameterGroupStatus
-> f ClusterParameterGroupStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ClusterParameterStatus]
  [ClusterParameterStatus]
  [ClusterParameterStatus]
  [ClusterParameterStatus]
-> Iso
     (Maybe [ClusterParameterStatus])
     (Maybe [ClusterParameterStatus])
     (Maybe [ClusterParameterStatus])
     (Maybe [ClusterParameterStatus])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ClusterParameterStatus]
  [ClusterParameterStatus]
  [ClusterParameterStatus]
  [ClusterParameterStatus]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The status of parameter updates.
clusterParameterGroupStatus_parameterApplyStatus :: Lens.Lens' ClusterParameterGroupStatus (Prelude.Maybe Prelude.Text)
clusterParameterGroupStatus_parameterApplyStatus :: (Maybe Text -> f (Maybe Text))
-> ClusterParameterGroupStatus -> f ClusterParameterGroupStatus
clusterParameterGroupStatus_parameterApplyStatus = (ClusterParameterGroupStatus -> Maybe Text)
-> (ClusterParameterGroupStatus
    -> Maybe Text -> ClusterParameterGroupStatus)
-> Lens
     ClusterParameterGroupStatus
     ClusterParameterGroupStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterParameterGroupStatus' {Maybe Text
parameterApplyStatus :: Maybe Text
$sel:parameterApplyStatus:ClusterParameterGroupStatus' :: ClusterParameterGroupStatus -> Maybe Text
parameterApplyStatus} -> Maybe Text
parameterApplyStatus) (\s :: ClusterParameterGroupStatus
s@ClusterParameterGroupStatus' {} Maybe Text
a -> ClusterParameterGroupStatus
s {$sel:parameterApplyStatus:ClusterParameterGroupStatus' :: Maybe Text
parameterApplyStatus = Maybe Text
a} :: ClusterParameterGroupStatus)

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

instance Core.FromXML ClusterParameterGroupStatus where
  parseXML :: [Node] -> Either String ClusterParameterGroupStatus
parseXML [Node]
x =
    Maybe [ClusterParameterStatus]
-> Maybe Text -> Maybe Text -> ClusterParameterGroupStatus
ClusterParameterGroupStatus'
      (Maybe [ClusterParameterStatus]
 -> Maybe Text -> Maybe Text -> ClusterParameterGroupStatus)
-> Either String (Maybe [ClusterParameterStatus])
-> Either
     String (Maybe Text -> Maybe Text -> ClusterParameterGroupStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ClusterParameterStatusList"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [ClusterParameterStatus]))
-> Either String (Maybe [ClusterParameterStatus])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ClusterParameterStatus])
-> [Node] -> Either String (Maybe [ClusterParameterStatus])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ClusterParameterStatus]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String (Maybe Text -> Maybe Text -> ClusterParameterGroupStatus)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> ClusterParameterGroupStatus)
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
"ParameterApplyStatus")
      Either String (Maybe Text -> ClusterParameterGroupStatus)
-> Either String (Maybe Text)
-> Either String ClusterParameterGroupStatus
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 ClusterParameterGroupStatus

instance Prelude.NFData ClusterParameterGroupStatus