{-# 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.SecurityHub.Types.AwsRedshiftClusterClusterParameterGroup
-- 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.SecurityHub.Types.AwsRedshiftClusterClusterParameterGroup where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsRedshiftClusterClusterParameterStatus

-- | A cluster parameter group that is associated with an Amazon Redshift
-- cluster.
--
-- /See:/ 'newAwsRedshiftClusterClusterParameterGroup' smart constructor.
data AwsRedshiftClusterClusterParameterGroup = AwsRedshiftClusterClusterParameterGroup'
  { -- | The list of parameter statuses.
    AwsRedshiftClusterClusterParameterGroup
-> Maybe [AwsRedshiftClusterClusterParameterStatus]
clusterParameterStatusList :: Prelude.Maybe [AwsRedshiftClusterClusterParameterStatus],
    -- | The status of updates to the parameters.
    AwsRedshiftClusterClusterParameterGroup -> Maybe Text
parameterApplyStatus :: Prelude.Maybe Prelude.Text,
    -- | The name of the parameter group.
    AwsRedshiftClusterClusterParameterGroup -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsRedshiftClusterClusterParameterGroup
-> AwsRedshiftClusterClusterParameterGroup -> Bool
(AwsRedshiftClusterClusterParameterGroup
 -> AwsRedshiftClusterClusterParameterGroup -> Bool)
-> (AwsRedshiftClusterClusterParameterGroup
    -> AwsRedshiftClusterClusterParameterGroup -> Bool)
-> Eq AwsRedshiftClusterClusterParameterGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRedshiftClusterClusterParameterGroup
-> AwsRedshiftClusterClusterParameterGroup -> Bool
$c/= :: AwsRedshiftClusterClusterParameterGroup
-> AwsRedshiftClusterClusterParameterGroup -> Bool
== :: AwsRedshiftClusterClusterParameterGroup
-> AwsRedshiftClusterClusterParameterGroup -> Bool
$c== :: AwsRedshiftClusterClusterParameterGroup
-> AwsRedshiftClusterClusterParameterGroup -> Bool
Prelude.Eq, ReadPrec [AwsRedshiftClusterClusterParameterGroup]
ReadPrec AwsRedshiftClusterClusterParameterGroup
Int -> ReadS AwsRedshiftClusterClusterParameterGroup
ReadS [AwsRedshiftClusterClusterParameterGroup]
(Int -> ReadS AwsRedshiftClusterClusterParameterGroup)
-> ReadS [AwsRedshiftClusterClusterParameterGroup]
-> ReadPrec AwsRedshiftClusterClusterParameterGroup
-> ReadPrec [AwsRedshiftClusterClusterParameterGroup]
-> Read AwsRedshiftClusterClusterParameterGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRedshiftClusterClusterParameterGroup]
$creadListPrec :: ReadPrec [AwsRedshiftClusterClusterParameterGroup]
readPrec :: ReadPrec AwsRedshiftClusterClusterParameterGroup
$creadPrec :: ReadPrec AwsRedshiftClusterClusterParameterGroup
readList :: ReadS [AwsRedshiftClusterClusterParameterGroup]
$creadList :: ReadS [AwsRedshiftClusterClusterParameterGroup]
readsPrec :: Int -> ReadS AwsRedshiftClusterClusterParameterGroup
$creadsPrec :: Int -> ReadS AwsRedshiftClusterClusterParameterGroup
Prelude.Read, Int -> AwsRedshiftClusterClusterParameterGroup -> ShowS
[AwsRedshiftClusterClusterParameterGroup] -> ShowS
AwsRedshiftClusterClusterParameterGroup -> String
(Int -> AwsRedshiftClusterClusterParameterGroup -> ShowS)
-> (AwsRedshiftClusterClusterParameterGroup -> String)
-> ([AwsRedshiftClusterClusterParameterGroup] -> ShowS)
-> Show AwsRedshiftClusterClusterParameterGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRedshiftClusterClusterParameterGroup] -> ShowS
$cshowList :: [AwsRedshiftClusterClusterParameterGroup] -> ShowS
show :: AwsRedshiftClusterClusterParameterGroup -> String
$cshow :: AwsRedshiftClusterClusterParameterGroup -> String
showsPrec :: Int -> AwsRedshiftClusterClusterParameterGroup -> ShowS
$cshowsPrec :: Int -> AwsRedshiftClusterClusterParameterGroup -> ShowS
Prelude.Show, (forall x.
 AwsRedshiftClusterClusterParameterGroup
 -> Rep AwsRedshiftClusterClusterParameterGroup x)
