{-# 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.MemoryDb.Types.ParameterGroup
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MemoryDb.Types.ParameterGroup where

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

-- | Represents the output of a CreateParameterGroup operation. A parameter
-- group represents a combination of specific values for the parameters
-- that are passed to the engine software during startup.
--
-- /See:/ 'newParameterGroup' smart constructor.
data ParameterGroup = ParameterGroup'
  { -- | The Amazon Resource Name (ARN) of the parameter group
    ParameterGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | A description of the parameter group
    ParameterGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the parameter group family that this parameter group is
    -- compatible with.
    ParameterGroup -> Maybe Text
family :: Prelude.Maybe Prelude.Text,
    -- | The name of the parameter group
    ParameterGroup -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (ParameterGroup -> ParameterGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterGroup -> ParameterGroup -> Bool
$c/= :: ParameterGroup -> ParameterGroup -> Bool
== :: ParameterGroup -> ParameterGroup -> Bool
$c== :: ParameterGroup -> ParameterGroup -> Bool
Prelude.Eq, ReadPrec [ParameterGroup]
ReadPrec ParameterGroup
Int -> ReadS ParameterGroup
ReadS [ParameterGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterGroup]
$creadListPrec :: ReadPrec [ParameterGroup]
readPrec :: ReadPrec ParameterGroup
$creadPrec :: ReadPrec ParameterGroup
readList :: ReadS [ParameterGroup]
$creadList :: ReadS [ParameterGroup]
readsPrec :: Int -> ReadS ParameterGroup
$creadsPrec :: Int -> ReadS ParameterGroup
Prelude.Read, Int -> ParameterGroup -> ShowS
[ParameterGroup] -> ShowS
ParameterGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterGroup] -> ShowS
$cshowList :: [ParameterGroup] -> ShowS
show :: ParameterGroup -> String
$cshow :: ParameterGroup -> String
showsPrec :: Int -> ParameterGroup -> ShowS
$cshowsPrec :: Int -> ParameterGroup -> ShowS
Prelude.Show, forall x. Rep ParameterGroup x -> ParameterGroup
forall x. ParameterGroup -> Rep ParameterGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterGroup x -> ParameterGroup
$cfrom :: forall x. ParameterGroup -> Rep ParameterGroup x
Prelude.Generic)

-- |
-- Create a value of 'ParameterGroup' 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:
--
-- 'arn', 'parameterGroup_arn' - The Amazon Resource Name (ARN) of the parameter group
--
-- 'description', 'parameterGroup_description' - A description of the parameter group
--
-- 'family', 'parameterGroup_family' - The name of the parameter group family that this parameter group is
-- compatible with.
--
-- 'name', 'parameterGroup_name' - The name of the parameter group
newParameterGroup ::
  ParameterGroup
newParameterGroup :: ParameterGroup
newParameterGroup =
  ParameterGroup'
    { $sel:arn:ParameterGroup' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:description:ParameterGroup' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:family:ParameterGroup' :: Maybe Text
family = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ParameterGroup' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the parameter group
parameterGroup_arn :: Lens.Lens' ParameterGroup (Prelude.Maybe Prelude.Text)
parameterGroup_arn :: Lens' ParameterGroup (Maybe Text)
parameterGroup_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:ParameterGroup' :: ParameterGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ParameterGroup
s@ParameterGroup' {} Maybe Text
a -> ParameterGroup
s {$sel:arn:ParameterGroup' :: Maybe Text
arn = Maybe Text
a} :: ParameterGroup)

-- | A description of the parameter group
parameterGroup_description :: Lens.Lens' ParameterGroup (Prelude.Maybe Prelude.Text)
parameterGroup_description :: Lens' ParameterGroup (Maybe Text)
parameterGroup_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterGroup' {Maybe Text
description :: Maybe Text
$sel:description:ParameterGroup' :: ParameterGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: ParameterGroup
s@ParameterGroup' {} Maybe Text
a -> ParameterGroup
s {$sel:description:ParameterGroup' :: Maybe Text
description = Maybe Text
a} :: ParameterGroup)

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

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

instance Data.FromJSON ParameterGroup where
  parseJSON :: Value -> Parser ParameterGroup
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ParameterGroup"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ParameterGroup
ParameterGroup'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ARN")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Family")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
      )

instance Prelude.Hashable ParameterGroup where
  hashWithSalt :: Int -> ParameterGroup -> Int
hashWithSalt Int
_salt ParameterGroup' {Maybe Text
name :: Maybe Text
family :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:name:ParameterGroup' :: ParameterGroup -> Maybe Text
$sel:family:ParameterGroup' :: ParameterGroup -> Maybe Text
$sel:description:ParameterGroup' :: ParameterGroup -> Maybe Text
$sel:arn:ParameterGroup' :: ParameterGroup -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
family
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData ParameterGroup where
  rnf :: ParameterGroup -> ()
rnf ParameterGroup' {Maybe Text
name :: Maybe Text
family :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:name:ParameterGroup' :: ParameterGroup -> Maybe Text
$sel:family:ParameterGroup' :: ParameterGroup -> Maybe Text
$sel:description:ParameterGroup' :: ParameterGroup -> Maybe Text
$sel:arn:ParameterGroup' :: ParameterGroup -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
family
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name