{-# 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.AssociationSummary
-- 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.AssociationSummary 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
import Amazonka.SageMaker.Types.UserContext

-- | Lists a summary of the properties of an association. An association is
-- an entity that links other lineage or experiment entities. An example
-- would be an association between a training job and a model.
--
-- /See:/ 'newAssociationSummary' smart constructor.
data AssociationSummary = AssociationSummary'
  { -- | The type of the association.
    AssociationSummary -> Maybe AssociationEdgeType
associationType :: Prelude.Maybe AssociationEdgeType,
    AssociationSummary -> Maybe UserContext
createdBy :: Prelude.Maybe UserContext,
    -- | When the association was created.
    AssociationSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Name (ARN) of the destination.
    AssociationSummary -> Maybe Text
destinationArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the destination.
    AssociationSummary -> Maybe Text
destinationName :: Prelude.Maybe Prelude.Text,
    -- | The destination type.
    AssociationSummary -> Maybe Text
destinationType :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the source.
    AssociationSummary -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the source.
    AssociationSummary -> Maybe Text
sourceName :: Prelude.Maybe Prelude.Text,
    -- | The source type.
    AssociationSummary -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text
  }
  deriving (AssociationSummary -> AssociationSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociationSummary -> AssociationSummary -> Bool
$c/= :: AssociationSummary -> AssociationSummary -> Bool
== :: AssociationSummary -> AssociationSummary -> Bool
$c== :: AssociationSummary -> AssociationSummary -> Bool
Prelude.Eq, ReadPrec [AssociationSummary]
ReadPrec AssociationSummary
Int -> ReadS AssociationSummary
ReadS [AssociationSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociationSummary]
$creadListPrec :: ReadPrec [AssociationSummary]
readPrec :: ReadPrec AssociationSummary
$creadPrec :: ReadPrec AssociationSummary
readList :: ReadS [AssociationSummary]
$creadList :: ReadS [AssociationSummary]
readsPrec :: Int -> ReadS AssociationSummary
$creadsPrec :: Int -> ReadS AssociationSummary
Prelude.Read, Int -> AssociationSummary -> ShowS
[AssociationSummary] -> ShowS
AssociationSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociationSummary] -> ShowS
$cshowList :: [AssociationSummary] -> ShowS
show :: AssociationSummary -> String
$cshow :: AssociationSummary -> String
showsPrec :: Int -> AssociationSummary -> ShowS
$cshowsPrec :: Int -> AssociationSummary -> ShowS
Prelude.Show, forall x. Rep AssociationSummary x -> AssociationSummary
forall x. AssociationSummary -> Rep AssociationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociationSummary x -> AssociationSummary
$cfrom :: forall x. AssociationSummary -> Rep AssociationSummary x
Prelude.Generic)

-- |
-- Create a value of 'AssociationSummary' 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:
--
-- 'associationType', 'associationSummary_associationType' - The type of the association.
--
-- 'createdBy', 'associationSummary_createdBy' - Undocumented member.
--
-- 'creationTime', 'associationSummary_creationTime' - When the association was created.
--
-- 'destinationArn', 'associationSummary_destinationArn' - The Amazon Resource Name (ARN) of the destination.
--
-- 'destinationName', 'associationSummary_destinationName' - The name of the destination.
--
-- 'destinationType', 'associationSummary_destinationType' - The destination type.
--
-- 'sourceArn', 'associationSummary_sourceArn' - The ARN of the source.
--
-- 'sourceName', 'associationSummary_sourceName' - The name of the source.
--
-- 'sourceType', 'associationSummary_sourceType' - The source type.
newAssociationSummary ::
  AssociationSummary
newAssociationSummary :: AssociationSummary
newAssociationSummary =
  AssociationSummary'
    { $sel:associationType:AssociationSummary' :: Maybe AssociationEdgeType
associationType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:AssociationSummary' :: Maybe UserContext
createdBy = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:AssociationSummary' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:destinationArn:AssociationSummary' :: Maybe Text
destinationArn = forall a. Maybe a
Prelude.Nothing,
      $sel:destinationName:AssociationSummary' :: Maybe Text
destinationName = forall a. Maybe a
Prelude.Nothing,
      $sel:destinationType:AssociationSummary' :: Maybe Text
destinationType = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:AssociationSummary' :: Maybe Text
sourceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceName:AssociationSummary' :: Maybe Text
sourceName = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceType:AssociationSummary' :: Maybe Text
sourceType = forall a. Maybe a
Prelude.Nothing
    }

