{-# 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.SageMaker.Types.Edge 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
import Amazonka.SageMaker.Types.AssociationEdgeType
data Edge = Edge'
{
Edge -> Maybe AssociationEdgeType
associationType :: Prelude.Maybe AssociationEdgeType,
Edge -> Maybe Text
destinationArn :: Prelude.Maybe Prelude.Text,
Edge -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text
}
deriving (Edge -> Edge -> Bool
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]
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
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. 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'
{ $sel:associationType:Edge' :: Maybe AssociationEdgeType
associationType = forall a. Maybe a
Prelude.Nothing,
$sel:destinationArn:Edge' :: Maybe Text
destinationArn = forall a. Maybe a
Prelude.Nothing,
$sel:sourceArn:Edge' :: Maybe Text
sourceArn = forall a. Maybe a
Prelude.Nothing
}
edge_associationType :: Lens.Lens' Edge (Prelude.Maybe AssociationEdgeType)
edge_associationType :: Lens' Edge (Maybe AssociationEdgeType)
edge_associationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Edge' {Maybe AssociationEdgeType
associationType :: Maybe AssociationEdgeType
$sel:associationType:Edge' :: Edge -> Maybe AssociationEdgeType
associationType} -> Maybe AssociationEdgeType
associationType) (\s :: Edge
s@Edge' {} Maybe AssociationEdgeType
a -> Edge
s {$sel:associationType:Edge' :: Maybe AssociationEdgeType
associationType = Maybe AssociationEdgeType
a} :: Edge)
edge_destinationArn :: Lens.Lens' Edge (Prelude.Maybe Prelude.Text)
edge_destinationArn :: Lens' Edge (Maybe Text)
edge_destinationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Edge' {Maybe Text
destinationArn :: Maybe Text
$sel:destinationArn:Edge' :: Edge -> Maybe Text
destinationArn} -> Maybe Text
destinationArn) (\s :: Edge
s@Edge' {} Maybe Text
a -> Edge
s {$sel:destinationArn:Edge' :: Maybe Text
destinationArn = Maybe Text
a} :: Edge)
edge_sourceArn :: Lens.Lens' Edge (Prelude.Maybe Prelude.Text)
edge_sourceArn :: Lens' Edge (Maybe Text)
edge_sourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Edge' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:Edge' :: Edge -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: Edge
s@Edge' {} Maybe Text
a -> Edge
s {$sel:sourceArn:Edge' :: Maybe Text
sourceArn = Maybe Text
a} :: Edge)
instance Data.FromJSON Edge where
parseJSON :: Value -> Parser Edge
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Edge"
( \Object
x ->
Maybe AssociationEdgeType -> Maybe Text -> Maybe Text -> Edge
Edge'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AssociationType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DestinationArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SourceArn")
)
instance Prelude.Hashable Edge where
hashWithSalt :: Int -> Edge -> Int
hashWithSalt Int
_salt Edge' {Maybe Text
Maybe AssociationEdgeType
sourceArn :: Maybe Text
destinationArn :: Maybe Text
associationType :: Maybe AssociationEdgeType
$sel:sourceArn:Edge' :: Edge -> Maybe Text
$sel:destinationArn:Edge' :: Edge -> Maybe Text
$sel:associationType:Edge' :: Edge -> Maybe AssociationEdgeType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssociationEdgeType
associationType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceArn
instance Prelude.NFData Edge where
rnf :: Edge -> ()
rnf Edge' {Maybe Text
Maybe AssociationEdgeType
sourceArn :: Maybe Text
destinationArn :: Maybe Text
associationType :: Maybe AssociationEdgeType
$sel:sourceArn:Edge' :: Edge -> Maybe Text
$sel:destinationArn:Edge' :: Edge -> Maybe Text
$sel:associationType:Edge' :: Edge -> Maybe AssociationEdgeType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AssociationEdgeType
associationType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destinationArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceArn