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

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

-- | Provides summary information about an algorithm.
--
-- /See:/ 'newAlgorithmSummary' smart constructor.
data AlgorithmSummary = AlgorithmSummary'
  { -- | A brief description of the algorithm.
    AlgorithmSummary -> Maybe Text
algorithmDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of the algorithm that is described by the summary.
    AlgorithmSummary -> Text
algorithmName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the algorithm.
    AlgorithmSummary -> Text
algorithmArn :: Prelude.Text,
    -- | A timestamp that shows when the algorithm was created.
    AlgorithmSummary -> POSIX
creationTime :: Core.POSIX,
    -- | The overall status of the algorithm.
    AlgorithmSummary -> AlgorithmStatus
algorithmStatus :: AlgorithmStatus
  }
  deriving (AlgorithmSummary -> AlgorithmSummary -> Bool
(AlgorithmSummary -> AlgorithmSummary -> Bool)
-> (AlgorithmSummary -> AlgorithmSummary -> Bool)
-> Eq AlgorithmSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlgorithmSummary -> AlgorithmSummary -> Bool
$c/= :: AlgorithmSummary -> AlgorithmSummary -> Bool
== :: AlgorithmSummary -> AlgorithmSummary -> Bool
$c== :: AlgorithmSummary -> AlgorithmSummary -> Bool
Prelude.Eq, ReadPrec [AlgorithmSummary]
ReadPrec AlgorithmSummary
Int -> ReadS AlgorithmSummary
ReadS [AlgorithmSummary]
(Int -> ReadS AlgorithmSummary)
-> ReadS [AlgorithmSummary]
-> ReadPrec AlgorithmSummary
-> ReadPrec [AlgorithmSummary]
-> Read AlgorithmSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AlgorithmSummary]
$creadListPrec :: ReadPrec [AlgorithmSummary]
readPrec :: ReadPrec AlgorithmSummary
$creadPrec :: ReadPrec AlgorithmSummary
readList :: ReadS [AlgorithmSummary]
$creadList :: ReadS [AlgorithmSummary]
readsPrec :: Int -> ReadS AlgorithmSummary
$creadsPrec :: Int -> ReadS AlgorithmSummary
Prelude.Read, Int -> AlgorithmSummary -> ShowS
[AlgorithmSummary] -> ShowS
AlgorithmSummary -> String
(Int -> AlgorithmSummary -> ShowS)
-> (AlgorithmSummary -> String)
-> ([AlgorithmSummary] -> ShowS)
-> Show AlgorithmSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlgorithmSummary] -> ShowS
$cshowList :: [AlgorithmSummary] -> ShowS
show :: AlgorithmSummary -> String
$cshow :: AlgorithmSummary -> String
showsPrec :: Int -> AlgorithmSummary -> ShowS
$cshowsPrec :: Int -> AlgorithmSummary -> ShowS
Prelude.Show, (forall x. AlgorithmSummary -> Rep AlgorithmSummary x)
-> (forall x. Rep AlgorithmSummary x -> AlgorithmSummary)
-> Generic AlgorithmSummary
forall x. Rep AlgorithmSummary x -> AlgorithmSummary
forall x. AlgorithmSummary -> Rep AlgorithmSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AlgorithmSummary x -> AlgorithmSummary
$cfrom :: forall x. AlgorithmSummary -> Rep AlgorithmSummary x
Prelude.Generic)

-- |
-- Create a value of 'AlgorithmSummary' 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:
--
-- 'algorithmDescription', 'algorithmSummary_algorithmDescription' - A brief description of the algorithm.
--
-- 'algorithmName', 'algorithmSummary_algorithmName' - The name of the algorithm that is described by the summary.
--
-- 'algorithmArn', 'algorithmSummary_algorithmArn' - The Amazon Resource Name (ARN) of the algorithm.
--
-- 'creationTime', 'algorithmSummary_creationTime' - A timestamp that shows when the algorithm was created.
--
-- 'algorithmStatus', 'algorithmSummary_algorithmStatus' - The overall status of the algorithm.
newAlgorithmSummary ::
  -- | 'algorithmName'
  Prelude.Text ->
  -- | 'algorithmArn'
  Prelude.Text ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  -- | 'algorithmStatus'
  AlgorithmStatus ->
  AlgorithmSummary