-- | The type of the association.
associationSummary_associationType :: Lens.Lens' AssociationSummary (Prelude.Maybe AssociationEdgeType)
associationSummary_associationType :: Lens' AssociationSummary (Maybe AssociationEdgeType)
associationSummary_associationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationSummary' {Maybe AssociationEdgeType
associationType :: Maybe AssociationEdgeType
$sel:associationType:AssociationSummary' :: AssociationSummary -> Maybe AssociationEdgeType
associationType} -> Maybe AssociationEdgeType
associationType) (\s :: AssociationSummary
s@AssociationSummary' {} Maybe AssociationEdgeType
a -> AssociationSummary
s {$sel:associationType:AssociationSummary' :: Maybe AssociationEdgeType
associationType = Maybe AssociationEdgeType
a} :: AssociationSummary)

-- | Undocumented member.
associationSummary_createdBy :: Lens.Lens' AssociationSummary (Prelude.Maybe UserContext)
associationSummary_createdBy :: Lens' AssociationSummary (Maybe UserContext)
associationSummary_createdBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationSummary' {Maybe UserContext
createdBy :: Maybe UserContext
$sel:createdBy:AssociationSummary' :: AssociationSummary -> Maybe UserContext
createdBy} -> Maybe UserContext
createdBy) (\s :: AssociationSummary
s@AssociationSummary' {} Maybe UserContext
a -> AssociationSummary
s {$sel:createdBy:AssociationSummary' :: Maybe UserContext
createdBy = Maybe UserContext
a} :: AssociationSummary)

-- | When the association was created.
associationSummary_creationTime :: Lens.Lens' AssociationSummary (Prelude.Maybe Prelude.UTCTime)
associationSummary_creationTime :: Lens' AssociationSummary (Maybe UTCTime)
associationSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:AssociationSummary' :: AssociationSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: AssociationSummary
s@AssociationSummary' {} Maybe POSIX
a -> AssociationSummary
s {$sel:creationTime:AssociationSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: AssociationSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The Amazon Resource Name (ARN) of the destination.
associationSummary_destinationArn :: Lens.Lens' AssociationSummary (Prelude.Maybe Prelude.Text)
associationSummary_destinationArn :: Lens' AssociationSummary (Maybe Text)
associationSummary_destinationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationSummary' {Maybe Text
destinationArn :: Maybe Text
$sel:destinationArn:AssociationSummary' :: AssociationSummary -> Maybe Text
destinationArn} -> Maybe Text
destinationArn) (\s :: AssociationSummary
s@AssociationSummary' {} Maybe Text
a -> AssociationSummary
s {$sel:destinationArn:AssociationSummary' :: Maybe Text
destinationArn = Maybe Text
a} :: AssociationSummary)

-- | The name of the destination.
associationSummary_destinationName :: Lens.Lens' AssociationSummary (Prelude.Maybe Prelude.Text)
associationSummary_destinationName :: Lens' AssociationSummary (Maybe Text)
associationSummary_destinationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationSummary' {Maybe Text
destinationName :: Maybe Text
$sel:destinationName:AssociationSummary' :: AssociationSummary -> Maybe Text
destinationName} -> Maybe Text
destinationName) (\s :: AssociationSummary
s@AssociationSummary' {} Maybe Text
a -> AssociationSummary
s {$sel:destinationName:AssociationSummary' :: Maybe Text
destinationName = Maybe Text
a} :: AssociationSummary)

-- | The destination type.
associationSummary_destinationType :: Lens.Lens' AssociationSummary (Prelude.Maybe Prelude.Text)
associationSummary_destinationType :: Lens' AssociationSummary (Maybe Text)
associationSummary_destinationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationSummary' {Maybe Text
destinationType :: Maybe Text
$sel:destinationType:AssociationSummary' :: AssociationSummary -> Maybe Text
destinationType} -> Maybe Text
destinationType) (\s :: AssociationSummary
s@AssociationSummary' {} Maybe Text
a -> AssociationSummary
s {$sel:destinationType:AssociationSummary' :: Maybe Text
destinationType = Maybe Text
a} :: AssociationSummary)

