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

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

-- | The status of a parameter in a cluster parameter group for an Amazon
-- Redshift cluster.
--
-- /See:/ 'newAwsRedshiftClusterClusterParameterStatus' smart constructor.
data AwsRedshiftClusterClusterParameterStatus = AwsRedshiftClusterClusterParameterStatus'
  { -- | The error that prevented the parameter from being applied to the
    -- database.
    AwsRedshiftClusterClusterParameterStatus -> Maybe Text
parameterApplyErrorDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of the parameter.
    AwsRedshiftClusterClusterParameterStatus -> Maybe Text
parameterName :: Prelude.Maybe Prelude.Text,
    -- | The status of the parameter. Indicates whether the parameter is in sync
    -- with the database, waiting for a cluster reboot, or encountered an error
    -- when it was applied.
    --
    -- Valid values: @in-sync@ | @pending-reboot@ | @applying@ |
    -- @invalid-parameter@ | @apply-deferred@ | @apply-error@ | @unknown-error@
    AwsRedshiftClusterClusterParameterStatus -> Maybe Text
parameterApplyStatus :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsRedshiftClusterClusterParameterStatus
-> AwsRedshiftClusterClusterParameterStatus -> Bool
(AwsRedshiftClusterClusterParameterStatus
 -> AwsRedshiftClusterClusterParameterStatus -> Bool)
-> (AwsRedshiftClusterClusterParameterStatus
    -> AwsRedshiftClusterClusterParameterStatus -> Bool)
-> Eq AwsRedshiftClusterClusterParameterStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRedshiftClusterClusterParameterStatus
-> AwsRedshiftClusterClusterParameterStatus -> Bool
$c/= :: AwsRedshiftClusterClusterParameterStatus
-> AwsRedshiftClusterClusterParameterStatus -> Bool
== :: AwsRedshiftClusterClusterParameterStatus
-> AwsRedshiftClusterClusterParameterStatus -> Bool
$c== :: AwsRedshiftClusterClusterParameterStatus
-> AwsRedshiftClusterClusterParameterStatus -> Bool
Prelude.Eq, ReadPrec [AwsRedshiftClusterClusterParameterStatus]
ReadPrec AwsRedshiftClusterClusterParameterStatus
Int -> ReadS AwsRedshiftClusterClusterParameterStatus
ReadS [AwsRedshiftClusterClusterParameterStatus]
(Int -> ReadS AwsRedshiftClusterClusterParameterStatus)
-> ReadS [AwsRedshiftClusterClusterParameterStatus]
-> ReadPrec AwsRedshiftClusterClusterParameterStatus
-> ReadPrec [AwsRedshiftClusterClusterParameterStatus]
-> Read AwsRedshiftClusterClusterParameterStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRedshiftClusterClusterParameterStatus]
$creadListPrec :: ReadPrec [AwsRedshiftClusterClusterParameterStatus]
readPrec :: ReadPrec AwsRedshiftClusterClusterParameterStatus
$creadPrec :: ReadPrec AwsRedshiftClusterClusterParameterStatus
readList :: ReadS [AwsRedshiftClusterClusterParameterStatus]
$creadList :: ReadS [AwsRedshiftClusterClusterParameterStatus]
readsPrec :: Int -> ReadS AwsRedshiftClusterClusterParameterStatus
$creadsPrec :: Int -> ReadS AwsRedshiftClusterClusterParameterStatus
Prelude.Read, Int -> AwsRedshiftClusterClusterParameterStatus -> ShowS
[AwsRedshiftClusterClusterParameterStatus] -> ShowS
AwsRedshiftClusterClusterParameterStatus -> String
(Int -> AwsRedshiftClusterClusterParameterStatus -> ShowS)
-> (AwsRedshiftClusterClusterParameterStatus -> String)
-> ([AwsRedshiftClusterClusterParameterStatus] -> ShowS)
-> Show AwsRedshiftClusterClusterParameterStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRedshiftClusterClusterParameterStatus] -> ShowS
$cshowList :: [AwsRedshiftClusterClusterParameterStatus] -> ShowS
show :: AwsRedshiftClusterClusterParameterStatus -> String
$cshow :: AwsRedshiftClusterClusterParameterStatus -> String
showsPrec :: Int -> AwsRedshiftClusterClusterParameterStatus -> ShowS
$cshowsPrec :: Int -> AwsRedshiftClusterClusterParameterStatus -> ShowS
Prelude.Show, (forall x.
 AwsRedshiftClusterClusterParameterStatus
 -> Rep AwsRedshiftClusterClusterParameterStatus x)
