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

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

-- | A named set of parameters that are applied to all of the nodes in a DAX
-- cluster.
--
-- /See:/ 'newParameterGroup' smart constructor.
data ParameterGroup = ParameterGroup'
  { -- | A description of the parameter group.
    ParameterGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the parameter group.
    ParameterGroup -> Maybe Text
parameterGroupName :: 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:
--
-- 'description', 'parameterGroup_description' - A description of the parameter group.
--
-- 'parameterGroupName', 'parameterGroup_parameterGroupName' - The name of the parameter group.
newParameterGroup ::
  ParameterGroup
newParameterGroup :: ParameterGroup
newParameterGroup =
  ParameterGroup' :: Maybe Text -> Maybe Text -> ParameterGroup
ParameterGroup'
    { $sel:description:ParameterGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupName:ParameterGroup' :: Maybe Text
parameterGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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)

-- | The name of the parameter group.
parameterGroup_parameterGroupName :: Lens.Lens' ParameterGroup (Prelude.Maybe Prelude.Text)
parameterGroup_parameterGroupName :: (Maybe Text -> f (Maybe Text))
-> ParameterGroup -> f ParameterGroup
parameterGroup_parameterGroupName = (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
parameterGroupName :: Maybe Text
$sel:parameterGroupName:ParameterGroup' :: ParameterGroup -> Maybe Text
parameterGroupName} -> Maybe Text
parameterGroupName) (\s :: ParameterGroup
s@ParameterGroup' {} Maybe Text
a -> ParameterGroup
s {$sel:parameterGroupName:ParameterGroup' :: Maybe Text
parameterGroupName = 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 -> ParameterGroup
ParameterGroup'
            (Maybe Text -> Maybe Text -> ParameterGroup)
-> Parser (Maybe Text) -> Parser (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
"Description")
            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
"ParameterGroupName")
      )

instance Prelude.Hashable ParameterGroup

instance Prelude.NFData ParameterGroup