{-# 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.MechanicalTurk.Types.HITLayoutParameter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HITLayoutParameter = HITLayoutParameter'
{
HITLayoutParameter -> Text
name :: Prelude.Text,
HITLayoutParameter -> Text
value :: Prelude.Text
}
deriving (HITLayoutParameter -> HITLayoutParameter -> Bool
(HITLayoutParameter -> HITLayoutParameter -> Bool)
-> (HITLayoutParameter -> HITLayoutParameter -> Bool)
-> Eq HITLayoutParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HITLayoutParameter -> HITLayoutParameter -> Bool
$c/= :: HITLayoutParameter -> HITLayoutParameter -> Bool
== :: HITLayoutParameter -> HITLayoutParameter -> Bool
$c== :: HITLayoutParameter -> HITLayoutParameter -> Bool
Prelude.Eq, ReadPrec [HITLayoutParameter]
ReadPrec HITLayoutParameter
Int -> ReadS HITLayoutParameter
ReadS [HITLayoutParameter]
(Int -> ReadS HITLayoutParameter)
-> ReadS [HITLayoutParameter]
-> ReadPrec HITLayoutParameter
-> ReadPrec [HITLayoutParameter]
-> Read HITLayoutParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HITLayoutParameter]
$creadListPrec :: ReadPrec [HITLayoutParameter]
readPrec :: ReadPrec HITLayoutParameter
$creadPrec :: ReadPrec HITLayoutParameter
readList :: ReadS [HITLayoutParameter]
$creadList :: ReadS [HITLayoutParameter]
readsPrec :: Int -> ReadS HITLayoutParameter
$creadsPrec :: Int -> ReadS HITLayoutParameter
Prelude.Read, Int -> HITLayoutParameter -> ShowS
[HITLayoutParameter] -> ShowS
HITLayoutParameter -> String
(Int -> HITLayoutParameter -> ShowS)
-> (HITLayoutParameter -> String)
-> ([HITLayoutParameter] -> ShowS)
-> Show HITLayoutParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HITLayoutParameter] -> ShowS
$cshowList :: [HITLayoutParameter] -> ShowS
show :: HITLayoutParameter -> String
$cshow :: HITLayoutParameter -> String
showsPrec :: Int -> HITLayoutParameter -> ShowS
$cshowsPrec :: Int -> HITLayoutParameter -> ShowS
Prelude.Show, (forall x. HITLayoutParameter -> Rep HITLayoutParameter x)
-> (forall x. Rep HITLayoutParameter x -> HITLayoutParameter)
-> Generic HITLayoutParameter
forall x. Rep HITLayoutParameter x -> HITLayoutParameter
forall x. HITLayoutParameter -> Rep HITLayoutParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HITLayoutParameter x -> HITLayoutParameter
$cfrom :: forall x. HITLayoutParameter -> Rep HITLayoutParameter x
Prelude.Generic)
newHITLayoutParameter ::
Prelude.Text ->
Prelude.Text ->
HITLayoutParameter
newHITLayoutParameter :: Text -> Text -> HITLayoutParameter
newHITLayoutParameter Text
pName_ Text
pValue_ =
HITLayoutParameter' :: Text -> Text -> HITLayoutParameter
HITLayoutParameter' {$sel:name:HITLayoutParameter' :: Text
name = Text
pName_, $sel:value:HITLayoutParameter' :: Text
value = Text
pValue_}
hITLayoutParameter_name :: Lens.Lens' HITLayoutParameter Prelude.Text
hITLayoutParameter_name :: (Text -> f Text) -> HITLayoutParameter -> f HITLayoutParameter
hITLayoutParameter_name = (HITLayoutParameter -> Text)
-> (HITLayoutParameter -> Text -> HITLayoutParameter)
-> Lens HITLayoutParameter HITLayoutParameter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HITLayoutParameter' {Text
name :: Text
$sel:name:HITLayoutParameter' :: HITLayoutParameter -> Text
name} -> Text
name) (\s :: HITLayoutParameter
s@HITLayoutParameter' {} Text
a -> HITLayoutParameter
s {$sel:name:HITLayoutParameter' :: Text
name = Text
a} :: HITLayoutParameter)
hITLayoutParameter_value :: Lens.Lens' HITLayoutParameter Prelude.Text
hITLayoutParameter_value :: (Text -> f Text) -> HITLayoutParameter -> f HITLayoutParameter
hITLayoutParameter_value = (HITLayoutParameter -> Text)
-> (HITLayoutParameter -> Text -> HITLayoutParameter)
-> Lens HITLayoutParameter HITLayoutParameter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HITLayoutParameter' {Text
value :: Text
$sel:value:HITLayoutParameter' :: HITLayoutParameter -> Text
value} -> Text
value) (\s :: HITLayoutParameter
s@HITLayoutParameter' {} Text
a -> HITLayoutParameter
s {$sel:value:HITLayoutParameter' :: Text
value = Text
a} :: HITLayoutParameter)
instance Prelude.Hashable HITLayoutParameter
instance Prelude.NFData HITLayoutParameter
instance Core.ToJSON HITLayoutParameter where
toJSON :: HITLayoutParameter -> Value
toJSON HITLayoutParameter' {Text
value :: Text
name :: Text
$sel:value:HITLayoutParameter' :: HITLayoutParameter -> Text
$sel:name:HITLayoutParameter' :: HITLayoutParameter -> Text
..} =
[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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
value)
]
)