{-# 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.WorkflowMetrics
-- 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.WorkflowMetrics where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.CustomerProfiles.Types.AppflowIntegrationWorkflowMetrics
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Generic object containing workflow execution metrics.
--
-- /See:/ 'newWorkflowMetrics' smart constructor.
data WorkflowMetrics = WorkflowMetrics'
  { -- | Workflow execution metrics for @APPFLOW_INTEGRATION@ workflow.
    WorkflowMetrics -> Maybe AppflowIntegrationWorkflowMetrics
appflowIntegration :: Prelude.Maybe AppflowIntegrationWorkflowMetrics
  }
  deriving (WorkflowMetrics -> WorkflowMetrics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowMetrics -> WorkflowMetrics -> Bool
$c/= :: WorkflowMetrics -> WorkflowMetrics -> Bool
== :: WorkflowMetrics -> WorkflowMetrics -> Bool
$c== :: WorkflowMetrics -> WorkflowMetrics -> Bool
Prelude.Eq, ReadPrec [WorkflowMetrics]
ReadPrec WorkflowMetrics
Int -> ReadS WorkflowMetrics
ReadS [WorkflowMetrics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowMetrics]
$creadListPrec :: ReadPrec [WorkflowMetrics]
readPrec :: ReadPrec WorkflowMetrics
$creadPrec :: ReadPrec WorkflowMetrics
readList :: ReadS [WorkflowMetrics]
$creadList :: ReadS [WorkflowMetrics]
readsPrec :: Int -> ReadS WorkflowMetrics
$creadsPrec :: Int -> ReadS WorkflowMetrics
Prelude.Read, Int -> WorkflowMetrics -> ShowS
[WorkflowMetrics] -> ShowS
WorkflowMetrics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowMetrics] -> ShowS
$cshowList :: [WorkflowMetrics] -> ShowS
show :: WorkflowMetrics -> String
$cshow :: WorkflowMetrics -> String
showsPrec :: Int -> WorkflowMetrics -> ShowS
$cshowsPrec :: Int -> WorkflowMetrics -> ShowS
Prelude.Show, forall x. Rep WorkflowMetrics x -> WorkflowMetrics
forall x. WorkflowMetrics -> Rep WorkflowMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowMetrics x -> WorkflowMetrics
$cfrom :: forall x. WorkflowMetrics -> Rep WorkflowMetrics x
Prelude.Generic)

-- |
-- Create a value of 'WorkflowMetrics' 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:
--
-- 'appflowIntegration', 'workflowMetrics_appflowIntegration' - Workflow execution metrics for @APPFLOW_INTEGRATION@ workflow.
newWorkflowMetrics ::
  WorkflowMetrics
newWorkflowMetrics :: WorkflowMetrics
newWorkflowMetrics =
  WorkflowMetrics'
    { $sel:appflowIntegration:WorkflowMetrics' :: Maybe AppflowIntegrationWorkflowMetrics
appflowIntegration =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Workflow execution metrics for @APPFLOW_INTEGRATION@ workflow.
workflowMetrics_appflowIntegration :: Lens.Lens' WorkflowMetrics (Prelude.Maybe AppflowIntegrationWorkflowMetrics)
workflowMetrics_appflowIntegration :: Lens' WorkflowMetrics (Maybe AppflowIntegrationWorkflowMetrics)
workflowMetrics_appflowIntegration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowMetrics' {Maybe AppflowIntegrationWorkflowMetrics
appflowIntegration :: Maybe AppflowIntegrationWorkflowMetrics
$sel:appflowIntegration:WorkflowMetrics' :: WorkflowMetrics -> Maybe AppflowIntegrationWorkflowMetrics
appflowIntegration} -> Maybe AppflowIntegrationWorkflowMetrics
appflowIntegration) (\s :: WorkflowMetrics
s@WorkflowMetrics' {} Maybe AppflowIntegrationWorkflowMetrics
a -> WorkflowMetrics
s {$sel:appflowIntegration:WorkflowMetrics' :: Maybe AppflowIntegrationWorkflowMetrics
appflowIntegration = Maybe AppflowIntegrationWorkflowMetrics
a} :: WorkflowMetrics)

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

instance Prelude.Hashable WorkflowMetrics where
  hashWithSalt :: Int -> WorkflowMetrics -> Int
hashWithSalt Int
_salt WorkflowMetrics' {Maybe AppflowIntegrationWorkflowMetrics
appflowIntegration :: Maybe AppflowIntegrationWorkflowMetrics
$sel:appflowIntegration:WorkflowMetrics' :: WorkflowMetrics -> Maybe AppflowIntegrationWorkflowMetrics
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AppflowIntegrationWorkflowMetrics
appflowIntegration

instance Prelude.NFData WorkflowMetrics where
  rnf :: WorkflowMetrics -> ()
rnf WorkflowMetrics' {Maybe AppflowIntegrationWorkflowMetrics
appflowIntegration :: Maybe AppflowIntegrationWorkflowMetrics
$sel:appflowIntegration:WorkflowMetrics' :: WorkflowMetrics -> Maybe AppflowIntegrationWorkflowMetrics
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AppflowIntegrationWorkflowMetrics
appflowIntegration