{-# 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.MapRunItemCounts
-- 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.MapRunItemCounts 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 items that were processed in all of the child
-- workflow executions that were started by a Map Run.
--
-- /See:/ 'newMapRunItemCounts' smart constructor.
data MapRunItemCounts = MapRunItemCounts'
  { -- | The total number of items to process in child workflow executions that
    -- haven\'t started running yet.
    MapRunItemCounts -> Natural
pending :: Prelude.Natural,
    -- | The total number of items being processed in child workflow executions
    -- that are currently in-progress.
    MapRunItemCounts -> Natural
running :: Prelude.Natural,
    -- | The total number of items processed in child workflow executions that
    -- have completed successfully.
    MapRunItemCounts -> Natural
succeeded :: Prelude.Natural,
    -- | The total number of items processed in child workflow executions that
    -- have failed.
    MapRunItemCounts -> Natural
failed :: Prelude.Natural,
    -- | The total number of items processed in child workflow executions that
    -- have timed out.
    MapRunItemCounts -> Natural
timedOut :: Prelude.Natural,
    -- | The total number of items processed in child workflow executions that
    -- were either stopped by the user or by Step Functions, because the Map
    -- Run failed.
    MapRunItemCounts -> Natural
aborted :: Prelude.Natural,
    -- | The total number of items processed in all the child workflow executions
    -- started by a Map Run.
    MapRunItemCounts -> Natural
total :: Prelude.Natural,
    -- | Returns the count of items 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/.
    MapRunItemCounts -> Natural
resultsWritten :: Prelude.Natural
  }
  deriving (MapRunItemCounts -> MapRunItemCounts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MapRunItemCounts -> MapRunItemCounts -> Bool
$c/= :: MapRunItemCounts -> MapRunItemCounts -> Bool
== :: MapRunItemCounts -> MapRunItemCounts -> Bool
$c== :: MapRunItemCounts -> MapRunItemCounts -> Bool
Prelude.Eq, ReadPrec [MapRunItemCounts]
ReadPrec MapRunItemCounts
Int -> ReadS MapRunItemCounts
ReadS [MapRunItemCounts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MapRunItemCounts]
$creadListPrec :: ReadPrec [MapRunItemCounts]
readPrec :: ReadPrec MapRunItemCounts
$creadPrec :: ReadPrec MapRunItemCounts
readList :: ReadS [MapRunItemCounts]
$creadList :: ReadS [MapRunItemCounts]
readsPrec :: Int -> ReadS MapRunItemCounts
$creadsPrec :: Int -> ReadS MapRunItemCounts
Prelude.Read, Int -> MapRunItemCounts -> ShowS
[MapRunItemCounts] -> ShowS
MapRunItemCounts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MapRunItemCounts] -> ShowS
$cshowList :: [MapRunItemCounts] -> ShowS
show :: MapRunItemCounts -> String
$cshow :: MapRunItemCounts -> String
showsPrec :: Int -> MapRunItemCounts -> ShowS
$cshowsPrec :: Int -> MapRunItemCounts -> ShowS
Prelude.Show, forall x. Rep MapRunItemCounts x -> MapRunItemCounts
forall x. MapRunItemCounts -> Rep MapRunItemCounts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MapRunItemCounts x -> MapRunItemCounts
$cfrom :: forall x. MapRunItemCounts -> Rep MapRunItemCounts x
Prelude.Generic)