-> (forall x.
    Rep AwsRedshiftClusterClusterParameterGroup x
    -> AwsRedshiftClusterClusterParameterGroup)
-> Generic AwsRedshiftClusterClusterParameterGroup
forall x.
Rep AwsRedshiftClusterClusterParameterGroup x
-> AwsRedshiftClusterClusterParameterGroup
forall x.
AwsRedshiftClusterClusterParameterGroup
-> Rep AwsRedshiftClusterClusterParameterGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsRedshiftClusterClusterParameterGroup x
-> AwsRedshiftClusterClusterParameterGroup
$cfrom :: forall x.
AwsRedshiftClusterClusterParameterGroup
-> Rep AwsRedshiftClusterClusterParameterGroup x
Prelude.Generic)

-- |
-- Create a value of 'AwsRedshiftClusterClusterParameterGroup' 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', 'awsRedshiftClusterClusterParameterGroup_clusterParameterStatusList' - The list of parameter statuses.
--
-- 'parameterApplyStatus', 'awsRedshiftClusterClusterParameterGroup_parameterApplyStatus' - The status of updates to the parameters.
--
-- 'parameterGroupName', 'awsRedshiftClusterClusterParameterGroup_parameterGroupName' - The name of the parameter group.
newAwsRedshiftClusterClusterParameterGroup ::
  AwsRedshiftClusterClusterParameterGroup
newAwsRedshiftClusterClusterParameterGroup :: AwsRedshiftClusterClusterParameterGroup
newAwsRedshiftClusterClusterParameterGroup =
  AwsRedshiftClusterClusterParameterGroup' :: Maybe [AwsRedshiftClusterClusterParameterStatus]
-> Maybe Text
-> Maybe Text
-> AwsRedshiftClusterClusterParameterGroup
AwsRedshiftClusterClusterParameterGroup'
    { $sel:clusterParameterStatusList:AwsRedshiftClusterClusterParameterGroup' :: Maybe [AwsRedshiftClusterClusterParameterStatus]
clusterParameterStatusList =
        Maybe [AwsRedshiftClusterClusterParameterStatus]
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterApplyStatus:AwsRedshiftClusterClusterParameterGroup' :: Maybe Text
parameterApplyStatus =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupName:AwsRedshiftClusterClusterParameterGroup' :: Maybe Text
parameterGroupName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The list of parameter statuses.
awsRedshiftClusterClusterParameterGroup_clusterParameterStatusList :: Lens.Lens' AwsRedshiftClusterClusterParameterGroup (Prelude.Maybe [AwsRedshiftClusterClusterParameterStatus])
awsRedshiftClusterClusterParameterGroup_clusterParameterStatusList :: (Maybe [AwsRedshiftClusterClusterParameterStatus]
 -> f (Maybe [AwsRedshiftClusterClusterParameterStatus]))
-> AwsRedshiftClusterClusterParameterGroup
-> f AwsRedshiftClusterClusterParameterGroup
awsRedshiftClusterClusterParameterGroup_clusterParameterStatusList = (AwsRedshiftClusterClusterParameterGroup
 -> Maybe [AwsRedshiftClusterClusterParameterStatus])
-> (AwsRedshiftClusterClusterParameterGroup
    -> Maybe [AwsRedshiftClusterClusterParameterStatus]
    -> AwsRedshiftClusterClusterParameterGroup)
-> Lens
     AwsRedshiftClusterClusterParameterGroup
     AwsRedshiftClusterClusterParameterGroup
     (Maybe [AwsRedshiftClusterClusterParameterStatus])
     (Maybe [AwsRedshiftClusterClusterParameterStatus])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterClusterParameterGroup' {Maybe [AwsRedshiftClusterClusterParameterStatus]
clusterParameterStatusList :: Maybe [AwsRedshiftClusterClusterParameterStatus]
$sel:clusterParameterStatusList:AwsRedshiftClusterClusterParameterGroup' :: AwsRedshiftClusterClusterParameterGroup
-> Maybe [AwsRedshiftClusterClusterParameterStatus]
clusterParameterStatusList} -> Maybe [AwsRedshiftClusterClusterParameterStatus]
clusterParameterStatusList) (\s :: AwsRedshiftClusterClusterParameterGroup
s@AwsRedshiftClusterClusterParameterGroup' {} Maybe [AwsRedshiftClusterClusterParameterStatus]
a -> AwsRedshiftClusterClusterParameterGroup
s {$sel:clusterParameterStatusList:AwsRedshiftClusterClusterParameterGroup' :: Maybe [AwsRedshiftClusterClusterParameterStatus]
clusterParameterStatusList = Maybe [AwsRedshiftClusterClusterParameterStatus]
a} :: AwsRedshiftClusterClusterParameterGroup) ((Maybe [AwsRedshiftClusterClusterParameterStatus]
  -> f (Maybe [AwsRedshiftClusterClusterParameterStatus]))
 -> AwsRedshiftClusterClusterParameterGroup
 -> f AwsRedshiftClusterClusterParameterGroup)
