{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.AlgorithmSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 :: Data.POSIX,
    -- | The overall status of the algorithm.
    AlgorithmSummary -> AlgorithmStatus
algorithmStatus :: AlgorithmStatus
  }
  deriving (AlgorithmSummary -> AlgorithmSummary -> Bool
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]
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
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. 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'
      { $sel:algorithmDescription:AlgorithmSummary' :: Maybe Text
algorithmDescription =
          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 = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time 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 :: Lens' AlgorithmSummary (Maybe Text)
algorithmSummary_algorithmDescription = 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 :: Lens' AlgorithmSummary Text
algorithmSummary_algorithmName = 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 :: Lens' AlgorithmSummary Text
algorithmSummary_algorithmArn = 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 :: Lens' AlgorithmSummary UTCTime
algorithmSummary_creationTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The overall status of the algorithm.
algorithmSummary_algorithmStatus :: Lens.Lens' AlgorithmSummary AlgorithmStatus
algorithmSummary_algorithmStatus :: Lens' AlgorithmSummary AlgorithmStatus
algorithmSummary_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 Data.FromJSON AlgorithmSummary where
  parseJSON :: Value -> Parser AlgorithmSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AlgorithmSummary"
      ( \Object
x ->
          Maybe Text
-> Text -> Text -> POSIX -> AlgorithmStatus -> AlgorithmSummary
AlgorithmSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AlgorithmDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AlgorithmName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AlgorithmArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AlgorithmStatus")
      )

instance Prelude.Hashable AlgorithmSummary where
  hashWithSalt :: Int -> AlgorithmSummary -> Int
hashWithSalt Int
_salt AlgorithmSummary' {Maybe Text
Text
POSIX
AlgorithmStatus
algorithmStatus :: AlgorithmStatus
creationTime :: POSIX
algorithmArn :: Text
algorithmName :: Text
algorithmDescription :: Maybe Text
$sel:algorithmStatus:AlgorithmSummary' :: AlgorithmSummary -> AlgorithmStatus
$sel:creationTime:AlgorithmSummary' :: AlgorithmSummary -> POSIX
$sel:algorithmArn:AlgorithmSummary' :: AlgorithmSummary -> Text
$sel:algorithmName:AlgorithmSummary' :: AlgorithmSummary -> Text
$sel:algorithmDescription:AlgorithmSummary' :: AlgorithmSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
algorithmDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
algorithmName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
algorithmArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AlgorithmStatus
algorithmStatus

instance Prelude.NFData AlgorithmSummary where
  rnf :: AlgorithmSummary -> ()
rnf AlgorithmSummary' {Maybe Text
Text
POSIX
AlgorithmStatus
algorithmStatus :: AlgorithmStatus
creationTime :: POSIX
algorithmArn :: Text
algorithmName :: Text
algorithmDescription :: Maybe Text
$sel:algorithmStatus:AlgorithmSummary' :: AlgorithmSummary -> AlgorithmStatus
$sel:creationTime:AlgorithmSummary' :: AlgorithmSummary -> POSIX
$sel:algorithmArn:AlgorithmSummary' :: AlgorithmSummary -> Text
$sel:algorithmName:AlgorithmSummary' :: AlgorithmSummary -> Text
$sel:algorithmDescription:AlgorithmSummary' :: AlgorithmSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
algorithmDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
algorithmName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
algorithmArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AlgorithmStatus
algorithmStatus