{-# 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.ExperimentSummary
-- 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.ExperimentSummary where

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

-- | A summary of the properties of an experiment. To get the complete set of
-- properties, call the DescribeExperiment API and provide the
-- @ExperimentName@.
--
-- /See:/ 'newExperimentSummary' smart constructor.
data ExperimentSummary = ExperimentSummary'
  { -- | When the experiment was created.
    ExperimentSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | When the experiment was last modified.
    ExperimentSummary -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the experiment.
    ExperimentSummary -> Maybe Text
experimentName :: Prelude.Maybe Prelude.Text,
    ExperimentSummary -> Maybe ExperimentSource
experimentSource :: Prelude.Maybe ExperimentSource,
    -- | The Amazon Resource Name (ARN) of the experiment.
    ExperimentSummary -> Maybe Text
experimentArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the experiment as displayed. If @DisplayName@ isn\'t
    -- specified, @ExperimentName@ is displayed.
    ExperimentSummary -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text
  }
  deriving (ExperimentSummary -> ExperimentSummary -> Bool
(ExperimentSummary -> ExperimentSummary -> Bool)
-> (ExperimentSummary -> ExperimentSummary -> Bool)
-> Eq ExperimentSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExperimentSummary -> ExperimentSummary -> Bool
$c/= :: ExperimentSummary -> ExperimentSummary -> Bool
== :: ExperimentSummary -> ExperimentSummary -> Bool
$c== :: ExperimentSummary -> ExperimentSummary -> Bool
Prelude.Eq, ReadPrec [ExperimentSummary]
ReadPrec ExperimentSummary
Int -> ReadS ExperimentSummary
ReadS [ExperimentSummary]
(Int -> ReadS ExperimentSummary)
-> ReadS [ExperimentSummary]
-> ReadPrec ExperimentSummary
-> ReadPrec [ExperimentSummary]
-> Read ExperimentSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExperimentSummary]
$creadListPrec :: ReadPrec [ExperimentSummary]
readPrec :: ReadPrec ExperimentSummary
$creadPrec :: ReadPrec ExperimentSummary
readList :: ReadS [ExperimentSummary]
$creadList :: ReadS [ExperimentSummary]
readsPrec :: Int -> ReadS ExperimentSummary
$creadsPrec :: Int -> ReadS ExperimentSummary
Prelude.Read, Int -> ExperimentSummary -> ShowS
[ExperimentSummary] -> ShowS
ExperimentSummary -> String
(Int -> ExperimentSummary -> ShowS)
-> (ExperimentSummary -> String)
-> ([ExperimentSummary] -> ShowS)
-> Show ExperimentSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExperimentSummary] -> ShowS
$cshowList :: [ExperimentSummary] -> ShowS
show :: ExperimentSummary -> String
$cshow :: ExperimentSummary -> String
showsPrec :: Int -> ExperimentSummary -> ShowS
$cshowsPrec :: Int -> ExperimentSummary -> ShowS
Prelude.Show, (forall x. ExperimentSummary -> Rep ExperimentSummary x)
-> (forall x. Rep ExperimentSummary x -> ExperimentSummary)
-> Generic ExperimentSummary
forall x. Rep ExperimentSummary x -> ExperimentSummary
forall x. ExperimentSummary -> Rep ExperimentSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExperimentSummary x -> ExperimentSummary
$cfrom :: forall x. ExperimentSummary -> Rep ExperimentSummary x
Prelude.Generic)

-- |
-- Create a value of 'ExperimentSummary' 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', 'experimentSummary_creationTime' - When the experiment was created.
--
-- 'lastModifiedTime', 'experimentSummary_lastModifiedTime' - When the experiment was last modified.
--
-- 'experimentName', 'experimentSummary_experimentName' - The name of the experiment.
--
-- 'experimentSource', 'experimentSummary_experimentSource' - Undocumented member.
--
-- 'experimentArn', 'experimentSummary_experimentArn' - The Amazon Resource Name (ARN) of the experiment.
--
-- 'displayName', 'experimentSummary_displayName' - The name of the experiment as displayed. If @DisplayName@ isn\'t
-- specified, @ExperimentName@ is displayed.
newExperimentSummary ::
  ExperimentSummary
newExperimentSummary :: ExperimentSummary
newExperimentSummary =
  ExperimentSummary' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ExperimentSource