-- |
-- Create a value of 'MapRunItemCounts' 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', 'mapRunItemCounts_pending' - The total number of items to process in child workflow executions that
-- haven\'t started running yet.
--
-- 'running', 'mapRunItemCounts_running' - The total number of items being processed in child workflow executions
-- that are currently in-progress.
--
-- 'succeeded', 'mapRunItemCounts_succeeded' - The total number of items processed in child workflow executions that
-- have completed successfully.
--
-- 'failed', 'mapRunItemCounts_failed' - The total number of items processed in child workflow executions that
-- have failed.
--
-- 'timedOut', 'mapRunItemCounts_timedOut' - The total number of items processed in child workflow executions that
-- have timed out.
--
-- 'aborted', 'mapRunItemCounts_aborted' - The total number of items processed in child workflow executions that
-- were either stopped by the user or by Step Functions, because the Map
-- Run failed.
--
-- 'total', 'mapRunItemCounts_total' - The total number of items processed in all the child workflow executions
-- started by a Map Run.
--
-- 'resultsWritten', 'mapRunItemCounts_resultsWritten' - Returns the count of items 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/.
newMapRunItemCounts ::
  -- | 'pending'
  Prelude.Natural ->
  -- | 'running'
  Prelude.Natural ->
  -- | 'succeeded'
  Prelude.Natural ->
  -- | 'failed'
  Prelude.Natural ->
  -- | 'timedOut'
  Prelude.Natural ->
  -- | 'aborted'
  Prelude.Natural ->
  -- | 'total'
  Prelude.Natural ->
  -- | 'resultsWritten'
  Prelude.Natural ->
  MapRunItemCounts
newMapRunItemCounts :: Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> MapRunItemCounts
newMapRunItemCounts
  Natural
pPending_
  Natural
pRunning_
  Natural
pSucceeded_
  Natural
pFailed_
  Natural
pTimedOut_
  Natural
pAborted_
  Natural
pTotal_
  Natural
pResultsWritten_ =
    MapRunItemCounts'
      { $sel:pending:MapRunItemCounts' :: Natural
pending = Natural
pPending_,
        $sel:running:MapRunItemCounts' :: Natural
running = Natural
pRunning_,
        $sel:succeeded:MapRunItemCounts' :: Natural
succeeded = Natural
pSucceeded_,
        $sel:failed:MapRunItemCounts' :: Natural
failed = Natural
pFailed_,
        $sel:timedOut:MapRunItemCounts' :: Natural
timedOut = Natural
pTimedOut_,
        $sel:aborted:MapRunItemCounts' :: Natural
aborted = Natural
pAborted_,
        $sel:total:MapRunItemCounts' :: Natural
total = Natural
pTotal_,
        $sel:resultsWritten:MapRunItemCounts' :: Natural
resultsWritten = Natural
pResultsWritten_
      }

-- | The total number of items to process in child workflow executions that
-- haven\'t started running yet.
mapRunItemCounts_pending :: Lens.Lens' MapRunItemCounts Prelude.Natural
mapRunItemCounts_pending :: Lens' MapRunItemCounts Natural
mapRunItemCounts_pending = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunItemCounts' {Natural
pending :: Natural
$sel:pending:MapRunItemCounts' :: MapRunItemCounts -> Natural
pending} -> Natural
pending) (\s :: MapRunItemCounts
s@MapRunItemCounts' {} Natural
a -> MapRunItemCounts
s {$sel:pending:MapRunItemCounts' :: Natural
pending = Natural
a} :: MapRunItemCounts)

-- | The total number of items being processed in child workflow executions
-- that are currently in-progress.
mapRunItemCounts_running :: Lens.Lens' MapRunItemCounts Prelude.Natural
mapRunItemCounts_running :: Lens' MapRunItemCounts Natural
mapRunItemCounts_running = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunItemCounts' {Natural
running :: Natural
$sel:running:MapRunItemCounts' :: MapRunItemCounts -> Natural
running} -> Natural
running) (\s :: MapRunItemCounts
s@MapRunItemCounts' {} Natural
a -> MapRunItemCounts
s {$sel:running:MapRunItemCounts' :: Natural
running = Natural
a} :: MapRunItemCounts)

-- | The total number of items processed in child workflow executions that
-- have completed successfully.
mapRunItemCounts_succeeded :: Lens.Lens' MapRunItemCounts Prelude.Natural
mapRunItemCounts_succeeded :: Lens' MapRunItemCounts Natural
mapRunItemCounts_succeeded = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunItemCounts' {Natural
succeeded :: Natural
$sel:succeeded:MapRunItemCounts' :: MapRunItemCounts -> Natural
succeeded} -> Natural
succeeded) (\s :: MapRunItemCounts
s@MapRunItemCounts' {} Natural
a -> MapRunItemCounts
s {$sel:succeeded:MapRunItemCounts' :: Natural
succeeded = Natural
a} :: MapRunItemCounts)

-- | The total number of items processed in child workflow executions that
-- have failed.
mapRunItemCounts_failed :: Lens.Lens' MapRunItemCounts Prelude.Natural
mapRunItemCounts_failed :: Lens' MapRunItemCounts Natural
mapRunItemCounts_failed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunItemCounts' {Natural
failed :: Natural
$sel:failed:MapRunItemCounts' :: MapRunItemCounts -> Natural
failed} -> Natural
failed) (\s :: MapRunItemCounts
s@MapRunItemCounts' {} Natural
a -> MapRunItemCounts
s {$sel:failed:MapRunItemCounts' :: Natural
failed = Natural
a} :: MapRunItemCounts)

-- | The total number of items processed in child workflow executions that
-- have timed out.
mapRunItemCounts_timedOut :: Lens.Lens' MapRunItemCounts Prelude.Natural
mapRunItemCounts_timedOut :: Lens' MapRunItemCounts Natural
mapRunItemCounts_timedOut = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunItemCounts' {Natural
timedOut :: Natural
$sel:timedOut:MapRunItemCounts' :: MapRunItemCounts -> Natural
timedOut} -> Natural
timedOut) (\s :: MapRunItemCounts
s@MapRunItemCounts' {} Natural
a -> MapRunItemCounts
s {$sel:timedOut:MapRunItemCounts' :: Natural
timedOut = Natural
a} :: MapRunItemCounts)

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

-- | The total number of items processed in all the child workflow executions
-- started by a Map Run.
mapRunItemCounts_total :: Lens.Lens' MapRunItemCounts Prelude.Natural
mapRunItemCounts_total :: Lens' MapRunItemCounts Natural
mapRunItemCounts_total = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunItemCounts' {Natural
total :: Natural
$sel:total:MapRunItemCounts' :: MapRunItemCounts -> Natural
total} -> Natural
total) (\s :: MapRunItemCounts
s@MapRunItemCounts' {} Natural
a -> MapRunItemCounts
s {$sel:total:MapRunItemCounts' :: Natural
total = Natural
a} :: MapRunItemCounts)

-- | Returns the count of items 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/.
mapRunItemCounts_resultsWritten :: Lens.Lens' MapRunItemCounts Prelude.Natural
mapRunItemCounts_resultsWritten :: Lens' MapRunItemCounts Natural
mapRunItemCounts_resultsWritten = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MapRunItemCounts' {Natural
resultsWritten :: Natural
$sel:resultsWritten:MapRunItemCounts' :: MapRunItemCounts -> Natural
resultsWritten} -> Natural
resultsWritten) (\s :: MapRunItemCounts
s@MapRunItemCounts' {} Natural
a -> MapRunItemCounts
s {$sel:resultsWritten:MapRunItemCounts' :: Natural
resultsWritten = Natural
a} :: MapRunItemCounts)

instance Data.FromJSON MapRunItemCounts where
  parseJSON :: Value -> Parser MapRunItemCounts
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MapRunItemCounts"
      ( \Object
x ->
          Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> MapRunItemCounts
MapRunItemCounts'
            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 MapRunItemCounts where
  hashWithSalt :: Int -> MapRunItemCounts -> Int
hashWithSalt Int
_salt MapRunItemCounts' {Natural
resultsWritten :: Natural
total :: Natural
aborted :: Natural
timedOut :: Natural
failed :: Natural
succeeded :: Natural
running :: Natural
pending :: Natural
$sel:resultsWritten:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:total:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:aborted:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:timedOut:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:failed:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:succeeded:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:running:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:pending:MapRunItemCounts' :: MapRunItemCounts -> 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 MapRunItemCounts where
  rnf :: MapRunItemCounts -> ()
rnf MapRunItemCounts' {Natural
resultsWritten :: Natural
total :: Natural
aborted :: Natural
timedOut :: Natural
failed :: Natural
succeeded :: Natural
running :: Natural
pending :: Natural
$sel:resultsWritten:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:total:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:aborted:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:timedOut:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:failed:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:succeeded:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:running:MapRunItemCounts' :: MapRunItemCounts -> Natural
$sel:pending:MapRunItemCounts' :: MapRunItemCounts -> 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