{-# 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 Amazonka.Firehose.Types.ProcessorParameterName
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ProcessorParameter = ProcessorParameter'
{
ProcessorParameter -> ProcessorParameterName
parameterName :: ProcessorParameterName,
ProcessorParameter -> Text
parameterValue :: Prelude.Text
}
deriving (ProcessorParameter -> ProcessorParameter -> Bool
(ProcessorParameter -> ProcessorParameter -> Bool)
-> (ProcessorParameter -> ProcessorParameter -> Bool)
-> Eq ProcessorParameter
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]
(Int -> ReadS ProcessorParameter)
-> ReadS [ProcessorParameter]
-> ReadPrec ProcessorParameter
-> ReadPrec [ProcessorParameter]
-> Read 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
(Int -> ProcessorParameter -> ShowS)
-> (ProcessorParameter -> String)
-> ([ProcessorParameter] -> ShowS)
-> Show ProcessorParameter
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. ProcessorParameter -> Rep ProcessorParameter x)
-> (forall x. Rep ProcessorParameter x -> ProcessorParameter)
-> Generic ProcessorParameter
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' :: ProcessorParameterName -> Text -> ProcessorParameter
ProcessorParameter'
{ $sel:parameterName:ProcessorParameter' :: ProcessorParameterName
parameterName =
ProcessorParameterName
pParameterName_,
$sel:parameterValue:ProcessorParameter' :: Text
parameterValue = Text
pParameterValue_
}
processorParameter_parameterName :: Lens.Lens' ProcessorParameter ProcessorParameterName
processorParameter_parameterName :: (ProcessorParameterName -> f ProcessorParameterName)
-> ProcessorParameter -> f ProcessorParameter
processorParameter_parameterName = (ProcessorParameter -> ProcessorParameterName)
-> (ProcessorParameter
-> ProcessorParameterName -> ProcessorParameter)
-> Lens
ProcessorParameter
ProcessorParameter
ProcessorParameterName
ProcessorParameterName
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 :: (Text -> f Text) -> ProcessorParameter -> f ProcessorParameter
processorParameter_parameterValue = (ProcessorParameter -> Text)
-> (ProcessorParameter -> Text -> ProcessorParameter)
-> Lens ProcessorParameter ProcessorParameter Text Text
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 Core.FromJSON ProcessorParameter where
parseJSON :: Value -> Parser ProcessorParameter
parseJSON =
String
-> (Object -> Parser ProcessorParameter)
-> Value
-> Parser ProcessorParameter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProcessorParameter"
( \Object
x ->
ProcessorParameterName -> Text -> ProcessorParameter
ProcessorParameter'
(ProcessorParameterName -> Text -> ProcessorParameter)
-> Parser ProcessorParameterName
-> Parser (Text -> ProcessorParameter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser ProcessorParameterName
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ParameterName")
Parser (Text -> ProcessorParameter)
-> Parser Text -> Parser ProcessorParameter
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ParameterValue")
)
instance Prelude.Hashable ProcessorParameter
instance Prelude.NFData ProcessorParameter
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ParameterName" Text -> ProcessorParameterName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ProcessorParameterName
parameterName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ParameterValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
parameterValue)
]
)