{-# 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.ArtifactSummary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.ArtifactSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.ArtifactSource

-- | Lists a summary of the properties of an artifact. An artifact represents
-- a URI addressable object or data. Some examples are a dataset and a
-- model.
--
-- /See:/ 'newArtifactSummary' smart constructor.
data ArtifactSummary = ArtifactSummary'
  { -- | When the artifact was created.
    ArtifactSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | When the artifact was last modified.
    ArtifactSummary -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the artifact.
    ArtifactSummary -> Maybe Text
artifactName :: Prelude.Maybe Prelude.Text,
    -- | The source of the artifact.
    ArtifactSummary -> Maybe ArtifactSource
source :: Prelude.Maybe ArtifactSource,
    -- | The Amazon Resource Name (ARN) of the artifact.
    ArtifactSummary -> Maybe Text
artifactArn :: Prelude.Maybe Prelude.Text,
    -- | The type of the artifact.
    ArtifactSummary -> Maybe Text
artifactType :: Prelude.Maybe Prelude.Text
  }
  deriving (ArtifactSummary -> ArtifactSummary -> Bool
(ArtifactSummary -> ArtifactSummary -> Bool)
-> (ArtifactSummary -> ArtifactSummary -> Bool)
-> Eq ArtifactSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArtifactSummary -> ArtifactSummary -> Bool
$c/= :: ArtifactSummary -> ArtifactSummary -> Bool
== :: ArtifactSummary -> ArtifactSummary -> Bool
$c== :: ArtifactSummary -> ArtifactSummary -> Bool
Prelude.Eq, ReadPrec [ArtifactSummary]
ReadPrec ArtifactSummary
Int -> ReadS ArtifactSummary
ReadS [ArtifactSummary]
(Int -> ReadS ArtifactSummary)
-> ReadS [ArtifactSummary]
-> ReadPrec ArtifactSummary
-> ReadPrec [ArtifactSummary]
-> Read ArtifactSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ArtifactSummary]
$creadListPrec :: ReadPrec [ArtifactSummary]
readPrec :: ReadPrec ArtifactSummary
$creadPrec :: ReadPrec ArtifactSummary
readList :: ReadS [ArtifactSummary]
$creadList :: ReadS [ArtifactSummary]
readsPrec :: Int -> ReadS ArtifactSummary
$creadsPrec :: Int -> ReadS ArtifactSummary
Prelude.Read, Int -> ArtifactSummary -> ShowS
[ArtifactSummary] -> ShowS
ArtifactSummary -> String
(Int -> ArtifactSummary -> ShowS)
-> (ArtifactSummary -> String)
-> ([ArtifactSummary] -> ShowS)
-> Show ArtifactSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArtifactSummary] -> ShowS
$cshowList :: [ArtifactSummary] -> ShowS
show :: ArtifactSummary -> String
$cshow :: ArtifactSummary -> String
showsPrec :: Int -> ArtifactSummary -> ShowS
$cshowsPrec :: Int -> ArtifactSummary -> ShowS
Prelude.Show, (forall x. ArtifactSummary -> Rep ArtifactSummary x)
-> (forall x. Rep ArtifactSummary x -> ArtifactSummary)
-> Generic ArtifactSummary
forall x. Rep ArtifactSummary x -> ArtifactSummary
forall x. ArtifactSummary -> Rep ArtifactSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ArtifactSummary x -> ArtifactSummary
$cfrom :: forall x. ArtifactSummary -> Rep ArtifactSummary x
Prelude.Generic)

-- |
-- Create a value of 'ArtifactSummary' 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:
--
-- 'creationTime', 'artifactSummary_creationTime' - When the artifact was created.
--
-- 'lastModifiedTime', 'artifactSummary_lastModifiedTime' - When the artifact was last modified.
--
-- 'artifactName', 'artifactSummary_artifactName' - The name of the artifact.
--
-- 'source', 'artifactSummary_source' - The source of the artifact.
--
-- 'artifactArn', 'artifactSummary_artifactArn' - The Amazon Resource Name (ARN) of the artifact.
--
-- 'artifactType', 'artifactSummary_artifactType' - The type of the artifact.
newArtifactSummary ::
  ArtifactSummary
