{-# 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.RDS.Types.DBParameterGroup
-- 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.RDS.Types.DBParameterGroup where

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

-- | Contains the details of an Amazon RDS DB parameter group.
--
-- This data type is used as a response element in the
-- @DescribeDBParameterGroups@ action.
--
-- /See:/ 'newDBParameterGroup' smart constructor.
data DBParameterGroup = DBParameterGroup'
  { -- | The Amazon Resource Name (ARN) for the DB parameter group.
    DBParameterGroup -> Maybe Text
dbParameterGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the DB parameter group family that this DB parameter group
    -- is compatible with.
    DBParameterGroup -> Maybe Text
dbParameterGroupFamily :: Prelude.Maybe Prelude.Text,
    -- | The name of the DB parameter group.
    DBParameterGroup -> Maybe Text
dbParameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | Provides the customer-specified description for this DB parameter group.
    DBParameterGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (DBParameterGroup -> DBParameterGroup -> Bool
(DBParameterGroup -> DBParameterGroup -> Bool)
-> (DBParameterGroup -> DBParameterGroup -> Bool)
-> Eq DBParameterGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBParameterGroup -> DBParameterGroup -> Bool
$c/= :: DBParameterGroup -> DBParameterGroup -> Bool
== :: DBParameterGroup -> DBParameterGroup -> Bool
$c== :: DBParameterGroup -> DBParameterGroup -> Bool
Prelude.Eq, ReadPrec [DBParameterGroup]
ReadPrec DBParameterGroup
Int -> ReadS DBParameterGroup
ReadS [DBParameterGroup]
(Int -> ReadS DBParameterGroup)
-> ReadS [DBParameterGroup]
-> ReadPrec DBParameterGroup
-> ReadPrec [DBParameterGroup]
-> Read DBParameterGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DBParameterGroup]
$creadListPrec :: ReadPrec [DBParameterGroup]
readPrec :: ReadPrec DBParameterGroup
$creadPrec :: ReadPrec DBParameterGroup
readList :: ReadS [DBParameterGroup]
$creadList :: ReadS [DBParameterGroup]
readsPrec :: Int -> ReadS DBParameterGroup
$creadsPrec :: Int -> ReadS DBParameterGroup
Prelude.Read, Int -> DBParameterGroup -> ShowS
[DBParameterGroup] -> ShowS
DBParameterGroup -> String
(Int -> DBParameterGroup -> ShowS)
-> (DBParameterGroup -> String)
-> ([DBParameterGroup] -> ShowS)
-> Show DBParameterGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DBParameterGroup] -> ShowS
$cshowList :: [DBParameterGroup] -> ShowS
show :: DBParameterGroup -> String
$cshow :: DBParameterGroup -> String
showsPrec :: Int -> DBParameterGroup -> ShowS
$cshowsPrec :: Int -> DBParameterGroup -> ShowS
Prelude.Show, (forall x. DBParameterGroup -> Rep DBParameterGroup x)
-> (forall x. Rep DBParameterGroup x -> DBParameterGroup)
-> Generic DBParameterGroup
forall x. Rep DBParameterGroup x -> DBParameterGroup
forall x. DBParameterGroup -> Rep DBParameterGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DBParameterGroup x -> DBParameterGroup
$cfrom :: forall x. DBParameterGroup -> Rep DBParameterGroup x
Prelude.Generic)

-- |
-- Create a value of 'DBParameterGroup' 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:
--
-- 'dbParameterGroupArn', 'dbParameterGroup_dbParameterGroupArn' - The Amazon Resource Name (ARN) for the DB parameter group.
--
-- 'dbParameterGroupFamily', 'dbParameterGroup_dbParameterGroupFamily' - The name of the DB parameter group family that this DB parameter group
-- is compatible with.
--
-- 'dbParameterGroupName', 'dbParameterGroup_dbParameterGroupName' - The name of the DB parameter group.
--
-- 'description', 'dbParameterGroup_description' - Provides the customer-specified description for this DB parameter group.
newDBParameterGroup ::
  DBParameterGroup
newDBParameterGroup :: DBParameterGroup
newDBParameterGroup =
  DBParameterGroup' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> DBParameterGroup
