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

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

-- | List containing steps in workflow.
--
-- /See:/ 'newWorkflowStepItem' smart constructor.
data WorkflowStepItem = WorkflowStepItem'
  { -- | Workflow step information specific to @APPFLOW_INTEGRATION@ workflow.
    WorkflowStepItem -> Maybe AppflowIntegrationWorkflowStep
appflowIntegration :: Prelude.Maybe AppflowIntegrationWorkflowStep
  }
  deriving (WorkflowStepItem -> WorkflowStepItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowStepItem -> WorkflowStepItem -> Bool
$c/= :: WorkflowStepItem -> WorkflowStepItem -> Bool
== :: WorkflowStepItem -> WorkflowStepItem -> Bool
$c== :: WorkflowStepItem -> WorkflowStepItem -> Bool
Prelude.Eq, ReadPrec [WorkflowStepItem]
ReadPrec WorkflowStepItem
Int -> ReadS WorkflowStepItem
ReadS [WorkflowStepItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowStepItem]
$creadListPrec :: ReadPrec [WorkflowStepItem]
readPrec :: ReadPrec WorkflowStepItem
$creadPrec :: ReadPrec WorkflowStepItem
readList :: ReadS [WorkflowStepItem]
$creadList :: ReadS [WorkflowStepItem]
readsPrec :: Int -> ReadS WorkflowStepItem
$creadsPrec :: Int -> ReadS WorkflowStepItem
Prelude.Read, Int -> WorkflowStepItem -> ShowS
[WorkflowStepItem] -> ShowS
WorkflowStepItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowStepItem] -> ShowS
$cshowList :: [WorkflowStepItem] -> ShowS
show :: WorkflowStepItem -> String
$cshow :: WorkflowStepItem -> String
showsPrec :: Int -> WorkflowStepItem -> ShowS
$cshowsPrec :: Int -> WorkflowStepItem -> ShowS
Prelude.Show, forall x. Rep WorkflowStepItem x -> WorkflowStepItem
forall x. WorkflowStepItem -> Rep WorkflowStepItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowStepItem x -> WorkflowStepItem
$cfrom :: forall x. WorkflowStepItem -> Rep WorkflowStepItem x
Prelude.Generic)

-- |
-- Create a value of 'WorkflowStepItem' 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', 'workflowStepItem_appflowIntegration' - Workflow step information specific to @APPFLOW_INTEGRATION@ workflow.
newWorkflowStepItem ::
  WorkflowStepItem
newWorkflowStepItem :: WorkflowStepItem
newWorkflowStepItem =
  WorkflowStepItem'
    { $sel:appflowIntegration:WorkflowStepItem' :: Maybe AppflowIntegrationWorkflowStep
appflowIntegration =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Workflow step information specific to @APPFLOW_INTEGRATION@ workflow.
workflowStepItem_appflowIntegration :: Lens.Lens' WorkflowStepItem (Prelude.Maybe AppflowIntegrationWorkflowStep)
workflowStepItem_appflowIntegration :: Lens' WorkflowStepItem (Maybe AppflowIntegrationWorkflowStep)
workflowStepItem_appflowIntegration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowStepItem' {Maybe AppflowIntegrationWorkflowStep
appflowIntegration :: Maybe AppflowIntegrationWorkflowStep
$sel:appflowIntegration:WorkflowStepItem' :: WorkflowStepItem -> Maybe AppflowIntegrationWorkflowStep
appflowIntegration} -> Maybe AppflowIntegrationWorkflowStep
appflowIntegration) (\s :: WorkflowStepItem
s@WorkflowStepItem' {} Maybe AppflowIntegrationWorkflowStep
a -> WorkflowStepItem
s {$sel:appflowIntegration:WorkflowStepItem' :: Maybe AppflowIntegrationWorkflowStep
appflowIntegration = Maybe AppflowIntegrationWorkflowStep
a} :: WorkflowStepItem)

instance Data.FromJSON WorkflowStepItem where
  parseJSON :: Value -> Parser WorkflowStepItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorkflowStepItem"
      ( \Object
x ->
          Maybe AppflowIntegrationWorkflowStep -> WorkflowStepItem
WorkflowStepItem'
            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 WorkflowStepItem where
  hashWithSalt :: Int -> WorkflowStepItem -> Int
hashWithSalt Int
_salt WorkflowStepItem' {Maybe AppflowIntegrationWorkflowStep
appflowIntegration :: Maybe AppflowIntegrationWorkflowStep
$sel:appflowIntegration:WorkflowStepItem' :: WorkflowStepItem -> Maybe AppflowIntegrationWorkflowStep
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AppflowIntegrationWorkflowStep
appflowIntegration

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