{-# 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.StepFunctions.Types.MapRunExecutionCounts
-- 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.StepFunctions.Types.MapRunExecutionCounts 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

-- | Contains details about all of the child workflow executions started by a
-- Map Run.
--
-- /See:/ 'newMapRunExecutionCounts' smart constructor.
data MapRunExecutionCounts = MapRunExecutionCounts'
  { -- | The total number of child workflow executions that were started by a Map
    -- Run, but haven\'t started executing yet.
    MapRunExecutionCounts -> Natural
pending :: Prelude.Natural,
    -- | The total number of child workflow executions that were started by a Map
    -- Run and are currently in-progress.
    MapRunExecutionCounts -> Natural
running :: Prelude.Natural,
    -- | The total number of child workflow executions that were started by a Map
    -- Run and have completed successfully.
    MapRunExecutionCounts -> Natural
succeeded :: Prelude.Natural,
    -- | The total number of child workflow executions that were started by a Map
    -- Run, but have failed.
    MapRunExecutionCounts -> Natural
failed :: Prelude.Natural,
    -- | The total number of child workflow executions that were started by a Map
    -- Run and have timed out.
    MapRunExecutionCounts -> Natural
timedOut :: Prelude.Natural,
    -- | The total number of child workflow executions that were started by a Map
    -- Run and were running, but were either stopped by the user or by Step
    -- Functions because the Map Run failed.
    MapRunExecutionCounts -> Natural
aborted :: Prelude.Natural,
    -- | The total number of child workflow executions that were started by a Map
    -- Run.
    MapRunExecutionCounts -> Natural
total :: Prelude.Natural,
    -- | Returns the count of child workflow executions whose results were
    -- written by @ResultWriter@. For more information, see
    -- <https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultwriter.html ResultWriter>
    -- in the /Step Functions Developer Guide/.
    MapRunExecutionCounts -> Natural
resultsWritten :: Prelude.Natural
  }
  deriving (MapRunExecutionCounts -> MapRunExecutionCounts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MapRunExecutionCounts -> MapRunExecutionCounts -> Bool
$c/= :: MapRunExecutionCounts -> MapRunExecutionCounts -> Bool
== :: MapRunExecutionCounts -> MapRunExecutionCounts -> Bool
$c== :: MapRunExecutionCounts -> MapRunExecutionCounts -> Bool
Prelude.Eq, ReadPrec [MapRunExecutionCounts]
ReadPrec MapRunExecutionCounts
Int -> ReadS MapRunExecutionCounts
ReadS [MapRunExecutionCounts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MapRunExecutionCounts]
$creadListPrec :: ReadPrec [MapRunExecutionCounts]
readPrec :: ReadPrec MapRunExecutionCounts
$creadPrec :: ReadPrec MapRunExecutionCounts
readList :: ReadS [MapRunExecutionCounts]
$creadList :: ReadS [MapRunExecutionCounts]
readsPrec :: Int -> ReadS MapRunExecutionCounts
$creadsPrec :: Int -> ReadS MapRunExecutionCounts
Prelude.Read, Int -> MapRunExecutionCounts -> ShowS
[MapRunExecutionCounts] -> ShowS
MapRunExecutionCounts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MapRunExecutionCounts] -> ShowS
$cshowList :: [MapRunExecutionCounts] -> ShowS
show :: MapRunExecutionCounts -> String
$cshow :: MapRunExecutionCounts -> String
showsPrec :: Int -> MapRunExecutionCounts -> ShowS
$cshowsPrec :: Int -> MapRunExecutionCounts -> ShowS
Prelude.Show, forall x. Rep MapRunExecutionCounts x -> MapRunExecutionCounts
forall x. MapRunExecutionCounts -> Rep MapRunExecutionCounts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MapRunExecutionCounts x -> MapRunExecutionCounts
$cfrom :: forall x. MapRunExecutionCounts -> Rep MapRunExecutionCounts x
Prelude.Generic)