newArtifactSummary :: ArtifactSummary
newArtifactSummary =
  ArtifactSummary' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ArtifactSource
-> Maybe Text
-> Maybe Text
-> ArtifactSummary
ArtifactSummary'
    { $sel:creationTime:ArtifactSummary' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:ArtifactSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:artifactName:ArtifactSummary' :: Maybe Text
artifactName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:source:ArtifactSummary' :: Maybe ArtifactSource
source = Maybe ArtifactSource
forall a. Maybe a
Prelude.Nothing,
      $sel:artifactArn:ArtifactSummary' :: Maybe Text
artifactArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:artifactType:ArtifactSummary' :: Maybe Text
artifactType = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | When the artifact was created.
artifactSummary_creationTime :: Lens.Lens' ArtifactSummary (Prelude.Maybe Prelude.UTCTime)
artifactSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ArtifactSummary -> f ArtifactSummary
artifactSummary_creationTime = (ArtifactSummary -> Maybe POSIX)
-> (ArtifactSummary -> Maybe POSIX -> ArtifactSummary)
-> Lens ArtifactSummary ArtifactSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ArtifactSummary' :: ArtifactSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ArtifactSummary
s@ArtifactSummary' {} Maybe POSIX
a -> ArtifactSummary
s {$sel:creationTime:ArtifactSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ArtifactSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ArtifactSummary -> f ArtifactSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ArtifactSummary
-> f ArtifactSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | When the artifact was last modified.
artifactSummary_lastModifiedTime :: Lens.Lens' ArtifactSummary (Prelude.Maybe Prelude.UTCTime)
artifactSummary_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ArtifactSummary -> f ArtifactSummary
artifactSummary_lastModifiedTime = (ArtifactSummary -> Maybe POSIX)
-> (ArtifactSummary -> Maybe POSIX -> ArtifactSummary)
-> Lens ArtifactSummary ArtifactSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactSummary' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:ArtifactSummary' :: ArtifactSummary -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: ArtifactSummary
s@ArtifactSummary' {} Maybe POSIX
a -> ArtifactSummary
s {$sel:lastModifiedTime:ArtifactSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: ArtifactSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ArtifactSummary -> f ArtifactSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ArtifactSummary
-> f ArtifactSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the artifact.
artifactSummary_artifactName :: Lens.Lens' ArtifactSummary (Prelude.Maybe Prelude.Text)
artifactSummary_artifactName :: (Maybe Text -> f (Maybe Text))
-> ArtifactSummary -> f ArtifactSummary
artifactSummary_artifactName = (ArtifactSummary -> Maybe Text)
-> (ArtifactSummary -> Maybe Text -> ArtifactSummary)
-> Lens ArtifactSummary ArtifactSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactSummary' {Maybe Text
artifactName :: Maybe Text
$sel:artifactName:ArtifactSummary' :: ArtifactSummary -> Maybe Text
artifactName} -> Maybe Text
artifactName) (\s :: ArtifactSummary
s@ArtifactSummary' {} Maybe Text
a -> ArtifactSummary
s {$sel:artifactName:ArtifactSummary' :: Maybe Text
artifactName = Maybe Text
a} :: ArtifactSummary)

-- | The source of the artifact.
artifactSummary_source :: Lens.Lens' ArtifactSummary (Prelude.Maybe ArtifactSource)
artifactSummary_source :: (Maybe ArtifactSource -> f (Maybe ArtifactSource))
-> ArtifactSummary -> f ArtifactSummary
artifactSummary_source = (ArtifactSummary -> Maybe ArtifactSource)
-> (ArtifactSummary -> Maybe ArtifactSource -> ArtifactSummary)
-> Lens
     ArtifactSummary
     ArtifactSummary
     (Maybe ArtifactSource)
     (Maybe ArtifactSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactSummary' {Maybe ArtifactSource
source :: Maybe ArtifactSource
$sel:source:ArtifactSummary' :: ArtifactSummary -> Maybe ArtifactSource
source} -> Maybe ArtifactSource
source) (\s :: ArtifactSummary
s@ArtifactSummary' {} Maybe ArtifactSource
a -> ArtifactSummary
s {$sel:source:ArtifactSummary' :: Maybe ArtifactSource
source = Maybe ArtifactSource
a} :: ArtifactSummary)