-> ((Maybe [AwsRedshiftClusterClusterParameterStatus]
     -> f (Maybe [AwsRedshiftClusterClusterParameterStatus]))
    -> Maybe [AwsRedshiftClusterClusterParameterStatus]
    -> f (Maybe [AwsRedshiftClusterClusterParameterStatus]))
-> (Maybe [AwsRedshiftClusterClusterParameterStatus]
    -> f (Maybe [AwsRedshiftClusterClusterParameterStatus]))
-> AwsRedshiftClusterClusterParameterGroup
-> f AwsRedshiftClusterClusterParameterGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AwsRedshiftClusterClusterParameterStatus]
  [AwsRedshiftClusterClusterParameterStatus]
  [AwsRedshiftClusterClusterParameterStatus]
  [AwsRedshiftClusterClusterParameterStatus]
-> Iso
     (Maybe [AwsRedshiftClusterClusterParameterStatus])
     (Maybe [AwsRedshiftClusterClusterParameterStatus])
     (Maybe [AwsRedshiftClusterClusterParameterStatus])
     (Maybe [AwsRedshiftClusterClusterParameterStatus])
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
  [AwsRedshiftClusterClusterParameterStatus]
  [AwsRedshiftClusterClusterParameterStatus]
  [AwsRedshiftClusterClusterParameterStatus]
  [AwsRedshiftClusterClusterParameterStatus]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The status of updates to the parameters.
awsRedshiftClusterClusterParameterGroup_parameterApplyStatus :: Lens.Lens' AwsRedshiftClusterClusterParameterGroup (Prelude.Maybe Prelude.Text)
awsRedshiftClusterClusterParameterGroup_parameterApplyStatus :: (Maybe Text -> f (Maybe Text))
-> AwsRedshiftClusterClusterParameterGroup
-> f AwsRedshiftClusterClusterParameterGroup
awsRedshiftClusterClusterParameterGroup_parameterApplyStatus = (AwsRedshiftClusterClusterParameterGroup -> Maybe Text)
-> (AwsRedshiftClusterClusterParameterGroup
    -> Maybe Text -> AwsRedshiftClusterClusterParameterGroup)
-> Lens
     AwsRedshiftClusterClusterParameterGroup
     AwsRedshiftClusterClusterParameterGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterClusterParameterGroup' {Maybe Text
