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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.TrialComponentSource
import Amazonka.SageMaker.Types.UserContext

-- | A short summary of a trial component.
--
-- /See:/ 'newTrialComponentSimpleSummary' smart constructor.
data TrialComponentSimpleSummary = TrialComponentSimpleSummary'
  { -- | When the component was created.
    TrialComponentSimpleSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    TrialComponentSimpleSummary -> Maybe UserContext
createdBy :: Prelude.Maybe UserContext,
    -- | The name of the trial component.
    TrialComponentSimpleSummary -> Maybe Text
trialComponentName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the trial component.
    TrialComponentSimpleSummary -> Maybe Text
trialComponentArn :: Prelude.Maybe Prelude.Text,
    TrialComponentSimpleSummary -> Maybe TrialComponentSource
trialComponentSource :: Prelude.Maybe TrialComponentSource
  }
  deriving (TrialComponentSimpleSummary -> TrialComponentSimpleSummary -> Bool
(TrialComponentSimpleSummary
 -> TrialComponentSimpleSummary -> Bool)
-> (TrialComponentSimpleSummary
    -> TrialComponentSimpleSummary -> Bool)
-> Eq TrialComponentSimpleSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrialComponentSimpleSummary -> TrialComponentSimpleSummary -> Bool
$c/= :: TrialComponentSimpleSummary -> TrialComponentSimpleSummary -> Bool
== :: TrialComponentSimpleSummary -> TrialComponentSimpleSummary -> Bool
$c== :: TrialComponentSimpleSummary -> TrialComponentSimpleSummary -> Bool
Prelude.Eq, ReadPrec [TrialComponentSimpleSummary]
ReadPrec TrialComponentSimpleSummary
Int -> ReadS TrialComponentSimpleSummary
ReadS [TrialComponentSimpleSummary]
(Int -> ReadS TrialComponentSimpleSummary)
-> ReadS [TrialComponentSimpleSummary]
-> ReadPrec TrialComponentSimpleSummary
-> ReadPrec [TrialComponentSimpleSummary]
-> Read TrialComponentSimpleSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrialComponentSimpleSummary]
$creadListPrec :: ReadPrec [TrialComponentSimpleSummary]
readPrec :: ReadPrec TrialComponentSimpleSummary
$creadPrec :: ReadPrec TrialComponentSimpleSummary
readList :: ReadS [TrialComponentSimpleSummary]
$creadList :: ReadS [TrialComponentSimpleSummary]
readsPrec :: Int -> ReadS TrialComponentSimpleSummary
$creadsPrec :: Int -> ReadS TrialComponentSimpleSummary
Prelude.Read, Int -> TrialComponentSimpleSummary -> ShowS
[TrialComponentSimpleSummary] -> ShowS
TrialComponentSimpleSummary -> String
(Int -> TrialComponentSimpleSummary -> ShowS)
-> (TrialComponentSimpleSummary -> String)
-> ([TrialComponentSimpleSummary] -> ShowS)
-> Show TrialComponentSimpleSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrialComponentSimpleSummary] -> ShowS
$cshowList :: [TrialComponentSimpleSummary] -> ShowS
show :: TrialComponentSimpleSummary -> String
$cshow :: TrialComponentSimpleSummary -> String
showsPrec :: Int -> TrialComponentSimpleSummary -> ShowS
$cshowsPrec :: Int -> TrialComponentSimpleSummary -> ShowS
Prelude.Show, (forall x.
 TrialComponentSimpleSummary -> Rep TrialComponentSimpleSummary x)
-> (forall x.
    Rep TrialComponentSimpleSummary x -> TrialComponentSimpleSummary)
-> Generic TrialComponentSimpleSummary
forall x.
Rep TrialComponentSimpleSummary x -> TrialComponentSimpleSummary
forall x.
TrialComponentSimpleSummary -> Rep TrialComponentSimpleSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TrialComponentSimpleSummary x -> TrialComponentSimpleSummary
$cfrom :: forall x.
TrialComponentSimpleSummary -> Rep TrialComponentSimpleSummary x
Prelude.Generic)