-> (forall x.
    Rep AwsRedshiftClusterClusterParameterStatus x
    -> AwsRedshiftClusterClusterParameterStatus)
-> Generic AwsRedshiftClusterClusterParameterStatus
forall x.
Rep AwsRedshiftClusterClusterParameterStatus x
-> AwsRedshiftClusterClusterParameterStatus
forall x.
AwsRedshiftClusterClusterParameterStatus
-> Rep AwsRedshiftClusterClusterParameterStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsRedshiftClusterClusterParameterStatus x
-> AwsRedshiftClusterClusterParameterStatus
$cfrom :: forall x.
AwsRedshiftClusterClusterParameterStatus
-> Rep AwsRedshiftClusterClusterParameterStatus x
Prelude.Generic)

-- |
-- Create a value of 'AwsRedshiftClusterClusterParameterStatus' 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:
--
-- 'parameterApplyErrorDescription', 'awsRedshiftClusterClusterParameterStatus_parameterApplyErrorDescription' - The error that prevented the parameter from being applied to the
-- database.
--
-- 'parameterName', 'awsRedshiftClusterClusterParameterStatus_parameterName' - The name of the parameter.
--
-- 'parameterApplyStatus', 'awsRedshiftClusterClusterParameterStatus_parameterApplyStatus' - The status of the parameter. Indicates whether the parameter is in sync
-- with the database, waiting for a cluster reboot, or encountered an error
-- when it was applied.
--
-- Valid values: @in-sync@ | @pending-reboot@ | @applying@ |
-- @invalid-parameter@ | @apply-deferred@ | @apply-error@ | @unknown-error@
newAwsRedshiftClusterClusterParameterStatus ::
  AwsRedshiftClusterClusterParameterStatus
newAwsRedshiftClusterClusterParameterStatus :: AwsRedshiftClusterClusterParameterStatus
newAwsRedshiftClusterClusterParameterStatus =
  AwsRedshiftClusterClusterParameterStatus' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsRedshiftClusterClusterParameterStatus
AwsRedshiftClusterClusterParameterStatus'
    { $sel:parameterApplyErrorDescription:AwsRedshiftClusterClusterParameterStatus' :: Maybe Text
parameterApplyErrorDescription =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterName:AwsRedshiftClusterClusterParameterStatus' :: Maybe Text
parameterName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterApplyStatus:AwsRedshiftClusterClusterParameterStatus' :: Maybe Text
parameterApplyStatus =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The error that prevented the parameter from being applied to the
-- database.
awsRedshiftClusterClusterParameterStatus_parameterApplyErrorDescription :: Lens.Lens' AwsRedshiftClusterClusterParameterStatus (Prelude.Maybe Prelude.Text)
awsRedshiftClusterClusterParameterStatus_parameterApplyErrorDescription :: (Maybe Text -> f (Maybe Text))
-> AwsRedshiftClusterClusterParameterStatus
-> f AwsRedshiftClusterClusterParameterStatus
awsRedshiftClusterClusterParameterStatus_parameterApplyErrorDescription = (AwsRedshiftClusterClusterParameterStatus -> Maybe Text)
-> (AwsRedshiftClusterClusterParameterStatus
    -> Maybe Text -> AwsRedshiftClusterClusterParameterStatus)
-> Lens
     AwsRedshiftClusterClusterParameterStatus
     AwsRedshiftClusterClusterParameterStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterClusterParameterStatus' {Maybe Text
parameterApplyErrorDescription :: Maybe Text
$sel:parameterApplyErrorDescription:AwsRedshiftClusterClusterParameterStatus' :: AwsRedshiftClusterClusterParameterStatus -> Maybe Text
parameterApplyErrorDescription} -> Maybe Text
parameterApplyErrorDescription) (\s :: AwsRedshiftClusterClusterParameterStatus
s@AwsRedshiftClusterClusterParameterStatus' {} Maybe Text
a -> AwsRedshiftClusterClusterParameterStatus
s {$sel:parameterApplyErrorDescription:AwsRedshiftClusterClusterParameterStatus' :: Maybe Text
parameterApplyErrorDescription = Maybe Text
a} :: AwsRedshiftClusterClusterParameterStatus)

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

