{-# 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-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.MemoryDb.Types.ParameterGroup where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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,
    -- | 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,
    -- | A description of the parameter group
    ParameterGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ParameterGroup -> ParameterGroup -> Bool
(ParameterGroup -> ParameterGroup -> Bool)
-> (ParameterGroup -> ParameterGroup -> Bool) -> Eq ParameterGroup
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]
(Int -> ReadS ParameterGroup)
-> ReadS [ParameterGroup]
-> ReadPrec ParameterGroup
-> ReadPrec [ParameterGroup]
-> Read 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
(Int -> ParameterGroup -> ShowS)
-> (ParameterGroup -> String)
-> ([ParameterGroup] -> ShowS)
-> Show ParameterGroup
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. ParameterGroup -> Rep ParameterGroup x)
-> (forall x. Rep ParameterGroup x -> ParameterGroup)
-> Generic ParameterGroup
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
--
-- '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
--
-- 'description', 'parameterGroup_description' - A description of the parameter group
newParameterGroup ::
  ParameterGroup
newParameterGroup :: ParameterGroup
newParameterGroup =
  ParameterGroup' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ParameterGroup
ParameterGroup'
    { $sel:arn:ParameterGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:family:ParameterGroup' :: Maybe Text
family = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ParameterGroup' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ParameterGroup' :: Maybe Text
description = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> ParameterGroup -> f ParameterGroup
parameterGroup_arn = (ParameterGroup -> Maybe Text)
-> (ParameterGroup -> Maybe Text -> ParameterGroup)
-> Lens ParameterGroup ParameterGroup (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ParameterGroup -> f ParameterGroup
parameterGroup_family = (ParameterGroup -> Maybe Text)
-> (ParameterGroup -> Maybe Text -> ParameterGroup)
-> Lens ParameterGroup ParameterGroup (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> ParameterGroup -> f ParameterGroup
parameterGroup_name = (ParameterGroup -> Maybe Text)
-> (ParameterGroup -> Maybe Text -> ParameterGroup)
-> Lens ParameterGroup ParameterGroup (Maybe Text) (Maybe Text)
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)

-- | A description of the parameter group
parameterGroup_description :: Lens.Lens' ParameterGroup (Prelude.Maybe Prelude.Text)
parameterGroup_description :: (Maybe Text -> f (Maybe Text))
-> ParameterGroup -> f ParameterGroup
parameterGroup_description = (ParameterGroup -> Maybe Text)
-> (ParameterGroup -> Maybe Text -> ParameterGroup)
-> Lens ParameterGroup ParameterGroup (Maybe Text) (Maybe Text)
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)

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

instance Prelude.Hashable ParameterGroup

instance Prelude.NFData ParameterGroup