-- |
-- Create a value of 'TrialComponentSimpleSummary' 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', 'trialComponentSimpleSummary_creationTime' - When the component was created.
--
-- 'createdBy', 'trialComponentSimpleSummary_createdBy' - Undocumented member.
--
-- 'trialComponentName', 'trialComponentSimpleSummary_trialComponentName' - The name of the trial component.
--
-- 'trialComponentArn', 'trialComponentSimpleSummary_trialComponentArn' - The Amazon Resource Name (ARN) of the trial component.
--
-- 'trialComponentSource', 'trialComponentSimpleSummary_trialComponentSource' - Undocumented member.
newTrialComponentSimpleSummary ::
  TrialComponentSimpleSummary
newTrialComponentSimpleSummary :: TrialComponentSimpleSummary
newTrialComponentSimpleSummary =
  TrialComponentSimpleSummary' :: Maybe POSIX
-> Maybe UserContext
-> Maybe Text
-> Maybe Text
-> Maybe TrialComponentSource
-> TrialComponentSimpleSummary
TrialComponentSimpleSummary'
    { $sel:creationTime:TrialComponentSimpleSummary' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:TrialComponentSimpleSummary' :: Maybe UserContext
createdBy = Maybe UserContext
forall a. Maybe a
Prelude.Nothing,
      $sel:trialComponentName:TrialComponentSimpleSummary' :: Maybe Text
trialComponentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:trialComponentArn:TrialComponentSimpleSummary' :: Maybe Text
trialComponentArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:trialComponentSource:TrialComponentSimpleSummary' :: Maybe TrialComponentSource
trialComponentSource = Maybe TrialComponentSource
forall a. Maybe a
Prelude.Nothing
    }

-- | When the component was created.
trialComponentSimpleSummary_creationTime :: Lens.Lens' TrialComponentSimpleSummary (Prelude.Maybe Prelude.UTCTime)
trialComponentSimpleSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TrialComponentSimpleSummary -> f TrialComponentSimpleSummary
trialComponentSimpleSummary_creationTime = (TrialComponentSimpleSummary -> Maybe POSIX)
-> (TrialComponentSimpleSummary
    -> Maybe POSIX -> TrialComponentSimpleSummary)
-> Lens
     TrialComponentSimpleSummary
     TrialComponentSimpleSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialComponentSimpleSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:TrialComponentSimpleSummary' :: TrialComponentSimpleSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: TrialComponentSimpleSummary
s@TrialComponentSimpleSummary' {} Maybe POSIX
a -> TrialComponentSimpleSummary
s {$sel:creationTime:TrialComponentSimpleSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: TrialComponentSimpleSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> TrialComponentSimpleSummary -> f TrialComponentSimpleSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TrialComponentSimpleSummary
-> f TrialComponentSimpleSummary
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.
trialComponentSimpleSummary_createdBy :: Lens.Lens' TrialComponentSimpleSummary (Prelude.Maybe UserContext)
trialComponentSimpleSummary_createdBy :: (Maybe UserContext -> f (Maybe UserContext))
-> TrialComponentSimpleSummary -> f TrialComponentSimpleSummary
trialComponentSimpleSummary_createdBy = (TrialComponentSimpleSummary -> Maybe UserContext)
-> (TrialComponentSimpleSummary
    -> Maybe UserContext -> TrialComponentSimpleSummary)
-> Lens
     TrialComponentSimpleSummary
     TrialComponentSimpleSummary
     (Maybe UserContext)
     (Maybe UserContext)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialComponentSimpleSummary' {Maybe UserContext
createdBy :: Maybe UserContext
$sel:createdBy:TrialComponentSimpleSummary' :: TrialComponentSimpleSummary -> Maybe UserContext
createdBy} -> Maybe UserContext
createdBy) (\s :: TrialComponentSimpleSummary
s@TrialComponentSimpleSummary' {} Maybe UserContext
a -> TrialComponentSimpleSummary
s {$sel:createdBy:TrialComponentSimpleSummary' :: Maybe UserContext
createdBy = Maybe UserContext
a} :: TrialComponentSimpleSummary)

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

-- | The Amazon Resource Name (ARN) of the trial component.
trialComponentSimpleSummary_trialComponentArn :: Lens.Lens' TrialComponentSimpleSummary (Prelude.Maybe Prelude.Text)
trialComponentSimpleSummary_trialComponentArn :: (Maybe Text -> f (Maybe Text))
-> TrialComponentSimpleSummary -> f TrialComponentSimpleSummary
trialComponentSimpleSummary_trialComponentArn = (TrialComponentSimpleSummary -> Maybe Text)
-> (TrialComponentSimpleSummary
    -> Maybe Text -> TrialComponentSimpleSummary)
