{-# 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.Glue.Types.WorkflowRunStatistics
-- 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.Glue.Types.WorkflowRunStatistics 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

-- | Workflow run statistics provides statistics about the workflow run.
--
-- /See:/ 'newWorkflowRunStatistics' smart constructor.
data WorkflowRunStatistics = WorkflowRunStatistics'
  { -- | Indicates the count of job runs in the ERROR state in the workflow run.
    WorkflowRunStatistics -> Maybe Int
erroredActions :: Prelude.Maybe Prelude.Int,
    -- | Total number of Actions that have failed.
    WorkflowRunStatistics -> Maybe Int
failedActions :: Prelude.Maybe Prelude.Int,
    -- | Total number Actions in running state.
    WorkflowRunStatistics -> Maybe Int
runningActions :: Prelude.Maybe Prelude.Int,
    -- | Total number of Actions that have stopped.
    WorkflowRunStatistics -> Maybe Int
stoppedActions :: Prelude.Maybe Prelude.Int,
    -- | Total number of Actions that have succeeded.
    WorkflowRunStatistics -> Maybe Int
succeededActions :: Prelude.Maybe Prelude.Int,
    -- | Total number of Actions that timed out.
    WorkflowRunStatistics -> Maybe Int
timeoutActions :: Prelude.Maybe Prelude.Int,
    -- | Total number of Actions in the workflow run.
    WorkflowRunStatistics -> Maybe Int
totalActions :: Prelude.Maybe Prelude.Int,
    -- | Indicates the count of job runs in WAITING state in the workflow run.
    WorkflowRunStatistics -> Maybe Int
waitingActions :: Prelude.Maybe Prelude.Int
  }
  deriving (WorkflowRunStatistics -> WorkflowRunStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowRunStatistics -> WorkflowRunStatistics -> Bool
$c/= :: WorkflowRunStatistics -> WorkflowRunStatistics -> Bool
== :: WorkflowRunStatistics -> WorkflowRunStatistics -> Bool
$c== :: WorkflowRunStatistics -> WorkflowRunStatistics -> Bool
Prelude.Eq, ReadPrec [WorkflowRunStatistics]
ReadPrec WorkflowRunStatistics
Int -> ReadS WorkflowRunStatistics
ReadS [WorkflowRunStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowRunStatistics]
$creadListPrec :: ReadPrec [WorkflowRunStatistics]
readPrec :: ReadPrec WorkflowRunStatistics
$creadPrec :: ReadPrec WorkflowRunStatistics
readList :: ReadS [WorkflowRunStatistics]
$creadList :: ReadS [WorkflowRunStatistics]
readsPrec :: Int -> ReadS WorkflowRunStatistics
$creadsPrec :: Int -> ReadS WorkflowRunStatistics
Prelude.Read, Int -> WorkflowRunStatistics -> ShowS
[WorkflowRunStatistics] -> ShowS
WorkflowRunStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowRunStatistics] -> ShowS
$cshowList :: [WorkflowRunStatistics] -> ShowS
show :: WorkflowRunStatistics -> String
$cshow :: WorkflowRunStatistics -> String
showsPrec :: Int -> WorkflowRunStatistics -> ShowS
$cshowsPrec :: Int -> WorkflowRunStatistics -> ShowS
Prelude.Show, forall x. Rep WorkflowRunStatistics x -> WorkflowRunStatistics
forall x. WorkflowRunStatistics -> Rep WorkflowRunStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowRunStatistics x -> WorkflowRunStatistics
$cfrom :: forall x. WorkflowRunStatistics -> Rep WorkflowRunStatistics x
Prelude.Generic)

-- |
-- Create a value of 'WorkflowRunStatistics' 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:
--
-- 'erroredActions', 'workflowRunStatistics_erroredActions' - Indicates the count of job runs in the ERROR state in the workflow run.
--
-- 'failedActions', 'workflowRunStatistics_failedActions' - Total number of Actions that have failed.
--
-- 'runningActions', 'workflowRunStatistics_runningActions' - Total number Actions in running state.
--
-- 'stoppedActions', 'workflowRunStatistics_stoppedActions' - Total number of Actions that have stopped.
--
-- 'succeededActions', 'workflowRunStatistics_succeededActions' - Total number of Actions that have succeeded.
--
-- 'timeoutActions', 'workflowRunStatistics_timeoutActions' - Total number of Actions that timed out.
--
-- 'totalActions', 'workflowRunStatistics_totalActions' - Total number of Actions in the workflow run.
--
-- 'waitingActions', 'workflowRunStatistics_waitingActions' - Indicates the count of job runs in WAITING state in the workflow run.
newWorkflowRunStatistics ::
  WorkflowRunStatistics
