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