{-# 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.Edge where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Edge = Edge'
{
Edge -> Maybe Text
sourceId :: Prelude.Maybe Prelude.Text,
Edge -> Maybe Text
destinationId :: Prelude.Maybe Prelude.Text
}
deriving (Edge -> Edge -> Bool
(Edge -> Edge -> Bool) -> (Edge -> Edge -> Bool) -> Eq Edge
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Edge -> Edge -> Bool
$c/= :: Edge -> Edge -> Bool
== :: Edge -> Edge -> Bool
$c== :: Edge -> Edge -> Bool
Prelude.Eq, ReadPrec [Edge]
ReadPrec Edge
Int -> ReadS Edge
ReadS [Edge]
(Int -> ReadS Edge)
-> ReadS [Edge] -> ReadPrec Edge -> ReadPrec [Edge] -> Read Edge
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Edge]
$creadListPrec :: ReadPrec [Edge]
readPrec :: ReadPrec Edge
$creadPrec :: ReadPrec Edge
readList :: ReadS [Edge]
$creadList :: ReadS [Edge]
readsPrec :: Int -> ReadS Edge
$creadsPrec :: Int -> ReadS Edge
Prelude.Read, Int -> Edge -> ShowS
[Edge] -> ShowS
Edge -> String
(Int -> Edge -> ShowS)
-> (Edge -> String) -> ([Edge] -> ShowS) -> Show Edge
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Edge] -> ShowS
$cshowList :: [Edge] -> ShowS
show :: Edge -> String
$cshow :: Edge -> String
showsPrec :: Int -> Edge -> ShowS
$cshowsPrec :: Int -> Edge -> ShowS
Prelude.Show, (forall x. Edge -> Rep Edge x)
-> (forall x. Rep Edge x -> Edge) -> Generic Edge
forall x. Rep Edge x -> Edge
forall x. Edge -> Rep Edge x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Edge x -> Edge
$cfrom :: forall x. Edge -> Rep Edge x
Prelude.Generic)
newEdge ::
Edge
newEdge :: Edge
newEdge =
Edge' :: Maybe Text -> Maybe Text -> Edge
Edge'
{ $sel:sourceId:Edge' :: Maybe Text
sourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destinationId:Edge' :: Maybe Text
destinationId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
edge_sourceId :: Lens.Lens' Edge (Prelude.Maybe Prelude.Text)
edge_sourceId :: (Maybe Text -> f (Maybe Text)) -> Edge -> f Edge
edge_sourceId = (Edge -> Maybe Text)
-> (Edge -> Maybe Text -> Edge)
-> Lens Edge Edge (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Edge' {Maybe Text
sourceId :: Maybe Text
$sel:sourceId:Edge' :: Edge -> Maybe Text
sourceId} -> Maybe Text
sourceId) (\s :: Edge
s@Edge' {} Maybe Text
a -> Edge
s {$sel:sourceId:Edge' :: Maybe Text
sourceId = Maybe Text
a} :: Edge)
edge_destinationId :: Lens.Lens' Edge (Prelude.Maybe Prelude.Text)
edge_destinationId :: (Maybe Text -> f (Maybe Text)) -> Edge -> f Edge
edge_destinationId = (Edge -> Maybe Text)
-> (Edge -> Maybe Text -> Edge)
-> Lens Edge Edge (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Edge' {Maybe Text
destinationId :: Maybe Text
$sel:destinationId:Edge' :: Edge -> Maybe Text
destinationId} -> Maybe Text
destinationId) (\s :: Edge
s@Edge' {} Maybe Text
a -> Edge
s {$sel:destinationId:Edge' :: Maybe Text
destinationId = Maybe Text
a} :: Edge)
instance Core.FromJSON Edge where
parseJSON :: Value -> Parser Edge
parseJSON =
String -> (Object -> Parser Edge) -> Value -> Parser Edge
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Edge"
( \Object
x ->
Maybe Text -> Maybe Text -> Edge
Edge'
(Maybe Text -> Maybe Text -> Edge)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Edge)
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
"SourceId")
Parser (Maybe Text -> Edge) -> Parser (Maybe Text) -> Parser Edge
forall (f :: * -> *) a b. Applicative f => 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
"DestinationId")
)
instance Prelude.Hashable Edge
instance Prelude.NFData Edge