newWorkflowRunStatistics :: WorkflowRunStatistics
newWorkflowRunStatistics =
  WorkflowRunStatistics'
    { $sel:erroredActions:WorkflowRunStatistics' :: Maybe Int
erroredActions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:failedActions:WorkflowRunStatistics' :: Maybe Int
failedActions = forall a. Maybe a
Prelude.Nothing,
      $sel:runningActions:WorkflowRunStatistics' :: Maybe Int
runningActions = forall a. Maybe a
Prelude.Nothing,
      $sel:stoppedActions:WorkflowRunStatistics' :: Maybe Int
stoppedActions = forall a. Maybe a
Prelude.Nothing,
      $sel:succeededActions:WorkflowRunStatistics' :: Maybe Int
succeededActions = forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutActions:WorkflowRunStatistics' :: Maybe Int
timeoutActions = forall a. Maybe a
Prelude.Nothing,
      $sel:totalActions:WorkflowRunStatistics' :: Maybe Int
totalActions = forall a. Maybe a
Prelude.Nothing,
      $sel:waitingActions:WorkflowRunStatistics' :: Maybe Int
waitingActions = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates the count of job runs in the ERROR state in the workflow run.
workflowRunStatistics_erroredActions :: Lens.Lens' WorkflowRunStatistics (Prelude.Maybe Prelude.Int)
workflowRunStatistics_erroredActions :: Lens' WorkflowRunStatistics (Maybe Int)
workflowRunStatistics_erroredActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRunStatistics' {Maybe Int
erroredActions :: Maybe Int
$sel:erroredActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
erroredActions} -> Maybe Int
erroredActions) (\s :: WorkflowRunStatistics
s@WorkflowRunStatistics' {} Maybe Int
a -> WorkflowRunStatistics
s {$sel:erroredActions:WorkflowRunStatistics' :: Maybe Int
erroredActions = Maybe Int
a} :: WorkflowRunStatistics)

-- | Total number of Actions that have failed.
workflowRunStatistics_failedActions :: Lens.Lens' WorkflowRunStatistics (Prelude.Maybe Prelude.Int)
workflowRunStatistics_failedActions :: Lens' WorkflowRunStatistics (Maybe Int)
workflowRunStatistics_failedActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRunStatistics' {Maybe Int
failedActions :: Maybe Int
$sel:failedActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
failedActions} -> Maybe Int
failedActions) (\s :: WorkflowRunStatistics
s@WorkflowRunStatistics' {} Maybe Int
a -> WorkflowRunStatistics
s {$sel:failedActions:WorkflowRunStatistics' :: Maybe Int
failedActions = Maybe Int
a} :: WorkflowRunStatistics)

-- | Total number Actions in running state.
workflowRunStatistics_runningActions :: Lens.Lens' WorkflowRunStatistics (Prelude.Maybe Prelude.Int)
workflowRunStatistics_runningActions :: Lens' WorkflowRunStatistics (Maybe Int)
workflowRunStatistics_runningActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRunStatistics' {Maybe Int
runningActions :: Maybe Int
$sel:runningActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
runningActions} -> Maybe Int
runningActions) (\s :: WorkflowRunStatistics
s@WorkflowRunStatistics' {} Maybe Int
a -> WorkflowRunStatistics
s {$sel:runningActions:WorkflowRunStatistics' :: Maybe Int
runningActions = Maybe Int
a} :: WorkflowRunStatistics)

-- | Total number of Actions that have stopped.
workflowRunStatistics_stoppedActions :: Lens.Lens' WorkflowRunStatistics (Prelude.Maybe Prelude.Int)
workflowRunStatistics_stoppedActions :: Lens' WorkflowRunStatistics (Maybe Int)
workflowRunStatistics_stoppedActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRunStatistics' {Maybe Int
stoppedActions :: Maybe Int
$sel:stoppedActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
stoppedActions} -> Maybe Int
stoppedActions) (\s :: WorkflowRunStatistics
s@WorkflowRunStatistics' {} Maybe Int
a -> WorkflowRunStatistics
s {$sel:stoppedActions:WorkflowRunStatistics' :: Maybe Int
stoppedActions = Maybe Int
a} :: WorkflowRunStatistics)

-- | Total number of Actions that have succeeded.
workflowRunStatistics_succeededActions :: Lens.Lens' WorkflowRunStatistics (Prelude.Maybe Prelude.Int)
workflowRunStatistics_succeededActions :: Lens' WorkflowRunStatistics (Maybe Int)
workflowRunStatistics_succeededActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRunStatistics' {Maybe Int
succeededActions :: Maybe Int
$sel:succeededActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
succeededActions} -> Maybe Int
succeededActions) (\s :: WorkflowRunStatistics
s@WorkflowRunStatistics' {} Maybe Int
a -> WorkflowRunStatistics
s {$sel:succeededActions:WorkflowRunStatistics' :: Maybe Int
succeededActions = Maybe Int
a} :: WorkflowRunStatistics)