newAlgorithmSummary :: Text -> Text -> UTCTime -> AlgorithmStatus -> AlgorithmSummary
newAlgorithmSummary
  Text
pAlgorithmName_
  Text
pAlgorithmArn_
  UTCTime
pCreationTime_
  AlgorithmStatus
pAlgorithmStatus_ =
    AlgorithmSummary' :: Maybe Text
-> Text -> Text -> POSIX -> AlgorithmStatus -> AlgorithmSummary
AlgorithmSummary'
      { $sel:algorithmDescription:AlgorithmSummary' :: Maybe Text
algorithmDescription =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:algorithmName:AlgorithmSummary' :: Text
algorithmName = Text
pAlgorithmName_,
        $sel:algorithmArn:AlgorithmSummary' :: Text
algorithmArn = Text
pAlgorithmArn_,
        $sel:creationTime:AlgorithmSummary' :: POSIX
creationTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_,
        $sel:algorithmStatus:AlgorithmSummary' :: AlgorithmStatus
algorithmStatus = AlgorithmStatus
pAlgorithmStatus_
      }

-- | A brief description of the algorithm.
algorithmSummary_algorithmDescription :: Lens.Lens' AlgorithmSummary (Prelude.Maybe Prelude.Text)
algorithmSummary_algorithmDescription :: (Maybe Text -> f (Maybe Text))
-> AlgorithmSummary -> f AlgorithmSummary
algorithmSummary_algorithmDescription = (AlgorithmSummary -> Maybe Text)
-> (AlgorithmSummary -> Maybe Text -> AlgorithmSummary)
-> Lens AlgorithmSummary AlgorithmSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlgorithmSummary' {Maybe Text
algorithmDescription :: Maybe Text
$sel:algorithmDescription:AlgorithmSummary' :: AlgorithmSummary -> Maybe Text
algorithmDescription} -> Maybe Text
algorithmDescription) (\s :: AlgorithmSummary
s@AlgorithmSummary' {} Maybe Text
a -> AlgorithmSummary
s {$sel:algorithmDescription:AlgorithmSummary' :: Maybe Text
algorithmDescription = Maybe Text
a} :: AlgorithmSummary)

-- | The name of the algorithm that is described by the summary.
algorithmSummary_algorithmName :: Lens.Lens' AlgorithmSummary Prelude.Text
algorithmSummary_algorithmName :: (Text -> f Text) -> AlgorithmSummary -> f AlgorithmSummary
algorithmSummary_algorithmName = (AlgorithmSummary -> Text)
-> (AlgorithmSummary -> Text -> AlgorithmSummary)
-> Lens AlgorithmSummary AlgorithmSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlgorithmSummary' {Text
algorithmName :: Text
$sel:algorithmName:AlgorithmSummary' :: AlgorithmSummary -> Text
algorithmName} -> Text
algorithmName) (\s :: AlgorithmSummary
s@AlgorithmSummary' {} Text
a -> AlgorithmSummary
s {$sel:algorithmName:AlgorithmSummary' :: Text
algorithmName = Text
a} :: AlgorithmSummary)

-- | The Amazon Resource Name (ARN) of the algorithm.
algorithmSummary_algorithmArn :: Lens.Lens' AlgorithmSummary Prelude.Text
algorithmSummary_algorithmArn :: (Text -> f Text) -> AlgorithmSummary -> f AlgorithmSummary
algorithmSummary_algorithmArn = (AlgorithmSummary -> Text)
-> (AlgorithmSummary -> Text -> AlgorithmSummary)
-> Lens AlgorithmSummary AlgorithmSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlgorithmSummary' {Text
algorithmArn :: Text
$sel:algorithmArn:AlgorithmSummary' :: AlgorithmSummary -> Text
algorithmArn} -> Text
algorithmArn) (\s :: AlgorithmSummary
s@AlgorithmSummary' {} Text
a -> AlgorithmSummary
s {$sel:algorithmArn:AlgorithmSummary' :: Text
algorithmArn = Text
a} :: AlgorithmSummary)