-- | The ARN of the source.
associationSummary_sourceArn :: Lens.Lens' AssociationSummary (Prelude.Maybe Prelude.Text)
associationSummary_sourceArn :: Lens' AssociationSummary (Maybe Text)
associationSummary_sourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationSummary' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:AssociationSummary' :: AssociationSummary -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: AssociationSummary
s@AssociationSummary' {} Maybe Text
a -> AssociationSummary
s {$sel:sourceArn:AssociationSummary' :: Maybe Text
sourceArn = Maybe Text
a} :: AssociationSummary)

-- | The name of the source.
associationSummary_sourceName :: Lens.Lens' AssociationSummary (Prelude.Maybe Prelude.Text)
associationSummary_sourceName :: Lens' AssociationSummary (Maybe Text)
associationSummary_sourceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationSummary' {Maybe Text
sourceName :: Maybe Text
$sel:sourceName:AssociationSummary' :: AssociationSummary -> Maybe Text
sourceName} -> Maybe Text
sourceName) (\s :: AssociationSummary
s@AssociationSummary' {} Maybe Text
a -> AssociationSummary
s {$sel:sourceName:AssociationSummary' :: Maybe Text
sourceName = Maybe Text
a} :: AssociationSummary)

-- | The source type.
associationSummary_sourceType :: Lens.Lens' AssociationSummary (Prelude.Maybe Prelude.Text)
associationSummary_sourceType :: Lens' AssociationSummary (Maybe Text)
associationSummary_sourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociationSummary' {Maybe Text
sourceType :: Maybe Text
$sel:sourceType:AssociationSummary' :: AssociationSummary -> Maybe Text
sourceType} -> Maybe Text
sourceType) (\s :: AssociationSummary
s@AssociationSummary' {} Maybe Text
a -> AssociationSummary
s {$sel:sourceType:AssociationSummary' :: Maybe Text
sourceType = Maybe Text
a} :: AssociationSummary)

instance Data.FromJSON AssociationSummary where
  parseJSON :: Value -> Parser AssociationSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AssociationSummary"
      ( \Object
x ->
          Maybe AssociationEdgeType
-> Maybe UserContext
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AssociationSummary
AssociationSummary'
            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
"CreatedBy")
            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
"CreationTime")
            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
"DestinationName")
            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
"DestinationType")
            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")
            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
"SourceName")
            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
"SourceType")
      )

instance Prelude.Hashable AssociationSummary where
  hashWithSalt :: Int -> AssociationSummary -> Int
hashWithSalt Int
_salt AssociationSummary' {Maybe Text
Maybe POSIX
Maybe AssociationEdgeType
Maybe UserContext
sourceType :: Maybe Text
sourceName :: Maybe Text
sourceArn :: Maybe Text
destinationType :: Maybe Text
destinationName :: Maybe Text
destinationArn :: Maybe Text
creationTime :: Maybe POSIX
createdBy :: Maybe UserContext
associationType :: Maybe AssociationEdgeType
$sel:sourceType:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:sourceName:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:sourceArn:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:destinationType:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:destinationName:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:destinationArn:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:creationTime:AssociationSummary' :: AssociationSummary -> Maybe POSIX
$sel:createdBy:AssociationSummary' :: AssociationSummary -> Maybe UserContext
$sel:associationType:AssociationSummary' :: AssociationSummary -> 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 UserContext
createdBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destinationType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceType

instance Prelude.NFData AssociationSummary where
  rnf :: AssociationSummary -> ()
rnf AssociationSummary' {Maybe Text
Maybe POSIX
Maybe AssociationEdgeType
Maybe UserContext
sourceType :: Maybe Text
sourceName :: Maybe Text
sourceArn :: Maybe Text
destinationType :: Maybe Text
destinationName :: Maybe Text
destinationArn :: Maybe Text
creationTime :: Maybe POSIX
createdBy :: Maybe UserContext
associationType :: Maybe AssociationEdgeType
$sel:sourceType:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:sourceName:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:sourceArn:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:destinationType:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:destinationName:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:destinationArn:AssociationSummary' :: AssociationSummary -> Maybe Text
$sel:creationTime:AssociationSummary' :: AssociationSummary -> Maybe POSIX
$sel:createdBy:AssociationSummary' :: AssociationSummary -> Maybe UserContext
$sel:associationType:AssociationSummary' :: AssociationSummary -> 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 UserContext
createdBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      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
destinationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destinationType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceType