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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.ActionSource
import Amazonka.SageMaker.Types.ActionStatus

-- | Lists the properties of an /action/. An action represents an action or
-- activity. Some examples are a workflow step and a model deployment.
-- Generally, an action involves at least one input artifact or output
-- artifact.
--
-- /See:/ 'newActionSummary' smart constructor.
data ActionSummary = ActionSummary'
  { -- | When the action was created.
    ActionSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the action.
    ActionSummary -> Maybe ActionStatus
status :: Prelude.Maybe ActionStatus,
    -- | When the action was last modified.
    ActionSummary -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the action.
    ActionSummary -> Maybe Text
actionName :: Prelude.Maybe Prelude.Text,
    -- | The source of the action.
    ActionSummary -> Maybe ActionSource
source :: Prelude.Maybe ActionSource,
    -- | The Amazon Resource Name (ARN) of the action.
    ActionSummary -> Maybe Text
actionArn :: Prelude.Maybe Prelude.Text,
    -- | The type of the action.
    ActionSummary -> Maybe Text
actionType :: Prelude.Maybe Prelude.Text
  }
  deriving (ActionSummary -> ActionSummary -> Bool
(ActionSummary -> ActionSummary -> Bool)
-> (ActionSummary -> ActionSummary -> Bool) -> Eq ActionSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionSummary -> ActionSummary -> Bool
$c/= :: ActionSummary -> ActionSummary -> Bool
== :: ActionSummary -> ActionSummary -> Bool
$c== :: ActionSummary -> ActionSummary -> Bool
Prelude.Eq, ReadPrec [ActionSummary]
ReadPrec ActionSummary
Int -> ReadS ActionSummary
ReadS [ActionSummary]
(Int -> ReadS ActionSummary)
-> ReadS [ActionSummary]
-> ReadPrec ActionSummary
-> ReadPrec [ActionSummary]
-> Read ActionSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActionSummary]
$creadListPrec :: ReadPrec [ActionSummary]
readPrec :: ReadPrec ActionSummary
$creadPrec :: ReadPrec ActionSummary
readList :: ReadS [ActionSummary]
$creadList :: ReadS [ActionSummary]
readsPrec :: Int -> ReadS ActionSummary
$creadsPrec :: Int -> ReadS ActionSummary
Prelude.Read, Int -> ActionSummary -> ShowS
[ActionSummary] -> ShowS
ActionSummary -> String
(Int -> ActionSummary -> ShowS)
-> (ActionSummary -> String)
-> ([ActionSummary] -> ShowS)
-> Show ActionSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionSummary] -> ShowS
$cshowList :: [ActionSummary] -> ShowS
show :: ActionSummary -> String
$cshow :: ActionSummary -> String
showsPrec :: Int -> ActionSummary -> ShowS
$cshowsPrec :: Int -> ActionSummary -> ShowS
Prelude.Show, (forall x. ActionSummary -> Rep ActionSummary x)
-> (forall x. Rep ActionSummary x -> ActionSummary)
-> Generic ActionSummary
forall x. Rep ActionSummary x -> ActionSummary
forall x. ActionSummary -> Rep ActionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActionSummary x -> ActionSummary
$cfrom :: forall x. ActionSummary -> Rep ActionSummary x
Prelude.Generic)

-- |
-- Create a value of 'ActionSummary' 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', 'actionSummary_creationTime' - When the action was created.
--
-- 'status', 'actionSummary_status' - The status of the action.
--
-- 'lastModifiedTime', 'actionSummary_lastModifiedTime' - When the action was last modified.
--
-- 'actionName', 'actionSummary_actionName' - The name of the action.
--
-- 'source', 'actionSummary_source' - The source of the action.
--
-- 'actionArn', 'actionSummary_actionArn' - The Amazon Resource Name (ARN) of the action.
--
-- 'actionType', 'actionSummary_actionType' - The type of the action.
newActionSummary ::
  ActionSummary
newActionSummary :: ActionSummary
newActionSummary =
  ActionSummary' :: Maybe POSIX
-> Maybe ActionStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe ActionSource
-> Maybe Text
-> Maybe Text
-> ActionSummary
ActionSummary'
    { $sel:creationTime:ActionSummary' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ActionSummary' :: Maybe ActionStatus
status = Maybe ActionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:ActionSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:actionName:ActionSummary' :: Maybe Text
actionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:source:ActionSummary' :: Maybe ActionSource
source = Maybe ActionSource
forall a. Maybe a
Prelude.Nothing,
      $sel:actionArn:ActionSummary' :: Maybe Text
actionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:actionType:ActionSummary' :: Maybe Text
actionType = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The status of the action.
actionSummary_status :: Lens.Lens' ActionSummary (Prelude.Maybe ActionStatus)
actionSummary_status :: (Maybe ActionStatus -> f (Maybe ActionStatus))
-> ActionSummary -> f ActionSummary
actionSummary_status = (ActionSummary -> Maybe ActionStatus)
-> (ActionSummary -> Maybe ActionStatus -> ActionSummary)
-> Lens
     ActionSummary
     ActionSummary
     (Maybe ActionStatus)
     (Maybe ActionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionSummary' {Maybe ActionStatus
status :: Maybe ActionStatus
$sel:status:ActionSummary' :: ActionSummary -> Maybe ActionStatus
status} -> Maybe ActionStatus
status) (\s :: ActionSummary
s@ActionSummary' {} Maybe ActionStatus
a -> ActionSummary
s {$sel:status:ActionSummary' :: Maybe ActionStatus
status = Maybe ActionStatus
a} :: ActionSummary)

-- | When the action was last modified.
actionSummary_lastModifiedTime :: Lens.Lens' ActionSummary (Prelude.Maybe Prelude.UTCTime)
actionSummary_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ActionSummary -> f ActionSummary
actionSummary_lastModifiedTime = (ActionSummary -> Maybe POSIX)
-> (ActionSummary -> Maybe POSIX -> ActionSummary)
-> Lens ActionSummary ActionSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionSummary' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:ActionSummary' :: ActionSummary -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: ActionSummary
s@ActionSummary' {} Maybe POSIX
a -> ActionSummary
s {$sel:lastModifiedTime:ActionSummary' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: ActionSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ActionSummary -> f ActionSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ActionSummary
-> f ActionSummary
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

-- | The name of the action.
actionSummary_actionName :: Lens.Lens' ActionSummary (Prelude.Maybe Prelude.Text)
actionSummary_actionName :: (Maybe Text -> f (Maybe Text)) -> ActionSummary -> f ActionSummary
actionSummary_actionName = (ActionSummary -> Maybe Text)
-> (ActionSummary -> Maybe Text -> ActionSummary)
-> Lens ActionSummary ActionSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionSummary' {Maybe Text
actionName :: Maybe Text
$sel:actionName:ActionSummary' :: ActionSummary -> Maybe Text
actionName} -> Maybe Text
actionName) (\s :: ActionSummary
s@ActionSummary' {} Maybe Text
a -> ActionSummary
s {$sel:actionName:ActionSummary' :: Maybe Text
actionName = Maybe Text
a} :: ActionSummary)

-- | The source of the action.
actionSummary_source :: Lens.Lens' ActionSummary (Prelude.Maybe ActionSource)
actionSummary_source :: (Maybe ActionSource -> f (Maybe ActionSource))
-> ActionSummary -> f ActionSummary
actionSummary_source = (ActionSummary -> Maybe ActionSource)
-> (ActionSummary -> Maybe ActionSource -> ActionSummary)
-> Lens
     ActionSummary
     ActionSummary
     (Maybe ActionSource)
     (Maybe ActionSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionSummary' {Maybe ActionSource
source :: Maybe ActionSource
$sel:source:ActionSummary' :: ActionSummary -> Maybe ActionSource
source} -> Maybe ActionSource
source) (\s :: ActionSummary
s@ActionSummary' {} Maybe ActionSource
a -> ActionSummary
s {$sel:source:ActionSummary' :: Maybe ActionSource
source = Maybe ActionSource
a} :: ActionSummary)