DBParameterGroup'
    { $sel:dbParameterGroupArn:DBParameterGroup' :: Maybe Text
dbParameterGroupArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbParameterGroupFamily:DBParameterGroup' :: Maybe Text
dbParameterGroupFamily = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbParameterGroupName:DBParameterGroup' :: Maybe Text
dbParameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:DBParameterGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) for the DB parameter group.
dbParameterGroup_dbParameterGroupArn :: Lens.Lens' DBParameterGroup (Prelude.Maybe Prelude.Text)
dbParameterGroup_dbParameterGroupArn :: (Maybe Text -> f (Maybe Text))
-> DBParameterGroup -> f DBParameterGroup
dbParameterGroup_dbParameterGroupArn = (DBParameterGroup -> Maybe Text)
-> (DBParameterGroup -> Maybe Text -> DBParameterGroup)
-> Lens DBParameterGroup DBParameterGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBParameterGroup' {Maybe Text
dbParameterGroupArn :: Maybe Text
$sel:dbParameterGroupArn:DBParameterGroup' :: DBParameterGroup -> Maybe Text
dbParameterGroupArn} -> Maybe Text
dbParameterGroupArn) (\s :: DBParameterGroup
s@DBParameterGroup' {} Maybe Text
a -> DBParameterGroup
s {$sel:dbParameterGroupArn:DBParameterGroup' :: Maybe Text
dbParameterGroupArn = Maybe Text
a} :: DBParameterGroup)

-- | The name of the DB parameter group family that this DB parameter group
-- is compatible with.
dbParameterGroup_dbParameterGroupFamily :: Lens.Lens' DBParameterGroup (Prelude.Maybe Prelude.Text)
dbParameterGroup_dbParameterGroupFamily :: (Maybe Text -> f (Maybe Text))
-> DBParameterGroup -> f DBParameterGroup
dbParameterGroup_dbParameterGroupFamily = (DBParameterGroup -> Maybe Text)
-> (DBParameterGroup -> Maybe Text -> DBParameterGroup)
-> Lens DBParameterGroup DBParameterGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBParameterGroup' {Maybe Text
dbParameterGroupFamily :: Maybe Text
$sel:dbParameterGroupFamily:DBParameterGroup' :: DBParameterGroup -> Maybe Text
dbParameterGroupFamily} -> Maybe Text
dbParameterGroupFamily) (\s :: DBParameterGroup
s@DBParameterGroup' {} Maybe Text
a -> DBParameterGroup
s {$sel:dbParameterGroupFamily:DBParameterGroup' :: Maybe Text
dbParameterGroupFamily = Maybe Text
a} :: DBParameterGroup)

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

-- | Provides the customer-specified description for this DB parameter group.
dbParameterGroup_description :: Lens.Lens' DBParameterGroup (Prelude.Maybe Prelude.Text)
dbParameterGroup_description :: (Maybe Text -> f (Maybe Text))
-> DBParameterGroup -> f DBParameterGroup
dbParameterGroup_description = (DBParameterGroup -> Maybe Text)
-> (DBParameterGroup -> Maybe Text -> DBParameterGroup)
-> Lens DBParameterGroup DBParameterGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBParameterGroup' {Maybe Text
description :: Maybe Text
$sel:description:DBParameterGroup' :: DBParameterGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: DBParameterGroup
s@DBParameterGroup' {} Maybe Text
a -> DBParameterGroup
s {$sel:description:DBParameterGroup' :: Maybe Text
description = Maybe Text
a} :: DBParameterGroup)

instance Core.FromXML DBParameterGroup where
  parseXML :: [Node] -> Either String DBParameterGroup
parseXML [Node]
x =
    Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> DBParameterGroup
DBParameterGroup'
      (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe Text -> DBParameterGroup)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Text -> Maybe Text -> DBParameterGroup)
forall (f :: * -> *) a b. Functor 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
"DBParameterGroupArn")
      Either
  String (Maybe Text -> Maybe Text -> Maybe Text -> DBParameterGroup)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> DBParameterGroup)
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
"DBParameterGroupFamily")
      Either String (Maybe Text -> Maybe Text -> DBParameterGroup)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> DBParameterGroup)
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
"DBParameterGroupName")
      Either String (Maybe Text -> DBParameterGroup)
-> Either String (Maybe Text) -> Either String DBParameterGroup
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
"Description")

instance Prelude.Hashable DBParameterGroup

instance Prelude.NFData DBParameterGroup