-- |
-- Create a value of 'MapRunExecutionCounts' 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:
--
-- 'pending', 'mapRunExecutionCounts_pending' - The total number of child workflow executions that were started by a Map
-- Run, but haven\'t started executing yet.
--
-- 'running', 'mapRunExecutionCounts_running' - The total number of child workflow executions that were started by a Map
-- Run and are currently in-progress.
--
-- 'succeeded', 'mapRunExecutionCounts_succeeded' - The total number of child workflow executions that were started by a Map
-- Run and have completed successfully.
--
-- 'failed', 'mapRunExecutionCounts_failed' - The total number of child workflow executions that were started by a Map
-- Run, but have failed.
--
-- 'timedOut', 'mapRunExecutionCounts_timedOut' - The total number of child workflow executions that were started by a Map
-- Run and have timed out.
--
-- 'aborted', 'mapRunExecutionCounts_aborted' - The total number of child workflow executions that were started by a Map
-- Run and were running, but were either stopped by the user or by Step
-- Functions because the Map Run failed.
--
-- 'total', 'mapRunExecutionCounts_total' - The total number of child workflow executions that were started by a Map
-- Run.
--
-- 'resultsWritten', 'mapRunExecutionCounts_resultsWritten' - Returns the count of child workflow executions whose results were
-- written by @ResultWriter@. For more information, see
-- <https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultwriter.html ResultWriter>
-- in the /Step Functions Developer Guide/.
newMapRunExecutionCounts ::
  -- | 'pending'
  Prelude.Natural ->
  -- | 'running'
  Prelude.Natural ->
  -- | 'succeeded'
  Prelude.Natural ->
  -- | 'failed'
  Prelude.Natural ->
  -- | 'timedOut'
  Prelude.Natural ->
  -- | 'aborted'
  Prelude.Natural ->
  -- | 'total'
  Prelude.Natural ->
  -- | 'resultsWritten'
  Prelude.Natural ->
  MapRunExecutionCounts
newMapRunExecutionCounts :: Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> MapRunExecutionCounts
newMapRunExecutionCounts
  Natural
pPending_
  Natural
pRunning_
  Natural
pSucceeded_
  Natural
pFailed_
  Natural
pTimedOut_
  Natural
pAborted_
  Natural
pTotal_
  Natural
pResultsWritten_ =
    MapRunExecutionCounts'
      { $sel:pending:MapRunExecutionCounts' :: Natural
pending = Natural
pPending_,
        $sel:running:MapRunExecutionCounts' :: Natural
running = Natural
pRunning_,
        $sel:succeeded:MapRunExecutionCounts' :: Natural
succeeded = Natural
pSucceeded_,
        $sel:failed:MapRunExecutionCounts' :: Natural
failed = Natural
pFailed_,
        $sel:timedOut:MapRunExecutionCounts' :: Natural
timedOut = Natural
pTimedOut_,
        $sel:aborted:MapRunExecutionCounts' :: Natural
aborted = Natural
pAborted_,
        $sel:total:MapRunExecutionCounts' :: Natural
total = Natural
pTotal_,
        $sel:resultsWritten:MapRunExecutionCounts' :: Natural
resultsWritten = Natural
pResultsWritten_
      }

-- | The total number of child workflow executions that were started by a Map
-- Run, but haven\'t started executing yet.
mapRunExecutionCounts_pending :: Lens.Lens' MapRunExecutionCounts Prelude.Natural
mapRunExecutionCounts_pending :: Lens' MapRunExecutionCounts Natural
mapRunExecutionCounts_pending = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunExecutionCounts' {Natural
pending :: Natural
$sel:pending:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
pending} -> Natural
pending) (\s :: MapRunExecutionCounts
s@MapRunExecutionCounts' {} Natural
a -> MapRunExecutionCounts
s {$sel:pending:MapRunExecutionCounts' :: Natural
pending = Natural
a} :: MapRunExecutionCounts)

-- | The total number of child workflow executions that were started by a Map
-- Run and are currently in-progress.
mapRunExecutionCounts_running :: Lens.Lens' MapRunExecutionCounts Prelude.Natural
mapRunExecutionCounts_running :: Lens' MapRunExecutionCounts Natural
mapRunExecutionCounts_running = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunExecutionCounts' {Natural
running :: Natural
$sel:running:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
running} -> Natural
running) (\s :: MapRunExecutionCounts
s@MapRunExecutionCounts' {} Natural
a -> MapRunExecutionCounts
s {$sel:running:MapRunExecutionCounts' :: Natural
running = Natural
a} :: MapRunExecutionCounts)

-- | The total number of child workflow executions that were started by a Map
-- Run and have completed successfully.
mapRunExecutionCounts_succeeded :: Lens.Lens' MapRunExecutionCounts Prelude.Natural
mapRunExecutionCounts_succeeded :: Lens' MapRunExecutionCounts Natural
mapRunExecutionCounts_succeeded = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunExecutionCounts' {Natural
succeeded :: Natural
$sel:succeeded:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
succeeded} -> Natural
succeeded) (\s :: MapRunExecutionCounts
s@MapRunExecutionCounts' {} Natural
a -> MapRunExecutionCounts
s {$sel:succeeded:MapRunExecutionCounts' :: Natural
succeeded = Natural
a} :: MapRunExecutionCounts)

-- | The total number of child workflow executions that were started by a Map
-- Run, but have failed.
mapRunExecutionCounts_failed :: Lens.Lens' MapRunExecutionCounts Prelude.Natural
mapRunExecutionCounts_failed :: Lens' MapRunExecutionCounts Natural
mapRunExecutionCounts_failed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunExecutionCounts' {Natural
failed :: Natural
$sel:failed:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
failed} -> Natural
failed) (\s :: MapRunExecutionCounts
s@MapRunExecutionCounts' {} Natural
a -> MapRunExecutionCounts
s {$sel:failed:MapRunExecutionCounts' :: Natural
failed = Natural
a} :: MapRunExecutionCounts)

