{-# 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.DataPipeline.Types.ParameterAttribute 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 ParameterAttribute = ParameterAttribute'
{
ParameterAttribute -> Text
key :: Prelude.Text,
ParameterAttribute -> Text
stringValue :: Prelude.Text
}
deriving (ParameterAttribute -> ParameterAttribute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterAttribute -> ParameterAttribute -> Bool
$c/= :: ParameterAttribute -> ParameterAttribute -> Bool
== :: ParameterAttribute -> ParameterAttribute -> Bool
$c== :: ParameterAttribute -> ParameterAttribute -> Bool
Prelude.Eq, ReadPrec [ParameterAttribute]
ReadPrec ParameterAttribute
Int -> ReadS ParameterAttribute
ReadS [ParameterAttribute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterAttribute]
$creadListPrec :: ReadPrec [ParameterAttribute]
readPrec :: ReadPrec ParameterAttribute
$creadPrec :: ReadPrec ParameterAttribute
readList :: ReadS [ParameterAttribute]
$creadList :: ReadS [ParameterAttribute]
readsPrec :: Int -> ReadS ParameterAttribute
$creadsPrec :: Int -> ReadS ParameterAttribute
Prelude.Read, Int -> ParameterAttribute -> ShowS
[ParameterAttribute] -> ShowS
ParameterAttribute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterAttribute] -> ShowS
$cshowList :: [ParameterAttribute] -> ShowS
show :: ParameterAttribute -> String
$cshow :: ParameterAttribute -> String
showsPrec :: Int -> ParameterAttribute -> ShowS
$cshowsPrec :: Int -> ParameterAttribute -> ShowS
Prelude.Show, forall x. Rep ParameterAttribute x -> ParameterAttribute
forall x. ParameterAttribute -> Rep ParameterAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterAttribute x -> ParameterAttribute
$cfrom :: forall x. ParameterAttribute -> Rep ParameterAttribute x
Prelude.Generic)
newParameterAttribute ::
Prelude.Text ->
Prelude.Text ->
ParameterAttribute
newParameterAttribute :: Text -> Text -> ParameterAttribute
newParameterAttribute Text
pKey_ Text
pStringValue_ =
ParameterAttribute'
{ $sel:key:ParameterAttribute' :: Text
key = Text
pKey_,
$sel:stringValue:ParameterAttribute' :: Text
stringValue = Text
pStringValue_
}
parameterAttribute_key :: Lens.Lens' ParameterAttribute Prelude.Text
parameterAttribute_key :: Lens' ParameterAttribute Text
parameterAttribute_key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterAttribute' {Text
key :: Text
$sel:key:ParameterAttribute' :: ParameterAttribute -> Text
key} -> Text
key) (\s :: ParameterAttribute
s@ParameterAttribute' {} Text
a -> ParameterAttribute
s {$sel:key:ParameterAttribute' :: Text
key = Text
a} :: ParameterAttribute)
parameterAttribute_stringValue :: Lens.Lens' ParameterAttribute Prelude.Text
parameterAttribute_stringValue :: Lens' ParameterAttribute Text
parameterAttribute_stringValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterAttribute' {Text
stringValue :: Text
$sel:stringValue:ParameterAttribute' :: ParameterAttribute -> Text
stringValue} -> Text
stringValue) (\s :: ParameterAttribute
s@ParameterAttribute' {} Text
a -> ParameterAttribute
s {$sel:stringValue:ParameterAttribute' :: Text
stringValue = Text
a} :: ParameterAttribute)
instance Data.FromJSON ParameterAttribute where
parseJSON :: Value -> Parser ParameterAttribute
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ParameterAttribute"
( \Object
x ->
Text -> Text -> ParameterAttribute
ParameterAttribute'
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
"key")
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
"stringValue")
)
instance Prelude.Hashable ParameterAttribute where
hashWithSalt :: Int -> ParameterAttribute -> Int
hashWithSalt Int
_salt ParameterAttribute' {Text
stringValue :: Text
key :: Text
$sel:stringValue:ParameterAttribute' :: ParameterAttribute -> Text
$sel:key:ParameterAttribute' :: ParameterAttribute -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stringValue
instance Prelude.NFData ParameterAttribute where
rnf :: ParameterAttribute -> ()
rnf ParameterAttribute' {Text
stringValue :: Text
key :: Text
$sel:stringValue:ParameterAttribute' :: ParameterAttribute -> Text
$sel:key:ParameterAttribute' :: ParameterAttribute -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
stringValue
instance Data.ToJSON ParameterAttribute where
toJSON :: ParameterAttribute -> Value
toJSON ParameterAttribute' {Text
stringValue :: Text
key :: Text
$sel:stringValue:ParameterAttribute' :: ParameterAttribute -> Text
$sel:key:ParameterAttribute' :: ParameterAttribute -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"key" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
key),
forall a. a -> Maybe a
Prelude.Just (Key
"stringValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
stringValue)
]
)