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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides summary information about a model.
--
-- /See:/ 'newModelSummary' smart constructor.
data ModelSummary = ModelSummary'
  { -- | The name of the model that you want a summary for.
    ModelSummary -> Text
modelName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the model.
    ModelSummary -> Text
modelArn :: Prelude.Text,
    -- | A timestamp that indicates when the model was created.
    ModelSummary -> POSIX
creationTime :: Core.POSIX
  }
  deriving (ModelSummary -> ModelSummary -> Bool
(ModelSummary -> ModelSummary -> Bool)
-> (ModelSummary -> ModelSummary -> Bool) -> Eq ModelSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelSummary -> ModelSummary -> Bool
$c/= :: ModelSummary -> ModelSummary -> Bool
== :: ModelSummary -> ModelSummary -> Bool
$c== :: ModelSummary -> ModelSummary -> Bool
Prelude.Eq, ReadPrec [ModelSummary]
ReadPrec ModelSummary
Int -> ReadS ModelSummary
ReadS [ModelSummary]
(Int -> ReadS ModelSummary)
-> ReadS [ModelSummary]
-> ReadPrec ModelSummary
-> ReadPrec [ModelSummary]
-> Read ModelSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelSummary]
$creadListPrec :: ReadPrec [ModelSummary]
readPrec :: ReadPrec ModelSummary
$creadPrec :: ReadPrec ModelSummary
readList :: ReadS [ModelSummary]
$creadList :: ReadS [ModelSummary]
readsPrec :: Int -> ReadS ModelSummary
$creadsPrec :: Int -> ReadS ModelSummary
Prelude.Read, Int -> ModelSummary -> ShowS
[ModelSummary] -> ShowS
ModelSummary -> String
(Int -> ModelSummary -> ShowS)
-> (ModelSummary -> String)
-> ([ModelSummary] -> ShowS)
-> Show ModelSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelSummary] -> ShowS
$cshowList :: [ModelSummary] -> ShowS
show :: ModelSummary -> String
$cshow :: ModelSummary -> String
showsPrec :: Int -> ModelSummary -> ShowS
$cshowsPrec :: Int -> ModelSummary -> ShowS
Prelude.Show, (forall x. ModelSummary -> Rep ModelSummary x)
-> (forall x. Rep ModelSummary x -> ModelSummary)
-> Generic ModelSummary
forall x. Rep ModelSummary x -> ModelSummary
forall x. ModelSummary -> Rep ModelSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelSummary x -> ModelSummary
$cfrom :: forall x. ModelSummary -> Rep ModelSummary x
Prelude.Generic)

-- |
-- Create a value of 'ModelSummary' 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:
--
-- 'modelName', 'modelSummary_modelName' - The name of the model that you want a summary for.
--
-- 'modelArn', 'modelSummary_modelArn' - The Amazon Resource Name (ARN) of the model.
--
-- 'creationTime', 'modelSummary_creationTime' - A timestamp that indicates when the model was created.
newModelSummary ::
  -- | 'modelName'
  Prelude.Text ->
  -- | 'modelArn'
  Prelude.Text ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  ModelSummary
newModelSummary :: Text -> Text -> UTCTime -> ModelSummary
newModelSummary Text
pModelName_ Text
pModelArn_ UTCTime
pCreationTime_ =
  ModelSummary' :: Text -> Text -> POSIX -> ModelSummary
ModelSummary'
    { $sel:modelName:ModelSummary' :: Text
modelName = Text
pModelName_,
      $sel:modelArn:ModelSummary' :: Text
modelArn = Text
pModelArn_,
      $sel:creationTime:ModelSummary' :: 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_
    }

-- | The name of the model that you want a summary for.
modelSummary_modelName :: Lens.Lens' ModelSummary Prelude.Text
modelSummary_modelName :: (Text -> f Text) -> ModelSummary -> f ModelSummary
modelSummary_modelName = (ModelSummary -> Text)
-> (ModelSummary -> Text -> ModelSummary)
-> Lens ModelSummary ModelSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelSummary' {Text
modelName :: Text
$sel:modelName:ModelSummary' :: ModelSummary -> Text
modelName} -> Text
modelName) (\s :: ModelSummary
s@ModelSummary' {} Text
a -> ModelSummary
s {$sel:modelName:ModelSummary' :: Text
modelName = Text
a} :: ModelSummary)

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

-- | A timestamp that indicates when the model was created.
modelSummary_creationTime :: Lens.Lens' ModelSummary Prelude.UTCTime
modelSummary_creationTime :: (UTCTime -> f UTCTime) -> ModelSummary -> f ModelSummary
modelSummary_creationTime = (ModelSummary -> POSIX)
-> (ModelSummary -> POSIX -> ModelSummary)
-> Lens ModelSummary ModelSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelSummary' {POSIX
creationTime :: POSIX
$sel:creationTime:ModelSummary' :: ModelSummary -> POSIX
creationTime} -> POSIX
creationTime) (\s :: ModelSummary
s@ModelSummary' {} POSIX
a -> ModelSummary
s {$sel:creationTime:ModelSummary' :: POSIX
creationTime = POSIX
a} :: ModelSummary) ((POSIX -> f POSIX) -> ModelSummary -> f ModelSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ModelSummary
-> f ModelSummary
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

instance Core.FromJSON ModelSummary where
  parseJSON :: Value -> Parser ModelSummary
parseJSON =
    String
-> (Object -> Parser ModelSummary) -> Value -> Parser ModelSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ModelSummary"
      ( \Object
x ->
          Text -> Text -> POSIX -> ModelSummary
ModelSummary'
            (Text -> Text -> POSIX -> ModelSummary)
-> Parser Text -> Parser (Text -> POSIX -> ModelSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ModelName")
            Parser (Text -> POSIX -> ModelSummary)
-> Parser Text -> Parser (POSIX -> ModelSummary)
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
"ModelArn")
            Parser (POSIX -> ModelSummary)
-> Parser POSIX -> Parser ModelSummary
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")
      )

instance Prelude.Hashable ModelSummary

instance Prelude.NFData ModelSummary