{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SageMaker.Types.Vertex
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.Vertex 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.LineageType

-- | A lineage entity connected to the starting entity(ies).
--
-- /See:/ 'newVertex' smart constructor.
data Vertex = Vertex'
  { -- | The Amazon Resource Name (ARN) of the lineage entity resource.
    Vertex -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The type of resource of the lineage entity.
    Vertex -> Maybe LineageType
lineageType :: Prelude.Maybe LineageType,
    -- | The type of the lineage entity resource. For example: @DataSet@,
    -- @Model@, @Endpoint@, etc...
    Vertex -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
  }
  deriving (Vertex -> Vertex -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Vertex -> Vertex -> Bool
$c/= :: Vertex -> Vertex -> Bool
== :: Vertex -> Vertex -> Bool
$c== :: Vertex -> Vertex -> Bool
Prelude.Eq, ReadPrec [Vertex]
ReadPrec Vertex
Int -> ReadS Vertex
ReadS [Vertex]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Vertex]
$creadListPrec :: ReadPrec [Vertex]
readPrec :: ReadPrec Vertex
$creadPrec :: ReadPrec Vertex
readList :: ReadS [Vertex]
$creadList :: ReadS [Vertex]
readsPrec :: Int -> ReadS Vertex
$creadsPrec :: Int -> ReadS Vertex
Prelude.Read, Int -> Vertex -> ShowS
[Vertex] -> ShowS
Vertex -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Vertex] -> ShowS
$cshowList :: [Vertex] -> ShowS
show :: Vertex -> String
$cshow :: Vertex -> String
showsPrec :: Int -> Vertex -> ShowS
$cshowsPrec :: Int -> Vertex -> ShowS
Prelude.Show, forall x. Rep Vertex x -> Vertex
forall x. Vertex -> Rep Vertex x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Vertex x -> Vertex
$cfrom :: forall x. Vertex -> Rep Vertex x
Prelude.Generic)

-- |
-- Create a value of 'Vertex' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'arn', 'vertex_arn' - The Amazon Resource Name (ARN) of the lineage entity resource.
--
-- 'lineageType', 'vertex_lineageType' - The type of resource of the lineage entity.
--
-- 'type'', 'vertex_type' - The type of the lineage entity resource. For example: @DataSet@,
-- @Model@, @Endpoint@, etc...
newVertex ::
  Vertex
newVertex :: Vertex
newVertex =
  Vertex'
    { $sel:arn:Vertex' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:lineageType:Vertex' :: Maybe LineageType
lineageType = forall a. Maybe a
Prelude.Nothing,
      $sel:type':Vertex' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the lineage entity resource.
vertex_arn :: Lens.Lens' Vertex (Prelude.Maybe Prelude.Text)
vertex_arn :: Lens' Vertex (Maybe Text)
vertex_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vertex' {Maybe Text
arn :: Maybe Text
$sel:arn:Vertex' :: Vertex -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Vertex
s@Vertex' {} Maybe Text
a -> Vertex
s {$sel:arn:Vertex' :: Maybe Text
arn = Maybe Text
a} :: Vertex)

-- | The type of resource of the lineage entity.
vertex_lineageType :: Lens.Lens' Vertex (Prelude.Maybe LineageType)
vertex_lineageType :: Lens' Vertex (Maybe LineageType)
vertex_lineageType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vertex' {Maybe LineageType
lineageType :: Maybe LineageType
$sel:lineageType:Vertex' :: Vertex -> Maybe LineageType
lineageType} -> Maybe LineageType
lineageType) (\s :: Vertex
s@Vertex' {} Maybe LineageType
a -> Vertex
s {$sel:lineageType:Vertex' :: Maybe LineageType
lineageType = Maybe LineageType
a} :: Vertex)

-- | The type of the lineage entity resource. For example: @DataSet@,
-- @Model@, @Endpoint@, etc...
vertex_type :: Lens.Lens' Vertex (Prelude.Maybe Prelude.Text)
vertex_type :: Lens' Vertex (Maybe Text)
vertex_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Vertex' {Maybe Text
type' :: Maybe Text
$sel:type':Vertex' :: Vertex -> Maybe Text
type'} -> Maybe Text
type') (\s :: Vertex
s@Vertex' {} Maybe Text
a -> Vertex
s {$sel:type':Vertex' :: Maybe Text
type' = Maybe Text
a} :: Vertex)

instance Data.FromJSON Vertex where
  parseJSON :: Value -> Parser Vertex
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Vertex"
      ( \Object
x ->
          Maybe Text -> Maybe LineageType -> Maybe Text -> Vertex
Vertex'
            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
"Arn")
            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
"LineageType")
            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
"Type")
      )

instance Prelude.Hashable Vertex where
  hashWithSalt :: Int -> Vertex -> Int
hashWithSalt Int
_salt Vertex' {Maybe Text
Maybe LineageType
type' :: Maybe Text
lineageType :: Maybe LineageType
arn :: Maybe Text
$sel:type':Vertex' :: Vertex -> Maybe Text
$sel:lineageType:Vertex' :: Vertex -> Maybe LineageType
$sel:arn:Vertex' :: Vertex -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LineageType
lineageType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'

instance Prelude.NFData Vertex where
  rnf :: Vertex -> ()
rnf Vertex' {Maybe Text
Maybe LineageType
type' :: Maybe Text
lineageType :: Maybe LineageType
arn :: Maybe Text
$sel:type':Vertex' :: Vertex -> Maybe Text
$sel:lineageType:Vertex' :: Vertex -> Maybe LineageType
$sel:arn:Vertex' :: Vertex -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LineageType
lineageType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'