{-# 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.ElastiCache.Types.ParameterNameValue
-- 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.ElastiCache.Types.ParameterNameValue 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

-- | Describes a name-value pair that is used to update the value of a
-- parameter.
--
-- /See:/ 'newParameterNameValue' smart constructor.
data ParameterNameValue = ParameterNameValue'
  { -- | The name of the parameter.
    ParameterNameValue -> Maybe Text
parameterName :: Prelude.Maybe Prelude.Text,
    -- | The value of the parameter.
    ParameterNameValue -> Maybe Text
parameterValue :: Prelude.Maybe Prelude.Text
  }
  deriving (ParameterNameValue -> ParameterNameValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterNameValue -> ParameterNameValue -> Bool
$c/= :: ParameterNameValue -> ParameterNameValue -> Bool
== :: ParameterNameValue -> ParameterNameValue -> Bool
$c== :: ParameterNameValue -> ParameterNameValue -> Bool
Prelude.Eq, ReadPrec [ParameterNameValue]
ReadPrec ParameterNameValue
Int -> ReadS ParameterNameValue
ReadS [ParameterNameValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterNameValue]
$creadListPrec :: ReadPrec [ParameterNameValue]
readPrec :: ReadPrec ParameterNameValue
$creadPrec :: ReadPrec ParameterNameValue
readList :: ReadS [ParameterNameValue]
$creadList :: ReadS [ParameterNameValue]
readsPrec :: Int -> ReadS ParameterNameValue
$creadsPrec :: Int -> ReadS ParameterNameValue
Prelude.Read, Int -> ParameterNameValue -> ShowS
[ParameterNameValue] -> ShowS
ParameterNameValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterNameValue] -> ShowS
$cshowList :: [ParameterNameValue] -> ShowS
show :: ParameterNameValue -> String
$cshow :: ParameterNameValue -> String
showsPrec :: Int -> ParameterNameValue -> ShowS
$cshowsPrec :: Int -> ParameterNameValue -> ShowS
Prelude.Show, forall x. Rep ParameterNameValue x -> ParameterNameValue
forall x. ParameterNameValue -> Rep ParameterNameValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterNameValue x -> ParameterNameValue
$cfrom :: forall x. ParameterNameValue -> Rep ParameterNameValue x
Prelude.Generic)

-- |
-- Create a value of 'ParameterNameValue' 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:
--
-- 'parameterName', 'parameterNameValue_parameterName' - The name of the parameter.
--
-- 'parameterValue', 'parameterNameValue_parameterValue' - The value of the parameter.
newParameterNameValue ::
  ParameterNameValue
newParameterNameValue :: ParameterNameValue
newParameterNameValue =
  ParameterNameValue'
    { $sel:parameterName:ParameterNameValue' :: Maybe Text
parameterName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:parameterValue:ParameterNameValue' :: Maybe Text
parameterValue = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The value of the parameter.
parameterNameValue_parameterValue :: Lens.Lens' ParameterNameValue (Prelude.Maybe Prelude.Text)
parameterNameValue_parameterValue :: Lens' ParameterNameValue (Maybe Text)
parameterNameValue_parameterValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterNameValue' {Maybe Text
parameterValue :: Maybe Text
$sel:parameterValue:ParameterNameValue' :: ParameterNameValue -> Maybe Text
parameterValue} -> Maybe Text
parameterValue) (\s :: ParameterNameValue
s@ParameterNameValue' {} Maybe Text
a -> ParameterNameValue
s {$sel:parameterValue:ParameterNameValue' :: Maybe Text
parameterValue = Maybe Text
a} :: ParameterNameValue)

instance Prelude.Hashable ParameterNameValue where
  hashWithSalt :: Int -> ParameterNameValue -> Int
hashWithSalt Int
_salt ParameterNameValue' {Maybe Text
parameterValue :: Maybe Text
parameterName :: Maybe Text
$sel:parameterValue:ParameterNameValue' :: ParameterNameValue -> Maybe Text
$sel:parameterName:ParameterNameValue' :: ParameterNameValue -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterValue

instance Prelude.NFData ParameterNameValue where
  rnf :: ParameterNameValue -> ()
rnf ParameterNameValue' {Maybe Text
parameterValue :: Maybe Text
parameterName :: Maybe Text
$sel:parameterValue:ParameterNameValue' :: ParameterNameValue -> Maybe Text
$sel:parameterName:ParameterNameValue' :: ParameterNameValue -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterValue

instance Data.ToQuery ParameterNameValue where
  toQuery :: ParameterNameValue -> QueryString
toQuery ParameterNameValue' {Maybe Text
parameterValue :: Maybe Text
parameterName :: Maybe Text
$sel:parameterValue:ParameterNameValue' :: ParameterNameValue -> Maybe Text
$sel:parameterName:ParameterNameValue' :: ParameterNameValue -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"ParameterName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
parameterName,
        ByteString
"ParameterValue" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
parameterValue
      ]