{-# 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 #-}
module Amazonka.RedshiftServerLess.Types.ConfigParameter 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
data ConfigParameter = ConfigParameter'
{
ConfigParameter -> Maybe Text
parameterKey :: Prelude.Maybe Prelude.Text,
ConfigParameter -> Maybe Text
parameterValue :: Prelude.Maybe Prelude.Text
}
deriving (ConfigParameter -> ConfigParameter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigParameter -> ConfigParameter -> Bool
$c/= :: ConfigParameter -> ConfigParameter -> Bool
== :: ConfigParameter -> ConfigParameter -> Bool
$c== :: ConfigParameter -> ConfigParameter -> Bool
Prelude.Eq, ReadPrec [ConfigParameter]
ReadPrec ConfigParameter
Int -> ReadS ConfigParameter
ReadS [ConfigParameter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigParameter]
$creadListPrec :: ReadPrec [ConfigParameter]
readPrec :: ReadPrec ConfigParameter
$creadPrec :: ReadPrec ConfigParameter
readList :: ReadS [ConfigParameter]
$creadList :: ReadS [ConfigParameter]
readsPrec :: Int -> ReadS ConfigParameter
$creadsPrec :: Int -> ReadS ConfigParameter
Prelude.Read, Int -> ConfigParameter -> ShowS
[ConfigParameter] -> ShowS
ConfigParameter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigParameter] -> ShowS
$cshowList :: [ConfigParameter] -> ShowS
show :: ConfigParameter -> String
$cshow :: ConfigParameter -> String
showsPrec :: Int -> ConfigParameter -> ShowS
$cshowsPrec :: Int -> ConfigParameter -> ShowS
Prelude.Show, forall x. Rep ConfigParameter x -> ConfigParameter
forall x. ConfigParameter -> Rep ConfigParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfigParameter x -> ConfigParameter
$cfrom :: forall x. ConfigParameter -> Rep ConfigParameter x
Prelude.Generic)
newConfigParameter ::
ConfigParameter
newConfigParameter :: ConfigParameter
newConfigParameter =
ConfigParameter'
{ $sel:parameterKey:ConfigParameter' :: Maybe Text
parameterKey = forall a. Maybe a
Prelude.Nothing,
$sel:parameterValue:ConfigParameter' :: Maybe Text
parameterValue = forall a. Maybe a
Prelude.Nothing
}
configParameter_parameterKey :: Lens.Lens' ConfigParameter (Prelude.Maybe Prelude.Text)
configParameter_parameterKey :: Lens' ConfigParameter (Maybe Text)
configParameter_parameterKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigParameter' {Maybe Text
parameterKey :: Maybe Text
$sel:parameterKey:ConfigParameter' :: ConfigParameter -> Maybe Text
parameterKey} -> Maybe Text
parameterKey) (\s :: ConfigParameter
s@ConfigParameter' {} Maybe Text
a -> ConfigParameter
s {$sel:parameterKey:ConfigParameter' :: Maybe Text
parameterKey = Maybe Text
a} :: ConfigParameter)
configParameter_parameterValue :: Lens.Lens' ConfigParameter (Prelude.Maybe Prelude.Text)
configParameter_parameterValue :: Lens' ConfigParameter (Maybe Text)
configParameter_parameterValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigParameter' {Maybe Text
parameterValue :: Maybe Text
$sel:parameterValue:ConfigParameter' :: ConfigParameter -> Maybe Text
parameterValue} -> Maybe Text
parameterValue) (\s :: ConfigParameter
s@ConfigParameter' {} Maybe Text
a -> ConfigParameter
s {$sel:parameterValue:ConfigParameter' :: Maybe Text
parameterValue = Maybe Text
a} :: ConfigParameter)
instance Data.FromJSON ConfigParameter where
parseJSON :: Value -> Parser ConfigParameter
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ConfigParameter"
( \Object
x ->
Maybe Text -> Maybe Text -> ConfigParameter
ConfigParameter'
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
"parameterKey")
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
"parameterValue")
)
instance Prelude.Hashable ConfigParameter where
hashWithSalt :: Int -> ConfigParameter -> Int
hashWithSalt Int
_salt ConfigParameter' {Maybe Text
parameterValue :: Maybe Text
parameterKey :: Maybe Text
$sel:parameterValue:ConfigParameter' :: ConfigParameter -> Maybe Text
$sel:parameterKey:ConfigParameter' :: ConfigParameter -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterValue
instance Prelude.NFData ConfigParameter where
rnf :: ConfigParameter -> ()
rnf ConfigParameter' {Maybe Text
parameterValue :: Maybe Text
parameterKey :: Maybe Text
$sel:parameterValue:ConfigParameter' :: ConfigParameter -> Maybe Text
$sel:parameterKey:ConfigParameter' :: ConfigParameter -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterValue
instance Data.ToJSON ConfigParameter where
toJSON :: ConfigParameter -> Value
toJSON ConfigParameter' {Maybe Text
parameterValue :: Maybe Text
parameterKey :: Maybe Text
$sel:parameterValue:ConfigParameter' :: ConfigParameter -> Maybe Text
$sel:parameterKey:ConfigParameter' :: ConfigParameter -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"parameterKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterKey,
(Key
"parameterValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterValue
]
)