{-# 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.ModelCardSummary
-- 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.ModelCardSummary 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.ModelCardStatus

-- | A summary of the model card.
--
-- /See:/ 'newModelCardSummary' smart constructor.
data ModelCardSummary = ModelCardSummary'
  { -- | The date and time that the model card was last modified.
    ModelCardSummary -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the model card.
    ModelCardSummary -> Text
modelCardName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the model card.
    ModelCardSummary -> Text
modelCardArn :: Prelude.Text,
    -- | The approval status of the model card within your organization.
    -- Different organizations might have different criteria for model card
    -- review and approval.
    --
    -- -   @Draft@: The model card is a work in progress.
    --
    -- -   @PendingReview@: The model card is pending review.
    --
    -- -   @Approved@: The model card is approved.
    --
    -- -   @Archived@: The model card is archived. No more updates should be
    --     made to the model card, but it can still be exported.
    ModelCardSummary -> ModelCardStatus
modelCardStatus :: ModelCardStatus,
    -- | The date and time that the model card was created.
    ModelCardSummary -> POSIX
creationTime :: Data.POSIX
  }
  deriving (ModelCardSummary -> ModelCardSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModelCardSummary -> ModelCardSummary -> Bool
$c/= :: ModelCardSummary -> ModelCardSummary -> Bool
== :: ModelCardSummary -> ModelCardSummary -> Bool
$c== :: ModelCardSummary -> ModelCardSummary -> Bool
Prelude.Eq, ReadPrec [ModelCardSummary]
ReadPrec ModelCardSummary
Int -> ReadS ModelCardSummary
ReadS [ModelCardSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModelCardSummary]
$creadListPrec :: ReadPrec [ModelCardSummary]
readPrec :: ReadPrec ModelCardSummary
$creadPrec :: ReadPrec ModelCardSummary
readList :: ReadS [ModelCardSummary]
$creadList :: ReadS [ModelCardSummary]
readsPrec :: Int -> ReadS ModelCardSummary
$creadsPrec :: Int -> ReadS ModelCardSummary
Prelude.Read, Int -> ModelCardSummary -> ShowS
[ModelCardSummary] -> ShowS
ModelCardSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModelCardSummary] -> ShowS
$cshowList :: [ModelCardSummary] -> ShowS
show :: ModelCardSummary -> String
$cshow :: ModelCardSummary -> String
showsPrec :: Int -> ModelCardSummary -> ShowS
$cshowsPrec :: Int -> ModelCardSummary -> ShowS
Prelude.Show, forall x. Rep ModelCardSummary x -> ModelCardSummary
forall x. ModelCardSummary -> Rep ModelCardSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModelCardSummary x -> ModelCardSummary
$cfrom :: forall x. ModelCardSummary -> Rep ModelCardSummary x
Prelude.Generic)

-- |
-- Create a value of 'ModelCardSummary' 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:
--
-- 'lastModifiedTime', 'modelCardSummary_lastModifiedTime' - The date and time that the model card was last modified.
--
-- 'modelCardName', 'modelCardSummary_modelCardName' - The name of the model card.
--
-- 'modelCardArn', 'modelCardSummary_modelCardArn' - The Amazon Resource Name (ARN) of the model card.
--
-- 'modelCardStatus', 'modelCardSummary_modelCardStatus' - The approval status of the model card within your organization.
-- Different organizations might have different criteria for model card
-- review and approval.
--
-- -   @Draft@: The model card is a work in progress.
--
-- -   @PendingReview@: The model card is pending review.
--
-- -   @Approved@: The model card is approved.
--
-- -   @Archived@: The model card is archived. No more updates should be
--     made to the model card, but it can still be exported.
--
-- 'creationTime', 'modelCardSummary_creationTime' - The date and time that the model card was created.
newModelCardSummary ::
  -- | 'modelCardName'
  Prelude.Text ->
  -- | 'modelCardArn'
  Prelude.Text ->
  -- | 'modelCardStatus'
  ModelCardStatus ->
  -- | 'creationTime'
  Prelude.UTCTime ->
  ModelCardSummary
newModelCardSummary :: Text -> Text -> ModelCardStatus -> UTCTime -> ModelCardSummary
newModelCardSummary
  Text
pModelCardName_
  Text
pModelCardArn_
  ModelCardStatus
pModelCardStatus_
  UTCTime
pCreationTime_ =
    ModelCardSummary'
      { $sel:lastModifiedTime:ModelCardSummary' :: Maybe POSIX
lastModifiedTime =
          forall a. Maybe a
Prelude.Nothing,
        $sel:modelCardName:ModelCardSummary' :: Text
modelCardName = Text
pModelCardName_,
        $sel:modelCardArn:ModelCardSummary' :: Text
modelCardArn = Text
pModelCardArn_,
        $sel:modelCardStatus:ModelCardSummary' :: ModelCardStatus
modelCardStatus = ModelCardStatus
pModelCardStatus_,
        $sel:creationTime:ModelCardSummary' :: POSIX
creationTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreationTime_
      }

-- | The date and time that the model card was last modified.
modelCardSummary_lastModifiedTime :: Lens.Lens' ModelCardSummary (Prelude.Maybe Prelude.UTCTime)
modelCardSummary_lastModifiedTime :: Lens' ModelCardSummary (Maybe UTCTime)
modelCardSummary_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelCardSummary' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:ModelCardSummary' :: ModelCardSummary -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: ModelCardSummary
s@ModelCardSummary' {} Maybe POSIX
a -> ModelCardSummary
s {$sel:lastModifiedTime:ModelCardSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: ModelCardSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the model card.
modelCardSummary_modelCardName :: Lens.Lens' ModelCardSummary Prelude.Text
modelCardSummary_modelCardName :: Lens' ModelCardSummary Text
modelCardSummary_modelCardName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelCardSummary' {Text
modelCardName :: Text
$sel:modelCardName:ModelCardSummary' :: ModelCardSummary -> Text
modelCardName} -> Text
modelCardName) (\s :: ModelCardSummary
s@ModelCardSummary' {} Text
a -> ModelCardSummary
s {$sel:modelCardName:ModelCardSummary' :: Text
modelCardName = Text
a} :: ModelCardSummary)

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

-- | The approval status of the model card within your organization.
-- Different organizations might have different criteria for model card
-- review and approval.
--
-- -   @Draft@: The model card is a work in progress.
--
-- -   @PendingReview@: The model card is pending review.
--
-- -   @Approved@: The model card is approved.
--
-- -   @Archived@: The model card is archived. No more updates should be
--     made to the model card, but it can still be exported.
modelCardSummary_modelCardStatus :: Lens.Lens' ModelCardSummary ModelCardStatus
modelCardSummary_modelCardStatus :: Lens' ModelCardSummary ModelCardStatus
modelCardSummary_modelCardStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelCardSummary' {ModelCardStatus
modelCardStatus :: ModelCardStatus
$sel:modelCardStatus:ModelCardSummary' :: ModelCardSummary -> ModelCardStatus
modelCardStatus} -> ModelCardStatus
modelCardStatus) (\s :: ModelCardSummary
s@ModelCardSummary' {} ModelCardStatus
a -> ModelCardSummary
s {$sel:modelCardStatus:ModelCardSummary' :: ModelCardStatus
modelCardStatus = ModelCardStatus
a} :: ModelCardSummary)

-- | The date and time that the model card was created.
modelCardSummary_creationTime :: Lens.Lens' ModelCardSummary Prelude.UTCTime
modelCardSummary_creationTime :: Lens' ModelCardSummary UTCTime
modelCardSummary_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModelCardSummary' {POSIX
creationTime :: POSIX
$sel:creationTime:ModelCardSummary' :: ModelCardSummary -> POSIX
creationTime} -> POSIX
creationTime) (\s :: ModelCardSummary
s@ModelCardSummary' {} POSIX
a -> ModelCardSummary
s {$sel:creationTime:ModelCardSummary' :: POSIX
creationTime = POSIX
a} :: ModelCardSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON ModelCardSummary where
  parseJSON :: Value -> Parser ModelCardSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ModelCardSummary"
      ( \Object
x ->
          Maybe POSIX
-> Text -> Text -> ModelCardStatus -> POSIX -> ModelCardSummary
ModelCardSummary'
            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
"LastModifiedTime")
            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
"ModelCardName")
            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
"ModelCardArn")
            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
"ModelCardStatus")
            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")
      )

instance Prelude.Hashable ModelCardSummary where
  hashWithSalt :: Int -> ModelCardSummary -> Int
hashWithSalt Int
_salt ModelCardSummary' {Maybe POSIX
Text
POSIX
ModelCardStatus
creationTime :: POSIX
modelCardStatus :: ModelCardStatus
modelCardArn :: Text
modelCardName :: Text
lastModifiedTime :: Maybe POSIX
$sel:creationTime:ModelCardSummary' :: ModelCardSummary -> POSIX
$sel:modelCardStatus:ModelCardSummary' :: ModelCardSummary -> ModelCardStatus
$sel:modelCardArn:ModelCardSummary' :: ModelCardSummary -> Text
$sel:modelCardName:ModelCardSummary' :: ModelCardSummary -> Text
$sel:lastModifiedTime:ModelCardSummary' :: ModelCardSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
modelCardName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
modelCardArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ModelCardStatus
modelCardStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
creationTime

instance Prelude.NFData ModelCardSummary where
  rnf :: ModelCardSummary -> ()
rnf ModelCardSummary' {Maybe POSIX
Text
POSIX
ModelCardStatus
creationTime :: POSIX
modelCardStatus :: ModelCardStatus
modelCardArn :: Text
modelCardName :: Text
lastModifiedTime :: Maybe POSIX
$sel:creationTime:ModelCardSummary' :: ModelCardSummary -> POSIX
$sel:modelCardStatus:ModelCardSummary' :: ModelCardSummary -> ModelCardStatus
$sel:modelCardArn:ModelCardSummary' :: ModelCardSummary -> Text
$sel:modelCardName:ModelCardSummary' :: ModelCardSummary -> Text
$sel:lastModifiedTime:ModelCardSummary' :: ModelCardSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
modelCardName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
modelCardArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ModelCardStatus
modelCardStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
creationTime