-- | A timestamp that shows when the algorithm was created.
algorithmSummary_creationTime :: Lens.Lens' AlgorithmSummary Prelude.UTCTime
algorithmSummary_creationTime :: (UTCTime -> f UTCTime) -> AlgorithmSummary -> f AlgorithmSummary
algorithmSummary_creationTime = (AlgorithmSummary -> POSIX)
-> (AlgorithmSummary -> POSIX -> AlgorithmSummary)
-> Lens AlgorithmSummary AlgorithmSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlgorithmSummary' {POSIX
creationTime :: POSIX
$sel:creationTime:AlgorithmSummary' :: AlgorithmSummary -> POSIX
creationTime} -> POSIX
creationTime) (\s :: AlgorithmSummary
s@AlgorithmSummary' {} POSIX
a -> AlgorithmSummary
s {$sel:creationTime:AlgorithmSummary' :: POSIX
creationTime = POSIX
a} :: AlgorithmSummary) ((POSIX -> f POSIX) -> AlgorithmSummary -> f AlgorithmSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AlgorithmSummary
-> f AlgorithmSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The overall status of the algorithm.
algorithmSummary_algorithmStatus :: Lens.Lens' AlgorithmSummary AlgorithmStatus
algorithmSummary_algorithmStatus :: (AlgorithmStatus -> f AlgorithmStatus)
-> AlgorithmSummary -> f AlgorithmSummary
algorithmSummary_algorithmStatus = (AlgorithmSummary -> AlgorithmStatus)
-> (AlgorithmSummary -> AlgorithmStatus -> AlgorithmSummary)
-> Lens
     AlgorithmSummary AlgorithmSummary AlgorithmStatus AlgorithmStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlgorithmSummary' {AlgorithmStatus
algorithmStatus :: AlgorithmStatus
$sel:algorithmStatus:AlgorithmSummary' :: AlgorithmSummary -> AlgorithmStatus
algorithmStatus} -> AlgorithmStatus
algorithmStatus) (\s :: AlgorithmSummary
s@AlgorithmSummary' {} AlgorithmStatus
a -> AlgorithmSummary
s {$sel:algorithmStatus:AlgorithmSummary' :: AlgorithmStatus
algorithmStatus = AlgorithmStatus
a} :: AlgorithmSummary)

instance Core.FromJSON AlgorithmSummary where
  parseJSON :: Value -> Parser AlgorithmSummary
parseJSON =
    String
-> (Object -> Parser AlgorithmSummary)
-> Value
-> Parser AlgorithmSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AlgorithmSummary"
      ( \Object
x ->
          Maybe Text
-> Text -> Text -> POSIX -> AlgorithmStatus -> AlgorithmSummary
AlgorithmSummary'
            (Maybe Text
 -> Text -> Text -> POSIX -> AlgorithmStatus -> AlgorithmSummary)
-> Parser (Maybe Text)
-> Parser
     (Text -> Text -> POSIX -> AlgorithmStatus -> AlgorithmSummary)
forall (f :: * -> *) a b. Functor 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
"AlgorithmDescription")
            Parser
  (Text -> Text -> POSIX -> AlgorithmStatus -> AlgorithmSummary)
-> Parser Text
-> Parser (Text -> POSIX -> AlgorithmStatus -> AlgorithmSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AlgorithmName")
            Parser (Text -> POSIX -> AlgorithmStatus -> AlgorithmSummary)
-> Parser Text
-> Parser (POSIX -> AlgorithmStatus -> AlgorithmSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AlgorithmArn")
            Parser (POSIX -> AlgorithmStatus -> AlgorithmSummary)
-> Parser POSIX -> Parser (AlgorithmStatus -> AlgorithmSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreationTime")
            Parser (AlgorithmStatus -> AlgorithmSummary)
-> Parser AlgorithmStatus -> Parser AlgorithmSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AlgorithmStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AlgorithmStatus")
      )

instance Prelude.Hashable AlgorithmSummary

instance Prelude.NFData AlgorithmSummary