{-# 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.CustomerProfiles.Types.AppflowIntegrationWorkflowMetrics
-- 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.CustomerProfiles.Types.AppflowIntegrationWorkflowMetrics 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 specific execution metrics for @APPFLOW_INTEGRATION@ workflow.
--
-- /See:/ 'newAppflowIntegrationWorkflowMetrics' smart constructor.
data AppflowIntegrationWorkflowMetrics = AppflowIntegrationWorkflowMetrics'
  { -- | Number of records processed in @APPFLOW_INTEGRATION@ workflow.
    AppflowIntegrationWorkflowMetrics -> Integer
recordsProcessed :: Prelude.Integer,
    -- | Total steps completed in @APPFLOW_INTEGRATION@ workflow.
    AppflowIntegrationWorkflowMetrics -> Integer
stepsCompleted :: Prelude.Integer,
    -- | Total steps in @APPFLOW_INTEGRATION@ workflow.
    AppflowIntegrationWorkflowMetrics -> Integer
totalSteps :: Prelude.Integer
  }
  deriving (AppflowIntegrationWorkflowMetrics
-> AppflowIntegrationWorkflowMetrics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppflowIntegrationWorkflowMetrics
-> AppflowIntegrationWorkflowMetrics -> Bool
$c/= :: AppflowIntegrationWorkflowMetrics
-> AppflowIntegrationWorkflowMetrics -> Bool
== :: AppflowIntegrationWorkflowMetrics
-> AppflowIntegrationWorkflowMetrics -> Bool
$c== :: AppflowIntegrationWorkflowMetrics
-> AppflowIntegrationWorkflowMetrics -> Bool
Prelude.Eq, ReadPrec [AppflowIntegrationWorkflowMetrics]
ReadPrec AppflowIntegrationWorkflowMetrics
Int -> ReadS AppflowIntegrationWorkflowMetrics
ReadS [AppflowIntegrationWorkflowMetrics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppflowIntegrationWorkflowMetrics]
$creadListPrec :: ReadPrec [AppflowIntegrationWorkflowMetrics]
readPrec :: ReadPrec AppflowIntegrationWorkflowMetrics
$creadPrec :: ReadPrec AppflowIntegrationWorkflowMetrics
readList :: ReadS [AppflowIntegrationWorkflowMetrics]
$creadList :: ReadS [AppflowIntegrationWorkflowMetrics]
readsPrec :: Int -> ReadS AppflowIntegrationWorkflowMetrics
$creadsPrec :: Int -> ReadS AppflowIntegrationWorkflowMetrics
Prelude.Read, Int -> AppflowIntegrationWorkflowMetrics -> ShowS
[AppflowIntegrationWorkflowMetrics] -> ShowS
AppflowIntegrationWorkflowMetrics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppflowIntegrationWorkflowMetrics] -> ShowS
$cshowList :: [AppflowIntegrationWorkflowMetrics] -> ShowS
show :: AppflowIntegrationWorkflowMetrics -> String
$cshow :: AppflowIntegrationWorkflowMetrics -> String
showsPrec :: Int -> AppflowIntegrationWorkflowMetrics -> ShowS
$cshowsPrec :: Int -> AppflowIntegrationWorkflowMetrics -> ShowS
Prelude.Show, forall x.
Rep AppflowIntegrationWorkflowMetrics x
-> AppflowIntegrationWorkflowMetrics
forall x.
AppflowIntegrationWorkflowMetrics
-> Rep AppflowIntegrationWorkflowMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AppflowIntegrationWorkflowMetrics x
-> AppflowIntegrationWorkflowMetrics
$cfrom :: forall x.
AppflowIntegrationWorkflowMetrics
-> Rep AppflowIntegrationWorkflowMetrics x
Prelude.Generic)

-- |
-- Create a value of 'AppflowIntegrationWorkflowMetrics' 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:
--
-- 'recordsProcessed', 'appflowIntegrationWorkflowMetrics_recordsProcessed' - Number of records processed in @APPFLOW_INTEGRATION@ workflow.
--
-- 'stepsCompleted', 'appflowIntegrationWorkflowMetrics_stepsCompleted' - Total steps completed in @APPFLOW_INTEGRATION@ workflow.
--
-- 'totalSteps', 'appflowIntegrationWorkflowMetrics_totalSteps' - Total steps in @APPFLOW_INTEGRATION@ workflow.
newAppflowIntegrationWorkflowMetrics ::
  -- | 'recordsProcessed'
  Prelude.Integer ->
  -- | 'stepsCompleted'
  Prelude.Integer ->
  -- | 'totalSteps'
  Prelude.Integer ->
  AppflowIntegrationWorkflowMetrics
newAppflowIntegrationWorkflowMetrics :: Integer -> Integer -> Integer -> AppflowIntegrationWorkflowMetrics
newAppflowIntegrationWorkflowMetrics
  Integer
pRecordsProcessed_
  Integer
pStepsCompleted_
  Integer
pTotalSteps_ =
    AppflowIntegrationWorkflowMetrics'
      { $sel:recordsProcessed:AppflowIntegrationWorkflowMetrics' :: Integer
recordsProcessed =
          Integer
pRecordsProcessed_,
        $sel:stepsCompleted:AppflowIntegrationWorkflowMetrics' :: Integer
stepsCompleted = Integer
pStepsCompleted_,
        $sel:totalSteps:AppflowIntegrationWorkflowMetrics' :: Integer
totalSteps = Integer
pTotalSteps_
      }