-> Lens
     TrialComponentSimpleSummary
     TrialComponentSimpleSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialComponentSimpleSummary' {Maybe Text
trialComponentArn :: Maybe Text
$sel:trialComponentArn:TrialComponentSimpleSummary' :: TrialComponentSimpleSummary -> Maybe Text
trialComponentArn} -> Maybe Text
trialComponentArn) (\s :: TrialComponentSimpleSummary
s@TrialComponentSimpleSummary' {} Maybe Text
a -> TrialComponentSimpleSummary
s {$sel:trialComponentArn:TrialComponentSimpleSummary' :: Maybe Text
trialComponentArn = Maybe Text
a} :: TrialComponentSimpleSummary)

-- | Undocumented member.
trialComponentSimpleSummary_trialComponentSource :: Lens.Lens' TrialComponentSimpleSummary (Prelude.Maybe TrialComponentSource)
trialComponentSimpleSummary_trialComponentSource :: (Maybe TrialComponentSource -> f (Maybe TrialComponentSource))
-> TrialComponentSimpleSummary -> f TrialComponentSimpleSummary
trialComponentSimpleSummary_trialComponentSource = (TrialComponentSimpleSummary -> Maybe TrialComponentSource)
-> (TrialComponentSimpleSummary
    -> Maybe TrialComponentSource -> TrialComponentSimpleSummary)
-> Lens
     TrialComponentSimpleSummary
     TrialComponentSimpleSummary
     (Maybe TrialComponentSource)
     (Maybe TrialComponentSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrialComponentSimpleSummary' {Maybe TrialComponentSource
trialComponentSource :: Maybe TrialComponentSource
$sel:trialComponentSource:TrialComponentSimpleSummary' :: TrialComponentSimpleSummary -> Maybe TrialComponentSource
trialComponentSource} -> Maybe TrialComponentSource
trialComponentSource) (\s :: TrialComponentSimpleSummary
s@TrialComponentSimpleSummary' {} Maybe TrialComponentSource
a -> TrialComponentSimpleSummary
s {$sel:trialComponentSource:TrialComponentSimpleSummary' :: Maybe TrialComponentSource
trialComponentSource = Maybe TrialComponentSource
a} :: TrialComponentSimpleSummary)

instance Core.FromJSON TrialComponentSimpleSummary where
  parseJSON :: Value -> Parser TrialComponentSimpleSummary
parseJSON =
    String
-> (Object -> Parser TrialComponentSimpleSummary)
-> Value
-> Parser TrialComponentSimpleSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TrialComponentSimpleSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe UserContext
-> Maybe Text
-> Maybe Text
-> Maybe TrialComponentSource
-> TrialComponentSimpleSummary
TrialComponentSimpleSummary'
            (Maybe POSIX
 -> Maybe UserContext
 -> Maybe Text
 -> Maybe Text
 -> Maybe TrialComponentSource
 -> TrialComponentSimpleSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe UserContext
      -> Maybe Text
      -> Maybe Text
      -> Maybe TrialComponentSource
      -> TrialComponentSimpleSummary)
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 UserContext
   -> Maybe Text
   -> Maybe Text
   -> Maybe TrialComponentSource
   -> TrialComponentSimpleSummary)
-> Parser (Maybe UserContext)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe TrialComponentSource
      -> TrialComponentSimpleSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UserContext)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedBy")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe TrialComponentSource
   -> TrialComponentSimpleSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe TrialComponentSource -> TrialComponentSimpleSummary)
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
"TrialComponentName")
            Parser
  (Maybe Text
   -> Maybe TrialComponentSource -> TrialComponentSimpleSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe TrialComponentSource -> TrialComponentSimpleSummary)
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
"TrialComponentArn")
            Parser (Maybe TrialComponentSource -> TrialComponentSimpleSummary)
-> Parser (Maybe TrialComponentSource)
-> Parser TrialComponentSimpleSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TrialComponentSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TrialComponentSource")
      )

instance Prelude.Hashable TrialComponentSimpleSummary

instance Prelude.NFData TrialComponentSimpleSummary