parameterApplyStatus :: Maybe Text
$sel:parameterApplyStatus:AwsRedshiftClusterClusterParameterGroup' :: AwsRedshiftClusterClusterParameterGroup -> Maybe Text
parameterApplyStatus} -> Maybe Text
parameterApplyStatus) (\s :: AwsRedshiftClusterClusterParameterGroup
s@AwsRedshiftClusterClusterParameterGroup' {} Maybe Text
a -> AwsRedshiftClusterClusterParameterGroup
s {$sel:parameterApplyStatus:AwsRedshiftClusterClusterParameterGroup' :: Maybe Text
parameterApplyStatus = Maybe Text
a} :: AwsRedshiftClusterClusterParameterGroup)

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

instance
  Core.FromJSON
    AwsRedshiftClusterClusterParameterGroup
  where
  parseJSON :: Value -> Parser AwsRedshiftClusterClusterParameterGroup
parseJSON =
    String
-> (Object -> Parser AwsRedshiftClusterClusterParameterGroup)
-> Value
-> Parser AwsRedshiftClusterClusterParameterGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRedshiftClusterClusterParameterGroup"
      ( \Object
x ->
          Maybe [AwsRedshiftClusterClusterParameterStatus]
-> Maybe Text
-> Maybe Text
-> AwsRedshiftClusterClusterParameterGroup
AwsRedshiftClusterClusterParameterGroup'
            (Maybe [AwsRedshiftClusterClusterParameterStatus]
 -> Maybe Text
 -> Maybe Text
 -> AwsRedshiftClusterClusterParameterGroup)
-> Parser (Maybe [AwsRedshiftClusterClusterParameterStatus])
-> Parser
     (Maybe Text
      -> Maybe Text -> AwsRedshiftClusterClusterParameterGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Parser
     (Maybe (Maybe [AwsRedshiftClusterClusterParameterStatus]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClusterParameterStatusList"
                            Parser (Maybe (Maybe [AwsRedshiftClusterClusterParameterStatus]))
-> Maybe [AwsRedshiftClusterClusterParameterStatus]
-> Parser (Maybe [AwsRedshiftClusterClusterParameterStatus])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsRedshiftClusterClusterParameterStatus]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text -> AwsRedshiftClusterClusterParameterGroup)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsRedshiftClusterClusterParameterGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ParameterApplyStatus")
            Parser (Maybe Text -> AwsRedshiftClusterClusterParameterGroup)
-> Parser (Maybe Text)
-> Parser AwsRedshiftClusterClusterParameterGroup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ParameterGroupName")
      )

instance
  Prelude.Hashable
    AwsRedshiftClusterClusterParameterGroup

instance
  Prelude.NFData
    AwsRedshiftClusterClusterParameterGroup

instance
  Core.ToJSON
    AwsRedshiftClusterClusterParameterGroup
  where
  toJSON :: AwsRedshiftClusterClusterParameterGroup -> Value
toJSON AwsRedshiftClusterClusterParameterGroup' {Maybe [AwsRedshiftClusterClusterParameterStatus]
Maybe Text
parameterGroupName :: Maybe Text
parameterApplyStatus :: Maybe Text
clusterParameterStatusList :: Maybe [AwsRedshiftClusterClusterParameterStatus]
$sel:parameterGroupName:AwsRedshiftClusterClusterParameterGroup' :: AwsRedshiftClusterClusterParameterGroup -> Maybe Text
$sel:parameterApplyStatus:AwsRedshiftClusterClusterParameterGroup' :: AwsRedshiftClusterClusterParameterGroup -> Maybe Text
$sel:clusterParameterStatusList:AwsRedshiftClusterClusterParameterGroup' :: AwsRedshiftClusterClusterParameterGroup
-> Maybe [AwsRedshiftClusterClusterParameterStatus]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ClusterParameterStatusList" Text -> [AwsRedshiftClusterClusterParameterStatus] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AwsRedshiftClusterClusterParameterStatus] -> Pair)
-> Maybe [AwsRedshiftClusterClusterParameterStatus] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsRedshiftClusterClusterParameterStatus]
clusterParameterStatusList,
            (Text
"ParameterApplyStatus" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterApplyStatus,
            (Text
"ParameterGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterGroupName
          ]
      )