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

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

-- | Provides information about a parameter group for a DB instance.
--
-- /See:/ 'newAwsRdsDbParameterGroup' smart constructor.
data AwsRdsDbParameterGroup = AwsRdsDbParameterGroup'
  { -- | The name of the parameter group.
    AwsRdsDbParameterGroup -> Maybe Text
dbParameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | The status of parameter updates.
    AwsRdsDbParameterGroup -> Maybe Text
parameterApplyStatus :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsRdsDbParameterGroup -> AwsRdsDbParameterGroup -> Bool
(AwsRdsDbParameterGroup -> AwsRdsDbParameterGroup -> Bool)
-> (AwsRdsDbParameterGroup -> AwsRdsDbParameterGroup -> Bool)
-> Eq AwsRdsDbParameterGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRdsDbParameterGroup -> AwsRdsDbParameterGroup -> Bool
$c/= :: AwsRdsDbParameterGroup -> AwsRdsDbParameterGroup -> Bool
== :: AwsRdsDbParameterGroup -> AwsRdsDbParameterGroup -> Bool
$c== :: AwsRdsDbParameterGroup -> AwsRdsDbParameterGroup -> Bool
Prelude.Eq, ReadPrec [AwsRdsDbParameterGroup]
ReadPrec AwsRdsDbParameterGroup
Int -> ReadS AwsRdsDbParameterGroup
ReadS [AwsRdsDbParameterGroup]
(Int -> ReadS AwsRdsDbParameterGroup)
-> ReadS [AwsRdsDbParameterGroup]
-> ReadPrec AwsRdsDbParameterGroup
-> ReadPrec [AwsRdsDbParameterGroup]
-> Read AwsRdsDbParameterGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRdsDbParameterGroup]
$creadListPrec :: ReadPrec [AwsRdsDbParameterGroup]
readPrec :: ReadPrec AwsRdsDbParameterGroup
$creadPrec :: ReadPrec AwsRdsDbParameterGroup
readList :: ReadS [AwsRdsDbParameterGroup]
$creadList :: ReadS [AwsRdsDbParameterGroup]
readsPrec :: Int -> ReadS AwsRdsDbParameterGroup
$creadsPrec :: Int -> ReadS AwsRdsDbParameterGroup
Prelude.Read, Int -> AwsRdsDbParameterGroup -> ShowS
[AwsRdsDbParameterGroup] -> ShowS
AwsRdsDbParameterGroup -> String
(Int -> AwsRdsDbParameterGroup -> ShowS)
-> (AwsRdsDbParameterGroup -> String)
-> ([AwsRdsDbParameterGroup] -> ShowS)
-> Show AwsRdsDbParameterGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRdsDbParameterGroup] -> ShowS
$cshowList :: [AwsRdsDbParameterGroup] -> ShowS
show :: AwsRdsDbParameterGroup -> String
$cshow :: AwsRdsDbParameterGroup -> String
showsPrec :: Int -> AwsRdsDbParameterGroup -> ShowS
$cshowsPrec :: Int -> AwsRdsDbParameterGroup -> ShowS
Prelude.Show, (forall x. AwsRdsDbParameterGroup -> Rep AwsRdsDbParameterGroup x)
-> (forall x.
    Rep AwsRdsDbParameterGroup x -> AwsRdsDbParameterGroup)
-> Generic AwsRdsDbParameterGroup
forall x. Rep AwsRdsDbParameterGroup x -> AwsRdsDbParameterGroup
forall x. AwsRdsDbParameterGroup -> Rep AwsRdsDbParameterGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsRdsDbParameterGroup x -> AwsRdsDbParameterGroup
$cfrom :: forall x. AwsRdsDbParameterGroup -> Rep AwsRdsDbParameterGroup x
Prelude.Generic)

-- |
-- Create a value of 'AwsRdsDbParameterGroup' 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:
--
-- 'dbParameterGroupName', 'awsRdsDbParameterGroup_dbParameterGroupName' - The name of the parameter group.
--
-- 'parameterApplyStatus', 'awsRdsDbParameterGroup_parameterApplyStatus' - The status of parameter updates.
newAwsRdsDbParameterGroup ::
  AwsRdsDbParameterGroup
newAwsRdsDbParameterGroup :: AwsRdsDbParameterGroup
newAwsRdsDbParameterGroup =
  AwsRdsDbParameterGroup' :: Maybe Text -> Maybe Text -> AwsRdsDbParameterGroup
AwsRdsDbParameterGroup'
    { $sel:dbParameterGroupName:AwsRdsDbParameterGroup' :: Maybe Text
dbParameterGroupName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterApplyStatus:AwsRdsDbParameterGroup' :: Maybe Text
parameterApplyStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Core.FromJSON AwsRdsDbParameterGroup where
  parseJSON :: Value -> Parser AwsRdsDbParameterGroup
parseJSON =
    String
-> (Object -> Parser AwsRdsDbParameterGroup)
-> Value
-> Parser AwsRdsDbParameterGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRdsDbParameterGroup"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> AwsRdsDbParameterGroup
AwsRdsDbParameterGroup'
            (Maybe Text -> Maybe Text -> AwsRdsDbParameterGroup)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsRdsDbParameterGroup)
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
"DbParameterGroupName")
            Parser (Maybe Text -> AwsRdsDbParameterGroup)
-> Parser (Maybe Text) -> Parser AwsRdsDbParameterGroup
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 AwsRdsDbParameterGroup

instance Prelude.NFData AwsRdsDbParameterGroup

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