{-# 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.Firehose.Types.ProcessorParameter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Firehose.Types.ProcessorParameterName
import qualified Amazonka.Prelude as Prelude
data ProcessorParameter = ProcessorParameter'
{
ProcessorParameter -> ProcessorParameterName
parameterName :: ProcessorParameterName,
ProcessorParameter -> Text
parameterValue :: Prelude.Text
}
deriving (ProcessorParameter -> ProcessorParameter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProcessorParameter -> ProcessorParameter -> Bool
$c/= :: ProcessorParameter -> ProcessorParameter -> Bool
== :: ProcessorParameter -> ProcessorParameter -> Bool
$c== :: ProcessorParameter -> ProcessorParameter -> Bool
Prelude.Eq, ReadPrec [ProcessorParameter]
ReadPrec ProcessorParameter
Int -> ReadS ProcessorParameter
ReadS [ProcessorParameter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProcessorParameter]
$creadListPrec :: ReadPrec [ProcessorParameter]
readPrec :: ReadPrec ProcessorParameter
$creadPrec :: ReadPrec ProcessorParameter
readList :: ReadS [ProcessorParameter]
$creadList :: ReadS [ProcessorParameter]
readsPrec :: Int -> ReadS ProcessorParameter
$creadsPrec :: Int -> ReadS ProcessorParameter
Prelude.Read, Int -> ProcessorParameter -> ShowS
[ProcessorParameter] -> ShowS
ProcessorParameter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProcessorParameter] -> ShowS
$cshowList :: [ProcessorParameter] -> ShowS
show :: ProcessorParameter -> String
$cshow :: ProcessorParameter -> String
showsPrec :: Int -> ProcessorParameter -> ShowS
$cshowsPrec :: Int -> ProcessorParameter -> ShowS
Prelude.Show, forall x. Rep ProcessorParameter x -> ProcessorParameter
forall x. ProcessorParameter -> Rep ProcessorParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProcessorParameter x -> ProcessorParameter
$cfrom :: forall x. ProcessorParameter -> Rep ProcessorParameter x
Prelude.Generic)
newProcessorParameter ::
ProcessorParameterName ->
Prelude.Text ->
ProcessorParameter
newProcessorParameter :: ProcessorParameterName -> Text -> ProcessorParameter
newProcessorParameter
ProcessorParameterName
pParameterName_
Text
pParameterValue_ =
ProcessorParameter'
{ $sel:parameterName:ProcessorParameter' :: ProcessorParameterName
parameterName =
ProcessorParameterName
pParameterName_,
$sel:parameterValue:ProcessorParameter' :: Text
parameterValue = Text
pParameterValue_
}
processorParameter_parameterName :: Lens.Lens' ProcessorParameter ProcessorParameterName
processorParameter_parameterName :: Lens' ProcessorParameter ProcessorParameterName
processorParameter_parameterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessorParameter' {ProcessorParameterName
parameterName :: ProcessorParameterName
$sel:parameterName:ProcessorParameter' :: ProcessorParameter -> ProcessorParameterName
parameterName} -> ProcessorParameterName
parameterName) (\s :: ProcessorParameter
s@ProcessorParameter' {} ProcessorParameterName
a -> ProcessorParameter
s {$sel:parameterName:ProcessorParameter' :: ProcessorParameterName
parameterName = ProcessorParameterName
a} :: ProcessorParameter)
processorParameter_parameterValue :: Lens.Lens' ProcessorParameter Prelude.Text
processorParameter_parameterValue :: Lens' ProcessorParameter Text
processorParameter_parameterValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessorParameter' {Text
parameterValue :: Text
$sel:parameterValue:ProcessorParameter' :: ProcessorParameter -> Text
parameterValue} -> Text
parameterValue) (\s :: ProcessorParameter
s@ProcessorParameter' {} Text
a -> ProcessorParameter
s {$sel:parameterValue:ProcessorParameter' :: Text
parameterValue = Text
a} :: ProcessorParameter)
instance Data.FromJSON ProcessorParameter where
parseJSON :: Value -> Parser ProcessorParameter
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ProcessorParameter"
( \Object
x ->
ProcessorParameterName -> Text -> ProcessorParameter
ProcessorParameter'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ParameterName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ParameterValue")
)
instance Prelude.Hashable ProcessorParameter where
hashWithSalt :: Int -> ProcessorParameter -> Int
hashWithSalt Int
_salt ProcessorParameter' {Text
ProcessorParameterName
parameterValue :: Text
parameterName :: ProcessorParameterName
$sel:parameterValue:ProcessorParameter' :: ProcessorParameter -> Text
$sel:parameterName:ProcessorParameter' :: ProcessorParameter -> ProcessorParameterName
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ProcessorParameterName
parameterName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
parameterValue
instance Prelude.NFData ProcessorParameter where
rnf :: ProcessorParameter -> ()
rnf ProcessorParameter' {Text
ProcessorParameterName
parameterValue :: Text
parameterName :: ProcessorParameterName
$sel:parameterValue:ProcessorParameter' :: ProcessorParameter -> Text
$sel:parameterName:ProcessorParameter' :: ProcessorParameter -> ProcessorParameterName
..} =
forall a. NFData a => a -> ()
Prelude.rnf ProcessorParameterName
parameterName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
parameterValue
instance Data.ToJSON ProcessorParameter where
toJSON :: ProcessorParameter -> Value
toJSON ProcessorParameter' {Text
ProcessorParameterName
parameterValue :: Text
parameterName :: ProcessorParameterName
$sel:parameterValue:ProcessorParameter' :: ProcessorParameter -> Text
$sel:parameterName:ProcessorParameter' :: ProcessorParameter -> ProcessorParameterName
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"ParameterName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ProcessorParameterName
parameterName),
forall a. a -> Maybe a
Prelude.Just
(Key
"ParameterValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
parameterValue)
]
)