-- | Number of records processed in @APPFLOW_INTEGRATION@ workflow.
appflowIntegrationWorkflowMetrics_recordsProcessed :: Lens.Lens' AppflowIntegrationWorkflowMetrics Prelude.Integer
appflowIntegrationWorkflowMetrics_recordsProcessed :: Lens' AppflowIntegrationWorkflowMetrics Integer
appflowIntegrationWorkflowMetrics_recordsProcessed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppflowIntegrationWorkflowMetrics' {Integer
recordsProcessed :: Integer
$sel:recordsProcessed:AppflowIntegrationWorkflowMetrics' :: AppflowIntegrationWorkflowMetrics -> Integer
recordsProcessed} -> Integer
recordsProcessed) (\s :: AppflowIntegrationWorkflowMetrics
s@AppflowIntegrationWorkflowMetrics' {} Integer
a -> AppflowIntegrationWorkflowMetrics
s {$sel:recordsProcessed:AppflowIntegrationWorkflowMetrics' :: Integer
recordsProcessed = Integer
a} :: AppflowIntegrationWorkflowMetrics)

-- | Total steps completed in @APPFLOW_INTEGRATION@ workflow.
appflowIntegrationWorkflowMetrics_stepsCompleted :: Lens.Lens' AppflowIntegrationWorkflowMetrics Prelude.Integer
appflowIntegrationWorkflowMetrics_stepsCompleted :: Lens' AppflowIntegrationWorkflowMetrics Integer
appflowIntegrationWorkflowMetrics_stepsCompleted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppflowIntegrationWorkflowMetrics' {Integer
stepsCompleted :: Integer
$sel:stepsCompleted:AppflowIntegrationWorkflowMetrics' :: AppflowIntegrationWorkflowMetrics -> Integer
stepsCompleted} -> Integer
stepsCompleted) (\s :: AppflowIntegrationWorkflowMetrics
s@AppflowIntegrationWorkflowMetrics' {} Integer
a -> AppflowIntegrationWorkflowMetrics
s {$sel:stepsCompleted:AppflowIntegrationWorkflowMetrics' :: Integer
stepsCompleted = Integer
a} :: AppflowIntegrationWorkflowMetrics)

-- | Total steps in @APPFLOW_INTEGRATION@ workflow.
appflowIntegrationWorkflowMetrics_totalSteps :: Lens.Lens' AppflowIntegrationWorkflowMetrics Prelude.Integer
appflowIntegrationWorkflowMetrics_totalSteps :: Lens' AppflowIntegrationWorkflowMetrics Integer
appflowIntegrationWorkflowMetrics_totalSteps = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppflowIntegrationWorkflowMetrics' {Integer
totalSteps :: Integer
$sel:totalSteps:AppflowIntegrationWorkflowMetrics' :: AppflowIntegrationWorkflowMetrics -> Integer
totalSteps} -> Integer
totalSteps) (\s :: AppflowIntegrationWorkflowMetrics
s@AppflowIntegrationWorkflowMetrics' {} Integer
a -> AppflowIntegrationWorkflowMetrics
s {$sel:totalSteps:AppflowIntegrationWorkflowMetrics' :: Integer
totalSteps = Integer
a} :: AppflowIntegrationWorkflowMetrics)

instance
  Data.FromJSON
    AppflowIntegrationWorkflowMetrics
  where
  parseJSON :: Value -> Parser AppflowIntegrationWorkflowMetrics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AppflowIntegrationWorkflowMetrics"
      ( \Object
x ->
          Integer -> Integer -> Integer -> AppflowIntegrationWorkflowMetrics
AppflowIntegrationWorkflowMetrics'
            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
"RecordsProcessed")
            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
"StepsCompleted")
            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
"TotalSteps")
      )

instance
  Prelude.Hashable
    AppflowIntegrationWorkflowMetrics
  where
  hashWithSalt :: Int -> AppflowIntegrationWorkflowMetrics -> Int
hashWithSalt
    Int
_salt
    AppflowIntegrationWorkflowMetrics' {Integer
totalSteps :: Integer
stepsCompleted :: Integer
recordsProcessed :: Integer
$sel:totalSteps:AppflowIntegrationWorkflowMetrics' :: AppflowIntegrationWorkflowMetrics -> Integer
$sel:stepsCompleted:AppflowIntegrationWorkflowMetrics' :: AppflowIntegrationWorkflowMetrics -> Integer
$sel:recordsProcessed:AppflowIntegrationWorkflowMetrics' :: AppflowIntegrationWorkflowMetrics -> Integer
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
recordsProcessed
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
stepsCompleted
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
totalSteps

instance
  Prelude.NFData
    AppflowIntegrationWorkflowMetrics
  where
  rnf :: AppflowIntegrationWorkflowMetrics -> ()
rnf AppflowIntegrationWorkflowMetrics' {Integer
totalSteps :: Integer
stepsCompleted :: Integer
recordsProcessed :: Integer
$sel:totalSteps:AppflowIntegrationWorkflowMetrics' :: AppflowIntegrationWorkflowMetrics -> Integer
$sel:stepsCompleted:AppflowIntegrationWorkflowMetrics' :: AppflowIntegrationWorkflowMetrics -> Integer
$sel:recordsProcessed:AppflowIntegrationWorkflowMetrics' :: AppflowIntegrationWorkflowMetrics -> Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Integer
recordsProcessed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
stepsCompleted
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Integer
totalSteps