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

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

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

-- |
-- Create a value of 'TrialSummary' 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', 'trialSummary_creationTime' - When the trial was created.
--
-- 'trialArn', 'trialSummary_trialArn' - The Amazon Resource Name (ARN) of the trial.
--
-- 'lastModifiedTime', 'trialSummary_lastModifiedTime' - When the trial was last modified.
--
-- 'trialSource', 'trialSummary_trialSource' - Undocumented member.
--
-- 'displayName', 'trialSummary_displayName' - The name of the trial as displayed. If @DisplayName@ isn\'t specified,
-- @TrialName@ is displayed.
--
-- 'trialName', 'trialSummary_trialName' - The name of the trial.
newTrialSummary ::
  TrialSummary
newTrialSummary :: TrialSummary
newTrialSummary =
  TrialSummary' :: Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe TrialSource
-> Maybe Text
-> Maybe Text
-> TrialSummary
TrialSummary'
    { $sel:creationTime:TrialSummary' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:trialArn:TrialSummary' :: Maybe Text
trialArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:TrialSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:trialSource:TrialSummary' :: Maybe TrialSource
trialSource = Maybe TrialSource
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:TrialSummary' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:trialName:TrialSummary' :: Maybe Text
trialName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | When the trial was created.
trialSummary_creationTime :: Lens.Lens' TrialSummary (Prelude.Maybe Prelude.UTCTime)
trialSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TrialSummary -> f TrialSummary
trialSummary_creationTime = (TrialSummary -> Maybe POSIX)
-> (TrialSummary -> Maybe POSIX -> TrialSummary)
-> Lens TrialSummary TrialSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:TrialSummary' :: TrialSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: TrialSummary
s@TrialSummary' {} Maybe POSIX
a -> TrialSummary
s {$sel:creationTime:TrialSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: TrialSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> TrialSummary -> f TrialSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TrialSummary
-> f TrialSummary
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 Amazon Resource Name (ARN) of the trial.
trialSummary_trialArn :: Lens.Lens' TrialSummary (Prelude.Maybe Prelude.Text)
trialSummary_trialArn :: (Maybe Text -> f (Maybe Text)) -> TrialSummary -> f TrialSummary
trialSummary_trialArn = (TrialSummary -> Maybe Text)
-> (TrialSummary -> Maybe Text -> TrialSummary)
-> Lens TrialSummary TrialSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialSummary' {Maybe Text
trialArn :: Maybe Text
$sel:trialArn:TrialSummary' :: TrialSummary -> Maybe Text
trialArn} -> Maybe Text
trialArn) (\s :: TrialSummary
s@TrialSummary' {} Maybe Text
a -> TrialSummary
s {$sel:trialArn:TrialSummary' :: Maybe Text
trialArn = Maybe Text
a} :: TrialSummary)

-- | When the trial was last modified.
trialSummary_lastModifiedTime :: Lens.Lens' TrialSummary (Prelude.Maybe Prelude.UTCTime)
trialSummary_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TrialSummary -> f TrialSummary
trialSummary_lastModifiedTime = (TrialSummary -> Maybe POSIX)
-> (TrialSummary -> Maybe POSIX -> TrialSummary)
-> Lens TrialSummary TrialSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialSummary' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:TrialSummary' :: TrialSummary -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: TrialSummary
s@TrialSummary' {} Maybe POSIX
a -> TrialSummary
s {$sel:lastModifiedTime:TrialSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: TrialSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> TrialSummary -> f TrialSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TrialSummary
-> f TrialSummary
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

-- | Undocumented member.
trialSummary_trialSource :: Lens.Lens' TrialSummary (Prelude.Maybe TrialSource)
trialSummary_trialSource :: (Maybe TrialSource -> f (Maybe TrialSource))
-> TrialSummary -> f TrialSummary
trialSummary_trialSource = (TrialSummary -> Maybe TrialSource)
-> (TrialSummary -> Maybe TrialSource -> TrialSummary)
-> Lens
     TrialSummary TrialSummary (Maybe TrialSource) (Maybe TrialSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialSummary' {Maybe TrialSource
trialSource :: Maybe TrialSource
$sel:trialSource:TrialSummary' :: TrialSummary -> Maybe TrialSource
trialSource} -> Maybe TrialSource
trialSource) (\s :: TrialSummary
s@TrialSummary' {} Maybe TrialSource
a -> TrialSummary
s {$sel:trialSource:TrialSummary' :: Maybe TrialSource
trialSource = Maybe TrialSource
a} :: TrialSummary)

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

-- | The name of the trial.
trialSummary_trialName :: Lens.Lens' TrialSummary (Prelude.Maybe Prelude.Text)
trialSummary_trialName :: (Maybe Text -> f (Maybe Text)) -> TrialSummary -> f TrialSummary
trialSummary_trialName = (TrialSummary -> Maybe Text)
-> (TrialSummary -> Maybe Text -> TrialSummary)
-> Lens TrialSummary TrialSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialSummary' {Maybe Text
trialName :: Maybe Text
$sel:trialName:TrialSummary' :: TrialSummary -> Maybe Text
trialName} -> Maybe Text
trialName) (\s :: TrialSummary
s@TrialSummary' {} Maybe Text
a -> TrialSummary
s {$sel:trialName:TrialSummary' :: Maybe Text
trialName = Maybe Text
a} :: TrialSummary)

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

instance Prelude.Hashable TrialSummary

instance Prelude.NFData TrialSummary