-> Maybe Text
-> Maybe Text
-> ExperimentSummary
ExperimentSummary'
    { $sel:creationTime:ExperimentSummary' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:ExperimentSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:experimentName:ExperimentSummary' :: Maybe Text
experimentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:experimentSource:ExperimentSummary' :: Maybe ExperimentSource
experimentSource = Maybe ExperimentSource
forall a. Maybe a
Prelude.Nothing,
      $sel:experimentArn:ExperimentSummary' :: Maybe Text
experimentArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:ExperimentSummary' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | When the experiment was created.
experimentSummary_creationTime :: Lens.Lens' ExperimentSummary (Prelude.Maybe Prelude.UTCTime)
experimentSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ExperimentSummary -> f ExperimentSummary
experimentSummary_creationTime = (ExperimentSummary -> Maybe POSIX)
-> (ExperimentSummary -> Maybe POSIX -> ExperimentSummary)
-> Lens
     ExperimentSummary ExperimentSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ExperimentSummary' :: ExperimentSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ExperimentSummary
s@ExperimentSummary' {} Maybe POSIX
a -> ExperimentSummary
s {$sel:creationTime:ExperimentSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ExperimentSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ExperimentSummary -> f ExperimentSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ExperimentSummary
-> f ExperimentSummary
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 experiment was last modified.
experimentSummary_lastModifiedTime :: Lens.Lens' ExperimentSummary (Prelude.Maybe Prelude.UTCTime)
experimentSummary_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ExperimentSummary -> f ExperimentSummary
experimentSummary_lastModifiedTime = (ExperimentSummary -> Maybe POSIX)
-> (ExperimentSummary -> Maybe POSIX -> ExperimentSummary)
-> Lens
     ExperimentSummary ExperimentSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentSummary' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:ExperimentSummary' :: ExperimentSummary -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: ExperimentSummary
s@ExperimentSummary' {} Maybe POSIX
a -> ExperimentSummary
s {$sel:lastModifiedTime:ExperimentSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: ExperimentSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ExperimentSummary -> f ExperimentSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ExperimentSummary
-> f ExperimentSummary
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 experiment.
experimentSummary_experimentName :: Lens.Lens' ExperimentSummary (Prelude.Maybe Prelude.Text)
experimentSummary_experimentName :: (Maybe Text -> f (Maybe Text))
-> ExperimentSummary -> f ExperimentSummary
experimentSummary_experimentName = (ExperimentSummary -> Maybe Text)
-> (ExperimentSummary -> Maybe Text -> ExperimentSummary)
-> Lens
     ExperimentSummary ExperimentSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentSummary' {Maybe Text
experimentName :: Maybe Text
$sel:experimentName:ExperimentSummary' :: ExperimentSummary -> Maybe Text
experimentName} -> Maybe Text
experimentName) (\s :: ExperimentSummary
s@ExperimentSummary' {} Maybe Text
a -> ExperimentSummary
s {$sel:experimentName:ExperimentSummary' :: Maybe Text
experimentName = Maybe Text
a} :: ExperimentSummary)

-- | Undocumented member.
experimentSummary_experimentSource :: Lens.Lens' ExperimentSummary (Prelude.Maybe ExperimentSource)
experimentSummary_experimentSource :: (Maybe ExperimentSource -> f (Maybe ExperimentSource))
-> ExperimentSummary -> f ExperimentSummary
experimentSummary_experimentSource = (ExperimentSummary -> Maybe ExperimentSource)
-> (ExperimentSummary
    -> Maybe ExperimentSource -> ExperimentSummary)
-> Lens
     ExperimentSummary
     ExperimentSummary
     (Maybe ExperimentSource)
     (Maybe ExperimentSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentSummary' {Maybe ExperimentSource
experimentSource :: Maybe ExperimentSource
$sel:experimentSource:ExperimentSummary' :: ExperimentSummary -> Maybe ExperimentSource
experimentSource} -> Maybe ExperimentSource
experimentSource) (\s :: ExperimentSummary
s@ExperimentSummary' {} Maybe ExperimentSource
a -> ExperimentSummary
s {$sel:experimentSource:ExperimentSummary' :: Maybe ExperimentSource
experimentSource = Maybe ExperimentSource
a} :: ExperimentSummary)

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

-- | The name of the experiment as displayed. If @DisplayName@ isn\'t
-- specified, @ExperimentName@ is displayed.
experimentSummary_displayName :: Lens.Lens' ExperimentSummary (Prelude.Maybe Prelude.Text)
experimentSummary_displayName :: (Maybe Text -> f (Maybe Text))
-> ExperimentSummary -> f ExperimentSummary
experimentSummary_displayName = (ExperimentSummary -> Maybe Text)
-> (ExperimentSummary -> Maybe Text -> ExperimentSummary)
-> Lens
     ExperimentSummary ExperimentSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentSummary' {Maybe Text
displayName :: Maybe Text
$sel:displayName:ExperimentSummary' :: ExperimentSummary -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: ExperimentSummary
s@ExperimentSummary' {} Maybe Text
a -> ExperimentSummary
s {$sel:displayName:ExperimentSummary' :: Maybe Text
displayName = Maybe Text
a} :: ExperimentSummary)

instance Core.FromJSON ExperimentSummary where
  parseJSON :: Value -> Parser ExperimentSummary
parseJSON =
    String
-> (Object -> Parser ExperimentSummary)
-> Value
-> Parser ExperimentSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExperimentSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ExperimentSource
-> Maybe Text
-> Maybe Text
-> ExperimentSummary
ExperimentSummary'
            (Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe ExperimentSource
 -> Maybe Text
 -> Maybe Text
 -> ExperimentSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe ExperimentSource
      -> Maybe Text
      -> Maybe Text
      -> ExperimentSummary)
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 ExperimentSource
   -> Maybe Text
   -> Maybe Text
   -> ExperimentSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe ExperimentSource
      -> Maybe Text
      -> Maybe Text
      -> ExperimentSummary)
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 ExperimentSource
   -> Maybe Text
   -> Maybe Text
   -> ExperimentSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ExperimentSource
      -> Maybe Text -> Maybe Text -> ExperimentSummary)
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
"ExperimentName")
            Parser
  (Maybe ExperimentSource
   -> Maybe Text -> Maybe Text -> ExperimentSummary)
-> Parser (Maybe ExperimentSource)
-> Parser (Maybe Text -> Maybe Text -> ExperimentSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExperimentSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExperimentSource")
            Parser (Maybe Text -> Maybe Text -> ExperimentSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ExperimentSummary)
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
"ExperimentArn")
            Parser (Maybe Text -> ExperimentSummary)
-> Parser (Maybe Text) -> Parser ExperimentSummary
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
"DisplayName")
      )

instance Prelude.Hashable ExperimentSummary

instance Prelude.NFData ExperimentSummary