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

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

-- | A workflow in list of workflows.
--
-- /See:/ 'newListWorkflowsItem' smart constructor.
data ListWorkflowsItem = ListWorkflowsItem'
  { -- | The type of workflow. The only supported value is APPFLOW_INTEGRATION.
    ListWorkflowsItem -> WorkflowType
workflowType :: WorkflowType,
    -- | Unique identifier for the workflow.
    ListWorkflowsItem -> Text
workflowId :: Prelude.Text,
    -- | Status of workflow execution.
    ListWorkflowsItem -> Status
status :: Status,
    -- | Description for workflow execution status.
    ListWorkflowsItem -> Text
statusDescription :: Prelude.Text,
    -- | Creation timestamp for workflow.
    ListWorkflowsItem -> POSIX
createdAt :: Data.POSIX,
    -- | Last updated timestamp for workflow.
    ListWorkflowsItem -> POSIX
lastUpdatedAt :: Data.POSIX
  }
  deriving (ListWorkflowsItem -> ListWorkflowsItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkflowsItem -> ListWorkflowsItem -> Bool
$c/= :: ListWorkflowsItem -> ListWorkflowsItem -> Bool
== :: ListWorkflowsItem -> ListWorkflowsItem -> Bool
$c== :: ListWorkflowsItem -> ListWorkflowsItem -> Bool
Prelude.Eq, ReadPrec [ListWorkflowsItem]
ReadPrec ListWorkflowsItem
Int -> ReadS ListWorkflowsItem
ReadS [ListWorkflowsItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkflowsItem]
$creadListPrec :: ReadPrec [ListWorkflowsItem]
readPrec :: ReadPrec ListWorkflowsItem
$creadPrec :: ReadPrec ListWorkflowsItem
readList :: ReadS [ListWorkflowsItem]
$creadList :: ReadS [ListWorkflowsItem]
readsPrec :: Int -> ReadS ListWorkflowsItem
$creadsPrec :: Int -> ReadS ListWorkflowsItem
Prelude.Read, Int -> ListWorkflowsItem -> ShowS
[ListWorkflowsItem] -> ShowS
ListWorkflowsItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkflowsItem] -> ShowS
$cshowList :: [ListWorkflowsItem] -> ShowS
show :: ListWorkflowsItem -> String
$cshow :: ListWorkflowsItem -> String
showsPrec :: Int -> ListWorkflowsItem -> ShowS
$cshowsPrec :: Int -> ListWorkflowsItem -> ShowS
Prelude.Show, forall x. Rep ListWorkflowsItem x -> ListWorkflowsItem
forall x. ListWorkflowsItem -> Rep ListWorkflowsItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWorkflowsItem x -> ListWorkflowsItem
$cfrom :: forall x. ListWorkflowsItem -> Rep ListWorkflowsItem x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkflowsItem' 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:
--
-- 'workflowType', 'listWorkflowsItem_workflowType' - The type of workflow. The only supported value is APPFLOW_INTEGRATION.
--
-- 'workflowId', 'listWorkflowsItem_workflowId' - Unique identifier for the workflow.
--
-- 'status', 'listWorkflowsItem_status' - Status of workflow execution.
--
-- 'statusDescription', 'listWorkflowsItem_statusDescription' - Description for workflow execution status.
--
-- 'createdAt', 'listWorkflowsItem_createdAt' - Creation timestamp for workflow.
--
-- 'lastUpdatedAt', 'listWorkflowsItem_lastUpdatedAt' - Last updated timestamp for workflow.
newListWorkflowsItem ::
  -- | 'workflowType'
  WorkflowType ->
  -- | 'workflowId'
  Prelude.Text ->
  -- | 'status'
  Status ->
  -- | 'statusDescription'
  Prelude.Text ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'lastUpdatedAt'
  Prelude.UTCTime ->
  ListWorkflowsItem
newListWorkflowsItem :: WorkflowType
-> Text
-> Status
-> Text
-> UTCTime
-> UTCTime
-> ListWorkflowsItem
newListWorkflowsItem
  WorkflowType
pWorkflowType_
  Text
pWorkflowId_
  Status
pStatus_
  Text
pStatusDescription_
  UTCTime
pCreatedAt_
  UTCTime
pLastUpdatedAt_ =
    ListWorkflowsItem'
      { $sel:workflowType:ListWorkflowsItem' :: WorkflowType
workflowType = WorkflowType
pWorkflowType_,
        $sel:workflowId:ListWorkflowsItem' :: Text
workflowId = Text
pWorkflowId_,
        $sel:status:ListWorkflowsItem' :: Status
status = Status
pStatus_,
        $sel:statusDescription:ListWorkflowsItem' :: Text
statusDescription = Text
pStatusDescription_,
        $sel:createdAt:ListWorkflowsItem' :: POSIX
createdAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
        $sel:lastUpdatedAt:ListWorkflowsItem' :: POSIX
lastUpdatedAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUpdatedAt_
      }

-- | The type of workflow. The only supported value is APPFLOW_INTEGRATION.
listWorkflowsItem_workflowType :: Lens.Lens' ListWorkflowsItem WorkflowType
listWorkflowsItem_workflowType :: Lens' ListWorkflowsItem WorkflowType
listWorkflowsItem_workflowType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflowsItem' {WorkflowType
workflowType :: WorkflowType
$sel:workflowType:ListWorkflowsItem' :: ListWorkflowsItem -> WorkflowType
workflowType} -> WorkflowType
workflowType) (\s :: ListWorkflowsItem
s@ListWorkflowsItem' {} WorkflowType
a -> ListWorkflowsItem
s {$sel:workflowType:ListWorkflowsItem' :: WorkflowType
workflowType = WorkflowType
a} :: ListWorkflowsItem)

-- | Unique identifier for the workflow.
listWorkflowsItem_workflowId :: Lens.Lens' ListWorkflowsItem Prelude.Text
listWorkflowsItem_workflowId :: Lens' ListWorkflowsItem Text
listWorkflowsItem_workflowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflowsItem' {Text
workflowId :: Text
$sel:workflowId:ListWorkflowsItem' :: ListWorkflowsItem -> Text
workflowId} -> Text
workflowId) (\s :: ListWorkflowsItem
s@ListWorkflowsItem' {} Text
a -> ListWorkflowsItem
s {$sel:workflowId:ListWorkflowsItem' :: Text
workflowId = Text
a} :: ListWorkflowsItem)

-- | Status of workflow execution.
listWorkflowsItem_status :: Lens.Lens' ListWorkflowsItem Status
listWorkflowsItem_status :: Lens' ListWorkflowsItem Status
listWorkflowsItem_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflowsItem' {Status
status :: Status
$sel:status:ListWorkflowsItem' :: ListWorkflowsItem -> Status
status} -> Status
status) (\s :: ListWorkflowsItem
s@ListWorkflowsItem' {} Status
a -> ListWorkflowsItem
s {$sel:status:ListWorkflowsItem' :: Status
status = Status
a} :: ListWorkflowsItem)

-- | Description for workflow execution status.
listWorkflowsItem_statusDescription :: Lens.Lens' ListWorkflowsItem Prelude.Text
listWorkflowsItem_statusDescription :: Lens' ListWorkflowsItem Text
listWorkflowsItem_statusDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflowsItem' {Text
statusDescription :: Text
$sel:statusDescription:ListWorkflowsItem' :: ListWorkflowsItem -> Text
statusDescription} -> Text
statusDescription) (\s :: ListWorkflowsItem
s@ListWorkflowsItem' {} Text
a -> ListWorkflowsItem
s {$sel:statusDescription:ListWorkflowsItem' :: Text
statusDescription = Text
a} :: ListWorkflowsItem)