-- | The Amazon Resource Name (ARN) of the action.
actionSummary_actionArn :: Lens.Lens' ActionSummary (Prelude.Maybe Prelude.Text)
actionSummary_actionArn :: (Maybe Text -> f (Maybe Text)) -> ActionSummary -> f ActionSummary
actionSummary_actionArn = (ActionSummary -> Maybe Text)
-> (ActionSummary -> Maybe Text -> ActionSummary)
-> Lens ActionSummary ActionSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionSummary' {Maybe Text
actionArn :: Maybe Text
$sel:actionArn:ActionSummary' :: ActionSummary -> Maybe Text
actionArn} -> Maybe Text
actionArn) (\s :: ActionSummary
s@ActionSummary' {} Maybe Text
a -> ActionSummary
s {$sel:actionArn:ActionSummary' :: Maybe Text
actionArn = Maybe Text
a} :: ActionSummary)

-- | The type of the action.
actionSummary_actionType :: Lens.Lens' ActionSummary (Prelude.Maybe Prelude.Text)
actionSummary_actionType :: (Maybe Text -> f (Maybe Text)) -> ActionSummary -> f ActionSummary
actionSummary_actionType = (ActionSummary -> Maybe Text)
-> (ActionSummary -> Maybe Text -> ActionSummary)
-> Lens ActionSummary ActionSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionSummary' {Maybe Text
actionType :: Maybe Text
$sel:actionType:ActionSummary' :: ActionSummary -> Maybe Text
actionType} -> Maybe Text
actionType) (\s :: ActionSummary
s@ActionSummary' {} Maybe Text
a -> ActionSummary
s {$sel:actionType:ActionSummary' :: Maybe Text
actionType = Maybe Text
a} :: ActionSummary)

instance Core.FromJSON ActionSummary where
  parseJSON :: Value -> Parser ActionSummary
parseJSON =
    String
-> (Object -> Parser ActionSummary)
-> Value
-> Parser ActionSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ActionSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe ActionStatus
-> Maybe POSIX
-> Maybe Text
-> Maybe ActionSource
-> Maybe Text
-> Maybe Text
-> ActionSummary
ActionSummary'
            (Maybe POSIX
 -> Maybe ActionStatus
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe ActionSource
 -> Maybe Text
 -> Maybe Text
 -> ActionSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ActionStatus
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ActionSource
      -> Maybe Text
      -> Maybe Text
      -> ActionSummary)
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 ActionStatus
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ActionSource
   -> Maybe Text
   -> Maybe Text
   -> ActionSummary)
-> Parser (Maybe ActionStatus)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe ActionSource
      -> Maybe Text
      -> Maybe Text
      -> ActionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ActionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe ActionSource
   -> Maybe Text
   -> Maybe Text
   -> ActionSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe ActionSource -> Maybe Text -> Maybe Text -> ActionSummary)
forall (f :: * -> *) a b. Applicative f => 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
"LastModifiedTime")
            Parser
  (Maybe Text
   -> Maybe ActionSource -> Maybe Text -> Maybe Text -> ActionSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ActionSource -> Maybe Text -> Maybe Text -> ActionSummary)
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
"ActionName")
            Parser
  (Maybe ActionSource -> Maybe Text -> Maybe Text -> ActionSummary)
-> Parser (Maybe ActionSource)
-> Parser (Maybe Text -> Maybe Text -> ActionSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ActionSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Source")
            Parser (Maybe Text -> Maybe Text -> ActionSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ActionSummary)
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
"ActionArn")
            Parser (Maybe Text -> ActionSummary)
-> Parser (Maybe Text) -> Parser ActionSummary
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
"ActionType")
      )

instance Prelude.Hashable ActionSummary

instance Prelude.NFData ActionSummary