{-# 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.Glue.Types.CodeGenEdge where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CodeGenEdge = CodeGenEdge'
{
CodeGenEdge -> Maybe Text
targetParameter :: Prelude.Maybe Prelude.Text,
CodeGenEdge -> Text
source :: Prelude.Text,
CodeGenEdge -> Text
target :: Prelude.Text
}
deriving (CodeGenEdge -> CodeGenEdge -> Bool
(CodeGenEdge -> CodeGenEdge -> Bool)
-> (CodeGenEdge -> CodeGenEdge -> Bool) -> Eq CodeGenEdge
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CodeGenEdge -> CodeGenEdge -> Bool
$c/= :: CodeGenEdge -> CodeGenEdge -> Bool
== :: CodeGenEdge -> CodeGenEdge -> Bool
$c== :: CodeGenEdge -> CodeGenEdge -> Bool
Prelude.Eq, ReadPrec [CodeGenEdge]
ReadPrec CodeGenEdge
Int -> ReadS CodeGenEdge
ReadS [CodeGenEdge]
(Int -> ReadS CodeGenEdge)
-> ReadS [CodeGenEdge]
-> ReadPrec CodeGenEdge
-> ReadPrec [CodeGenEdge]
-> Read CodeGenEdge
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CodeGenEdge]
$creadListPrec :: ReadPrec [CodeGenEdge]
readPrec :: ReadPrec CodeGenEdge
$creadPrec :: ReadPrec CodeGenEdge
readList :: ReadS [CodeGenEdge]
$creadList :: ReadS [CodeGenEdge]
readsPrec :: Int -> ReadS CodeGenEdge
$creadsPrec :: Int -> ReadS CodeGenEdge
Prelude.Read, Int -> CodeGenEdge -> ShowS
[CodeGenEdge] -> ShowS
CodeGenEdge -> String
(Int -> CodeGenEdge -> ShowS)
-> (CodeGenEdge -> String)
-> ([CodeGenEdge] -> ShowS)
-> Show CodeGenEdge
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CodeGenEdge] -> ShowS
$cshowList :: [CodeGenEdge] -> ShowS
show :: CodeGenEdge -> String
$cshow :: CodeGenEdge -> String
showsPrec :: Int -> CodeGenEdge -> ShowS
$cshowsPrec :: Int -> CodeGenEdge -> ShowS
Prelude.Show, (forall x. CodeGenEdge -> Rep CodeGenEdge x)
-> (forall x. Rep CodeGenEdge x -> CodeGenEdge)
-> Generic CodeGenEdge
forall x. Rep CodeGenEdge x -> CodeGenEdge
forall x. CodeGenEdge -> Rep CodeGenEdge x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CodeGenEdge x -> CodeGenEdge
$cfrom :: forall x. CodeGenEdge -> Rep CodeGenEdge x
Prelude.Generic)
newCodeGenEdge ::
Prelude.Text ->
Prelude.Text ->
CodeGenEdge
newCodeGenEdge :: Text -> Text -> CodeGenEdge
newCodeGenEdge Text
pSource_ Text
pTarget_ =
CodeGenEdge' :: Maybe Text -> Text -> Text -> CodeGenEdge
CodeGenEdge'
{ $sel:targetParameter:CodeGenEdge' :: Maybe Text
targetParameter = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:source:CodeGenEdge' :: Text
source = Text
pSource_,
$sel:target:CodeGenEdge' :: Text
target = Text
pTarget_
}
codeGenEdge_targetParameter :: Lens.Lens' CodeGenEdge (Prelude.Maybe Prelude.Text)
codeGenEdge_targetParameter :: (Maybe Text -> f (Maybe Text)) -> CodeGenEdge -> f CodeGenEdge
codeGenEdge_targetParameter = (CodeGenEdge -> Maybe Text)
-> (CodeGenEdge -> Maybe Text -> CodeGenEdge)
-> Lens CodeGenEdge CodeGenEdge (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeGenEdge' {Maybe Text
targetParameter :: Maybe Text
$sel:targetParameter:CodeGenEdge' :: CodeGenEdge -> Maybe Text
targetParameter} -> Maybe Text
targetParameter) (\s :: CodeGenEdge
s@CodeGenEdge' {} Maybe Text
a -> CodeGenEdge
s {$sel:targetParameter:CodeGenEdge' :: Maybe Text
targetParameter = Maybe Text
a} :: CodeGenEdge)
codeGenEdge_source :: Lens.Lens' CodeGenEdge Prelude.Text
codeGenEdge_source :: (Text -> f Text) -> CodeGenEdge -> f CodeGenEdge
codeGenEdge_source = (CodeGenEdge -> Text)
-> (CodeGenEdge -> Text -> CodeGenEdge)
-> Lens CodeGenEdge CodeGenEdge Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeGenEdge' {Text
source :: Text
$sel:source:CodeGenEdge' :: CodeGenEdge -> Text
source} -> Text
source) (\s :: CodeGenEdge
s@CodeGenEdge' {} Text
a -> CodeGenEdge
s {$sel:source:CodeGenEdge' :: Text
source = Text
a} :: CodeGenEdge)
codeGenEdge_target :: Lens.Lens' CodeGenEdge Prelude.Text
codeGenEdge_target :: (Text -> f Text) -> CodeGenEdge -> f CodeGenEdge
codeGenEdge_target = (CodeGenEdge -> Text)
-> (CodeGenEdge -> Text -> CodeGenEdge)
-> Lens CodeGenEdge CodeGenEdge Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CodeGenEdge' {Text
target :: Text
$sel:target:CodeGenEdge' :: CodeGenEdge -> Text
target} -> Text
target) (\s :: CodeGenEdge
s@CodeGenEdge' {} Text
a -> CodeGenEdge
s {$sel:target:CodeGenEdge' :: Text
target = Text
a} :: CodeGenEdge)
instance Core.FromJSON CodeGenEdge where
parseJSON :: Value -> Parser CodeGenEdge
parseJSON =
String
-> (Object -> Parser CodeGenEdge) -> Value -> Parser CodeGenEdge
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CodeGenEdge"
( \Object
x ->
Maybe Text -> Text -> Text -> CodeGenEdge
CodeGenEdge'
(Maybe Text -> Text -> Text -> CodeGenEdge)
-> Parser (Maybe Text) -> Parser (Text -> Text -> CodeGenEdge)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TargetParameter")
Parser (Text -> Text -> CodeGenEdge)
-> Parser Text -> Parser (Text -> CodeGenEdge)
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
"Source")
Parser (Text -> CodeGenEdge) -> Parser Text -> Parser CodeGenEdge
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
"Target")
)
instance Prelude.Hashable CodeGenEdge
instance Prelude.NFData CodeGenEdge
instance Core.ToJSON CodeGenEdge where
toJSON :: CodeGenEdge -> Value
toJSON CodeGenEdge' {Maybe Text
Text
target :: Text
source :: Text
targetParameter :: Maybe Text
$sel:target:CodeGenEdge' :: CodeGenEdge -> Text
$sel:source:CodeGenEdge' :: CodeGenEdge -> Text
$sel:targetParameter:CodeGenEdge' :: CodeGenEdge -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TargetParameter" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
targetParameter,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Source" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
source),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Target" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
target)
]
)