-- | Total number of Actions that timed out.
workflowRunStatistics_timeoutActions :: Lens.Lens' WorkflowRunStatistics (Prelude.Maybe Prelude.Int)
workflowRunStatistics_timeoutActions :: Lens' WorkflowRunStatistics (Maybe Int)
workflowRunStatistics_timeoutActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRunStatistics' {Maybe Int
timeoutActions :: Maybe Int
$sel:timeoutActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
timeoutActions} -> Maybe Int
timeoutActions) (\s :: WorkflowRunStatistics
s@WorkflowRunStatistics' {} Maybe Int
a -> WorkflowRunStatistics
s {$sel:timeoutActions:WorkflowRunStatistics' :: Maybe Int
timeoutActions = Maybe Int
a} :: WorkflowRunStatistics)

-- | Total number of Actions in the workflow run.
workflowRunStatistics_totalActions :: Lens.Lens' WorkflowRunStatistics (Prelude.Maybe Prelude.Int)
workflowRunStatistics_totalActions :: Lens' WorkflowRunStatistics (Maybe Int)
workflowRunStatistics_totalActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRunStatistics' {Maybe Int
totalActions :: Maybe Int
$sel:totalActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
totalActions} -> Maybe Int
totalActions) (\s :: WorkflowRunStatistics
s@WorkflowRunStatistics' {} Maybe Int
a -> WorkflowRunStatistics
s {$sel:totalActions:WorkflowRunStatistics' :: Maybe Int
totalActions = Maybe Int
a} :: WorkflowRunStatistics)

-- | Indicates the count of job runs in WAITING state in the workflow run.
workflowRunStatistics_waitingActions :: Lens.Lens' WorkflowRunStatistics (Prelude.Maybe Prelude.Int)
workflowRunStatistics_waitingActions :: Lens' WorkflowRunStatistics (Maybe Int)
workflowRunStatistics_waitingActions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRunStatistics' {Maybe Int
waitingActions :: Maybe Int
$sel:waitingActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
waitingActions} -> Maybe Int
waitingActions) (\s :: WorkflowRunStatistics
s@WorkflowRunStatistics' {} Maybe Int
a -> WorkflowRunStatistics
s {$sel:waitingActions:WorkflowRunStatistics' :: Maybe Int
waitingActions = Maybe Int
a} :: WorkflowRunStatistics)

instance Data.FromJSON WorkflowRunStatistics where
  parseJSON :: Value -> Parser WorkflowRunStatistics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorkflowRunStatistics"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> WorkflowRunStatistics
WorkflowRunStatistics'
            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
"ErroredActions")
            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
"FailedActions")
            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
"RunningActions")
            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
"StoppedActions")
            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
"SucceededActions")
            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
"TimeoutActions")
            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
"TotalActions")
            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
"WaitingActions")
      )

instance Prelude.Hashable WorkflowRunStatistics where
  hashWithSalt :: Int -> WorkflowRunStatistics -> Int
hashWithSalt Int
_salt WorkflowRunStatistics' {Maybe Int
waitingActions :: Maybe Int
totalActions :: Maybe Int
timeoutActions :: Maybe Int
succeededActions :: Maybe Int
stoppedActions :: Maybe Int
runningActions :: Maybe Int
failedActions :: Maybe Int
erroredActions :: Maybe Int
$sel:waitingActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:totalActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:timeoutActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:succeededActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:stoppedActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:runningActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:failedActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:erroredActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
erroredActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
failedActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
runningActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
stoppedActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
succeededActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
timeoutActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
totalActions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
waitingActions

instance Prelude.NFData WorkflowRunStatistics where
  rnf :: WorkflowRunStatistics -> ()
rnf WorkflowRunStatistics' {Maybe Int
waitingActions :: Maybe Int
totalActions :: Maybe Int
timeoutActions :: Maybe Int
succeededActions :: Maybe Int
stoppedActions :: Maybe Int
runningActions :: Maybe Int
failedActions :: Maybe Int
erroredActions :: Maybe Int
$sel:waitingActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:totalActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:timeoutActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:succeededActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:stoppedActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:runningActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:failedActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
$sel:erroredActions:WorkflowRunStatistics' :: WorkflowRunStatistics -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
erroredActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
failedActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
runningActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
stoppedActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
succeededActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
timeoutActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalActions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
waitingActions