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

-- | The Amazon Resource Name (ARN) of the action.
actionSummary_actionArn :: Lens.Lens' ActionSummary (Prelude.Maybe Prelude.Text)
actionSummary_actionArn :: Lens' ActionSummary (Maybe Text)
actionSummary_actionArn = 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 name of the action.
actionSummary_actionName :: Lens.Lens' ActionSummary (Prelude.Maybe Prelude.Text)
actionSummary_actionName :: Lens' ActionSummary (Maybe Text)
actionSummary_actionName = 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 type of the action.
actionSummary_actionType :: Lens.Lens' ActionSummary (Prelude.Maybe Prelude.Text)
actionSummary_actionType :: Lens' ActionSummary (Maybe Text)
actionSummary_actionType = 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)

-- | When the action was created.
actionSummary_creationTime :: Lens.Lens' ActionSummary (Prelude.Maybe Prelude.UTCTime)
actionSummary_creationTime :: Lens' ActionSummary (Maybe UTCTime)
actionSummary_creationTime = 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) 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

-- | When the action was last modified.
actionSummary_lastModifiedTime :: Lens.Lens' ActionSummary (Prelude.Maybe Prelude.UTCTime)
actionSummary_lastModifiedTime :: Lens' ActionSummary (Maybe UTCTime)
actionSummary_lastModifiedTime = 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) 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 source of the action.
actionSummary_source :: Lens.Lens' ActionSummary (Prelude.Maybe ActionSource)
actionSummary_source :: Lens' ActionSummary (Maybe ActionSource)
actionSummary_source = 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 status of the action.
actionSummary_status :: Lens.Lens' ActionSummary (Prelude.Maybe ActionStatus)
actionSummary_status :: Lens' ActionSummary (Maybe ActionStatus)
actionSummary_status = 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)

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

instance Prelude.Hashable ActionSummary where
  hashWithSalt :: Int -> ActionSummary -> Int
hashWithSalt Int
_salt ActionSummary' {Maybe Text
Maybe POSIX
Maybe ActionSource
Maybe ActionStatus
status :: Maybe ActionStatus
source :: Maybe ActionSource
lastModifiedTime :: Maybe POSIX
creationTime :: Maybe POSIX
actionType :: Maybe Text
actionName :: Maybe Text
actionArn :: Maybe Text
$sel:status:ActionSummary' :: ActionSummary -> Maybe ActionStatus
$sel:source:ActionSummary' :: ActionSummary -> Maybe ActionSource
$sel:lastModifiedTime:ActionSummary' :: ActionSummary -> Maybe POSIX
$sel:creationTime:ActionSummary' :: ActionSummary -> Maybe POSIX
$sel:actionType:ActionSummary' :: ActionSummary -> Maybe Text
$sel:actionName:ActionSummary' :: ActionSummary -> Maybe Text
$sel:actionArn:ActionSummary' :: ActionSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
actionArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
actionName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
actionType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ActionSource
source
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ActionStatus
status

instance Prelude.NFData ActionSummary where
  rnf :: ActionSummary -> ()
rnf ActionSummary' {Maybe Text
Maybe POSIX
Maybe ActionSource
Maybe ActionStatus
status :: Maybe ActionStatus
source :: Maybe ActionSource
lastModifiedTime :: Maybe POSIX
creationTime :: Maybe POSIX
actionType :: Maybe Text
actionName :: Maybe Text
actionArn :: Maybe Text
$sel:status:ActionSummary' :: ActionSummary -> Maybe ActionStatus
$sel:source:ActionSummary' :: ActionSummary -> Maybe ActionSource
$sel:lastModifiedTime:ActionSummary' :: ActionSummary -> Maybe POSIX
$sel:creationTime:ActionSummary' :: ActionSummary -> Maybe POSIX
$sel:actionType:ActionSummary' :: ActionSummary -> Maybe Text
$sel:actionName:ActionSummary' :: ActionSummary -> Maybe Text
$sel:actionArn:ActionSummary' :: ActionSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
actionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
actionName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
actionType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe ActionSource
source
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ActionStatus
status