-- | The Amazon Resource Name (ARN) of the artifact.
artifactSummary_artifactArn :: Lens.Lens' ArtifactSummary (Prelude.Maybe Prelude.Text)
artifactSummary_artifactArn :: (Maybe Text -> f (Maybe Text))
-> ArtifactSummary -> f ArtifactSummary
artifactSummary_artifactArn = (ArtifactSummary -> Maybe Text)
-> (ArtifactSummary -> Maybe Text -> ArtifactSummary)
-> Lens ArtifactSummary ArtifactSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactSummary' {Maybe Text
artifactArn :: Maybe Text
$sel:artifactArn:ArtifactSummary' :: ArtifactSummary -> Maybe Text
artifactArn} -> Maybe Text
artifactArn) (\s :: ArtifactSummary
s@ArtifactSummary' {} Maybe Text
a -> ArtifactSummary
s {$sel:artifactArn:ArtifactSummary' :: Maybe Text
artifactArn = Maybe Text
a} :: ArtifactSummary)

-- | The type of the artifact.
artifactSummary_artifactType :: Lens.Lens' ArtifactSummary (Prelude.Maybe Prelude.Text)
artifactSummary_artifactType :: (Maybe Text -> f (Maybe Text))
-> ArtifactSummary -> f ArtifactSummary
artifactSummary_artifactType = (ArtifactSummary -> Maybe Text)
-> (ArtifactSummary -> Maybe Text -> ArtifactSummary)
-> Lens ArtifactSummary ArtifactSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactSummary' {Maybe Text
artifactType :: Maybe Text
$sel:artifactType:ArtifactSummary' :: ArtifactSummary -> Maybe Text
artifactType} -> Maybe Text
artifactType) (\s :: ArtifactSummary
s@ArtifactSummary' {} Maybe Text
a -> ArtifactSummary
s {$sel:artifactType:ArtifactSummary' :: Maybe Text
artifactType = Maybe Text
a} :: ArtifactSummary)

instance Core.FromJSON ArtifactSummary where
  parseJSON :: Value -> Parser ArtifactSummary
parseJSON =
    String
-> (Object -> Parser ArtifactSummary)
-> Value
-> Parser ArtifactSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ArtifactSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ArtifactSource
-> Maybe Text
-> Maybe Text
-> ArtifactSummary
ArtifactSummary'
            (Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe ArtifactSource
 -> Maybe Text
 -> Maybe Text
 -> ArtifactSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe ArtifactSource
      -> Maybe Text
      -> Maybe Text
      -> ArtifactSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe ArtifactSource
   -> Maybe Text
   -> Maybe Text
   -> ArtifactSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe ArtifactSource
      -> Maybe Text
      -> Maybe Text
      -> ArtifactSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastModifiedTime")
            Parser
  (Maybe Text
   -> Maybe ArtifactSource
   -> Maybe Text
   -> Maybe Text
   -> ArtifactSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ArtifactSource
      -> Maybe Text -> Maybe Text -> ArtifactSummary)
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
"ArtifactName")
            Parser
  (Maybe ArtifactSource
   -> Maybe Text -> Maybe Text -> ArtifactSummary)
-> Parser (Maybe ArtifactSource)
-> Parser (Maybe Text -> Maybe Text -> ArtifactSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ArtifactSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Source")
            Parser (Maybe Text -> Maybe Text -> ArtifactSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ArtifactSummary)
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
"ArtifactArn")
            Parser (Maybe Text -> ArtifactSummary)
-> Parser (Maybe Text) -> Parser ArtifactSummary
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
"ArtifactType")
      )

instance Prelude.Hashable ArtifactSummary

instance Prelude.NFData ArtifactSummary