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