-- | The total number of child workflow executions that were started by a Map
-- Run and have timed out.
mapRunExecutionCounts_timedOut :: Lens.Lens' MapRunExecutionCounts Prelude.Natural
mapRunExecutionCounts_timedOut :: Lens' MapRunExecutionCounts Natural
mapRunExecutionCounts_timedOut = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunExecutionCounts' {Natural
timedOut :: Natural
$sel:timedOut:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
timedOut} -> Natural
timedOut) (\s :: MapRunExecutionCounts
s@MapRunExecutionCounts' {} Natural
a -> MapRunExecutionCounts
s {$sel:timedOut:MapRunExecutionCounts' :: Natural
timedOut = Natural
a} :: MapRunExecutionCounts)

-- | The total number of child workflow executions that were started by a Map
-- Run and were running, but were either stopped by the user or by Step
-- Functions because the Map Run failed.
mapRunExecutionCounts_aborted :: Lens.Lens' MapRunExecutionCounts Prelude.Natural
mapRunExecutionCounts_aborted :: Lens' MapRunExecutionCounts Natural
mapRunExecutionCounts_aborted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunExecutionCounts' {Natural
aborted :: Natural
$sel:aborted:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
aborted} -> Natural
aborted) (\s :: MapRunExecutionCounts
s@MapRunExecutionCounts' {} Natural
a -> MapRunExecutionCounts
s {$sel:aborted:MapRunExecutionCounts' :: Natural
aborted = Natural
a} :: MapRunExecutionCounts)

-- | The total number of child workflow executions that were started by a Map
-- Run.
mapRunExecutionCounts_total :: Lens.Lens' MapRunExecutionCounts Prelude.Natural
mapRunExecutionCounts_total :: Lens' MapRunExecutionCounts Natural
mapRunExecutionCounts_total = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunExecutionCounts' {Natural
total :: Natural
$sel:total:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
total} -> Natural
total) (\s :: MapRunExecutionCounts
s@MapRunExecutionCounts' {} Natural
a -> MapRunExecutionCounts
s {$sel:total:MapRunExecutionCounts' :: Natural
total = Natural
a} :: MapRunExecutionCounts)

-- | Returns the count of child workflow executions whose results were
-- written by @ResultWriter@. For more information, see
-- <https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultwriter.html ResultWriter>
-- in the /Step Functions Developer Guide/.
mapRunExecutionCounts_resultsWritten :: Lens.Lens' MapRunExecutionCounts Prelude.Natural
mapRunExecutionCounts_resultsWritten :: Lens' MapRunExecutionCounts Natural
mapRunExecutionCounts_resultsWritten = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunExecutionCounts' {Natural
resultsWritten :: Natural
$sel:resultsWritten:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
resultsWritten} -> Natural
resultsWritten) (\s :: MapRunExecutionCounts
s@MapRunExecutionCounts' {} Natural
a -> MapRunExecutionCounts
s {$sel:resultsWritten:MapRunExecutionCounts' :: Natural
resultsWritten = Natural
a} :: MapRunExecutionCounts)

instance Data.FromJSON MapRunExecutionCounts where
  parseJSON :: Value -> Parser MapRunExecutionCounts
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MapRunExecutionCounts"
      ( \Object
x ->
          Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> MapRunExecutionCounts
MapRunExecutionCounts'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"pending")
            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
"running")
            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
"succeeded")
            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
"failed")
            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
"timedOut")
            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
"aborted")
            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
"total")
            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
"resultsWritten")
      )

instance Prelude.Hashable MapRunExecutionCounts where
  hashWithSalt :: Int -> MapRunExecutionCounts -> Int
hashWithSalt Int
_salt MapRunExecutionCounts' {Natural
resultsWritten :: Natural
total :: Natural
aborted :: Natural
timedOut :: Natural
failed :: Natural
succeeded :: Natural
running :: Natural
pending :: Natural
$sel:resultsWritten:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:total:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:aborted:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:timedOut:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:failed:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:succeeded:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:running:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:pending:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
pending
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
running
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
succeeded
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
failed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
timedOut
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
aborted
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
total
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
resultsWritten

instance Prelude.NFData MapRunExecutionCounts where
  rnf :: MapRunExecutionCounts -> ()
rnf MapRunExecutionCounts' {Natural
resultsWritten :: Natural
total :: Natural
aborted :: Natural
timedOut :: Natural
failed :: Natural
succeeded :: Natural
running :: Natural
pending :: Natural
$sel:resultsWritten:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:total:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:aborted:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:timedOut:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:failed:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:succeeded:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:running:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
$sel:pending:MapRunExecutionCounts' :: MapRunExecutionCounts -> Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Natural
pending
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
running
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
succeeded
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
failed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
timedOut
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
aborted
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
total
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
resultsWritten