-- | The status of the parameter. Indicates whether the parameter is in sync
-- with the database, waiting for a cluster reboot, or encountered an error
-- when it was applied.
--
-- Valid values: @in-sync@ | @pending-reboot@ | @applying@ |
-- @invalid-parameter@ | @apply-deferred@ | @apply-error@ | @unknown-error@
awsRedshiftClusterClusterParameterStatus_parameterApplyStatus :: Lens.Lens' AwsRedshiftClusterClusterParameterStatus (Prelude.Maybe Prelude.Text)
awsRedshiftClusterClusterParameterStatus_parameterApplyStatus :: (Maybe Text -> f (Maybe Text))
-> AwsRedshiftClusterClusterParameterStatus
-> f AwsRedshiftClusterClusterParameterStatus
awsRedshiftClusterClusterParameterStatus_parameterApplyStatus = (AwsRedshiftClusterClusterParameterStatus -> Maybe Text)
-> (AwsRedshiftClusterClusterParameterStatus
    -> Maybe Text -> AwsRedshiftClusterClusterParameterStatus)
-> Lens
     AwsRedshiftClusterClusterParameterStatus
     AwsRedshiftClusterClusterParameterStatus
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterClusterParameterStatus' {Maybe Text
parameterApplyStatus :: Maybe Text
$sel:parameterApplyStatus:AwsRedshiftClusterClusterParameterStatus' :: AwsRedshiftClusterClusterParameterStatus -> Maybe Text
parameterApplyStatus} -> Maybe Text
parameterApplyStatus) (\s :: AwsRedshiftClusterClusterParameterStatus
s@AwsRedshiftClusterClusterParameterStatus' {} Maybe Text
a -> AwsRedshiftClusterClusterParameterStatus
s {$sel:parameterApplyStatus:AwsRedshiftClusterClusterParameterStatus' :: Maybe Text
parameterApplyStatus = Maybe Text
a} :: AwsRedshiftClusterClusterParameterStatus)

instance
  Core.FromJSON
    AwsRedshiftClusterClusterParameterStatus
  where
  parseJSON :: Value -> Parser AwsRedshiftClusterClusterParameterStatus
parseJSON =
    String
-> (Object -> Parser AwsRedshiftClusterClusterParameterStatus)
-> Value
-> Parser AwsRedshiftClusterClusterParameterStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRedshiftClusterClusterParameterStatus"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsRedshiftClusterClusterParameterStatus
AwsRedshiftClusterClusterParameterStatus'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AwsRedshiftClusterClusterParameterStatus)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> AwsRedshiftClusterClusterParameterStatus)
forall (f :: * -> *) a b. Functor 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
"ParameterApplyErrorDescription")
            Parser
  (Maybe Text
   -> Maybe Text -> AwsRedshiftClusterClusterParameterStatus)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsRedshiftClusterClusterParameterStatus)
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
"ParameterName")
            Parser (Maybe Text -> AwsRedshiftClusterClusterParameterStatus)
-> Parser (Maybe Text)
-> Parser AwsRedshiftClusterClusterParameterStatus
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")
      )

instance
  Prelude.Hashable
    AwsRedshiftClusterClusterParameterStatus

instance
  Prelude.NFData
    AwsRedshiftClusterClusterParameterStatus

instance
  Core.ToJSON
    AwsRedshiftClusterClusterParameterStatus
  where
  toJSON :: AwsRedshiftClusterClusterParameterStatus -> Value
toJSON AwsRedshiftClusterClusterParameterStatus' {Maybe Text
parameterApplyStatus :: Maybe Text
parameterName :: Maybe Text
parameterApplyErrorDescription :: Maybe Text
$sel:parameterApplyStatus:AwsRedshiftClusterClusterParameterStatus' :: AwsRedshiftClusterClusterParameterStatus -> Maybe Text
$sel:parameterName:AwsRedshiftClusterClusterParameterStatus' :: AwsRedshiftClusterClusterParameterStatus -> Maybe Text
$sel:parameterApplyErrorDescription:AwsRedshiftClusterClusterParameterStatus' :: AwsRedshiftClusterClusterParameterStatus -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ParameterApplyErrorDescription" 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
parameterApplyErrorDescription,
            (Text
"ParameterName" 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
parameterName,
            (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
          ]
      )