-- | Creation timestamp for workflow.
listWorkflowsItem_createdAt :: Lens.Lens' ListWorkflowsItem Prelude.UTCTime
listWorkflowsItem_createdAt :: Lens' ListWorkflowsItem UTCTime
listWorkflowsItem_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflowsItem' {POSIX
createdAt :: POSIX
$sel:createdAt:ListWorkflowsItem' :: ListWorkflowsItem -> POSIX
createdAt} -> POSIX
createdAt) (\s :: ListWorkflowsItem
s@ListWorkflowsItem' {} POSIX
a -> ListWorkflowsItem
s {$sel:createdAt:ListWorkflowsItem' :: POSIX
createdAt = POSIX
a} :: ListWorkflowsItem) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Last updated timestamp for workflow.
listWorkflowsItem_lastUpdatedAt :: Lens.Lens' ListWorkflowsItem Prelude.UTCTime
listWorkflowsItem_lastUpdatedAt :: Lens' ListWorkflowsItem UTCTime
listWorkflowsItem_lastUpdatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkflowsItem' {POSIX
lastUpdatedAt :: POSIX
$sel:lastUpdatedAt:ListWorkflowsItem' :: ListWorkflowsItem -> POSIX
lastUpdatedAt} -> POSIX
lastUpdatedAt) (\s :: ListWorkflowsItem
s@ListWorkflowsItem' {} POSIX
a -> ListWorkflowsItem
s {$sel:lastUpdatedAt:ListWorkflowsItem' :: POSIX
lastUpdatedAt = POSIX
a} :: ListWorkflowsItem) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

instance Data.FromJSON ListWorkflowsItem where
  parseJSON :: Value -> Parser ListWorkflowsItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ListWorkflowsItem"
      ( \Object
x ->
          WorkflowType
-> Text -> Status -> Text -> POSIX -> POSIX -> ListWorkflowsItem
ListWorkflowsItem'
            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
"WorkflowType")
            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
"WorkflowId")
            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
"Status")
            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
"StatusDescription")
            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
"CreatedAt")
            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
"LastUpdatedAt")
      )

instance Prelude.Hashable ListWorkflowsItem where
  hashWithSalt :: Int -> ListWorkflowsItem -> Int
hashWithSalt Int
_salt ListWorkflowsItem' {Text
POSIX
Status
WorkflowType
lastUpdatedAt :: POSIX
createdAt :: POSIX
statusDescription :: Text
status :: Status
workflowId :: Text
workflowType :: WorkflowType
$sel:lastUpdatedAt:ListWorkflowsItem' :: ListWorkflowsItem -> POSIX
$sel:createdAt:ListWorkflowsItem' :: ListWorkflowsItem -> POSIX
$sel:statusDescription:ListWorkflowsItem' :: ListWorkflowsItem -> Text
$sel:status:ListWorkflowsItem' :: ListWorkflowsItem -> Status
$sel:workflowId:ListWorkflowsItem' :: ListWorkflowsItem -> Text
$sel:workflowType:ListWorkflowsItem' :: ListWorkflowsItem -> WorkflowType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` WorkflowType
workflowType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workflowId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Status
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
statusDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
lastUpdatedAt

instance Prelude.NFData ListWorkflowsItem where
  rnf :: ListWorkflowsItem -> ()
rnf ListWorkflowsItem' {Text
POSIX
Status
WorkflowType
lastUpdatedAt :: POSIX
createdAt :: POSIX
statusDescription :: Text
status :: Status
workflowId :: Text
workflowType :: WorkflowType
$sel:lastUpdatedAt:ListWorkflowsItem' :: ListWorkflowsItem -> POSIX
$sel:createdAt:ListWorkflowsItem' :: ListWorkflowsItem -> POSIX
$sel:statusDescription:ListWorkflowsItem' :: ListWorkflowsItem -> Text
$sel:status:ListWorkflowsItem' :: ListWorkflowsItem -> Status
$sel:workflowId:ListWorkflowsItem' :: ListWorkflowsItem -> Text
$sel:workflowType:ListWorkflowsItem' :: ListWorkflowsItem -> WorkflowType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf WorkflowType
workflowType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
workflowId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Status
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
statusDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastUpdatedAt