{-# 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.SWF.Types.WorkflowExecutionInfo
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SWF.Types.WorkflowExecutionInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SWF.Types.CloseStatus
import Amazonka.SWF.Types.ExecutionStatus
import Amazonka.SWF.Types.WorkflowExecution
import Amazonka.SWF.Types.WorkflowType

-- | Contains information about a workflow execution.
--
-- /See:/ 'newWorkflowExecutionInfo' smart constructor.
data WorkflowExecutionInfo = WorkflowExecutionInfo'
  { -- | If this workflow execution is a child of another execution then contains
    -- the workflow execution that started this execution.
    WorkflowExecutionInfo -> Maybe WorkflowExecution
parent :: Prelude.Maybe WorkflowExecution,
    -- | The list of tags associated with the workflow execution. Tags can be
    -- used to identify and list workflow executions of interest through the
    -- visibility APIs. A workflow execution can have a maximum of 5 tags.
    WorkflowExecutionInfo -> Maybe [Text]
tagList :: Prelude.Maybe [Prelude.Text],
    -- | If the execution status is closed then this specifies how the execution
    -- was closed:
    --
    -- -   @COMPLETED@ – the execution was successfully completed.
    --
    -- -   @CANCELED@ – the execution was canceled.Cancellation allows the
    --     implementation to gracefully clean up before the execution is
    --     closed.
    --
    -- -   @TERMINATED@ – the execution was force terminated.
    --
    -- -   @FAILED@ – the execution failed to complete.
    --
    -- -   @TIMED_OUT@ – the execution did not complete in the alloted time and
    --     was automatically timed out.
    --
    -- -   @CONTINUED_AS_NEW@ – the execution is logically continued. This
    --     means the current execution was completed and a new execution was
    --     started to carry on the workflow.
    WorkflowExecutionInfo -> Maybe CloseStatus
closeStatus :: Prelude.Maybe CloseStatus,
    -- | The time when the workflow execution was closed. Set only if the
    -- execution status is CLOSED.
    WorkflowExecutionInfo -> Maybe POSIX
closeTimestamp :: Prelude.Maybe Core.POSIX,
    -- | Set to true if a cancellation is requested for this workflow execution.
    WorkflowExecutionInfo -> Maybe Bool
cancelRequested :: Prelude.Maybe Prelude.Bool,
    -- | The workflow execution this information is about.
    WorkflowExecutionInfo -> WorkflowExecution
execution :: WorkflowExecution,
    -- | The type of the workflow execution.
    WorkflowExecutionInfo -> WorkflowType
workflowType :: WorkflowType,
    -- | The time when the execution was started.
    WorkflowExecutionInfo -> POSIX
startTimestamp :: Core.POSIX,
    -- | The current status of the execution.
    WorkflowExecutionInfo -> ExecutionStatus
executionStatus :: ExecutionStatus
  }
  deriving (WorkflowExecutionInfo -> WorkflowExecutionInfo -> Bool
(WorkflowExecutionInfo -> WorkflowExecutionInfo -> Bool)
-> (WorkflowExecutionInfo -> WorkflowExecutionInfo -> Bool)
-> Eq WorkflowExecutionInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowExecutionInfo -> WorkflowExecutionInfo -> Bool
$c/= :: WorkflowExecutionInfo -> WorkflowExecutionInfo -> Bool
== :: WorkflowExecutionInfo -> WorkflowExecutionInfo -> Bool
$c== :: WorkflowExecutionInfo -> WorkflowExecutionInfo -> Bool
Prelude.Eq, ReadPrec [WorkflowExecutionInfo]
ReadPrec WorkflowExecutionInfo
Int -> ReadS WorkflowExecutionInfo
ReadS [WorkflowExecutionInfo]
(Int -> ReadS WorkflowExecutionInfo)
-> ReadS [WorkflowExecutionInfo]
-> ReadPrec WorkflowExecutionInfo
-> ReadPrec [WorkflowExecutionInfo]
-> Read WorkflowExecutionInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowExecutionInfo]
$creadListPrec :: ReadPrec [WorkflowExecutionInfo]
readPrec :: ReadPrec WorkflowExecutionInfo
$creadPrec :: ReadPrec WorkflowExecutionInfo
readList :: ReadS [WorkflowExecutionInfo]
$creadList :: ReadS [WorkflowExecutionInfo]
readsPrec :: Int -> ReadS WorkflowExecutionInfo
$creadsPrec :: Int -> ReadS WorkflowExecutionInfo
Prelude.Read, Int -> WorkflowExecutionInfo -> ShowS
[WorkflowExecutionInfo] -> ShowS
WorkflowExecutionInfo -> String
(Int -> WorkflowExecutionInfo -> ShowS)
-> (WorkflowExecutionInfo -> String)
-> ([WorkflowExecutionInfo] -> ShowS)
-> Show WorkflowExecutionInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowExecutionInfo] -> ShowS
$cshowList :: [WorkflowExecutionInfo] -> ShowS
show :: WorkflowExecutionInfo -> String
$cshow :: WorkflowExecutionInfo -> String
showsPrec :: Int -> WorkflowExecutionInfo -> ShowS
$cshowsPrec :: Int -> WorkflowExecutionInfo -> ShowS
Prelude.Show, (forall x. WorkflowExecutionInfo -> Rep WorkflowExecutionInfo x)
-> (forall x. Rep WorkflowExecutionInfo x -> WorkflowExecutionInfo)
-> Generic WorkflowExecutionInfo
forall x. Rep WorkflowExecutionInfo x -> WorkflowExecutionInfo
forall x. WorkflowExecutionInfo -> Rep WorkflowExecutionInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowExecutionInfo x -> WorkflowExecutionInfo
$cfrom :: forall x. WorkflowExecutionInfo -> Rep WorkflowExecutionInfo x
Prelude.Generic)

-- |
-- Create a value of 'WorkflowExecutionInfo' 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:
--
-- 'parent', 'workflowExecutionInfo_parent' - If this workflow execution is a child of another execution then contains
-- the workflow execution that started this execution.
--
-- 'tagList', 'workflowExecutionInfo_tagList' - The list of tags associated with the workflow execution. Tags can be
-- used to identify and list workflow executions of interest through the
-- visibility APIs. A workflow execution can have a maximum of 5 tags.
--
-- 'closeStatus', 'workflowExecutionInfo_closeStatus' - If the execution status is closed then this specifies how the execution
-- was closed:
--
-- -   @COMPLETED@ – the execution was successfully completed.
--
-- -   @CANCELED@ – the execution was canceled.Cancellation allows the
--     implementation to gracefully clean up before the execution is
--     closed.
--
-- -   @TERMINATED@ – the execution was force terminated.
--
-- -   @FAILED@ – the execution failed to complete.
--
-- -   @TIMED_OUT@ – the execution did not complete in the alloted time and
--     was automatically timed out.
--
-- -   @CONTINUED_AS_NEW@ – the execution is logically continued. This
--     means the current execution was completed and a new execution was
--     started to carry on the workflow.
--
-- 'closeTimestamp', 'workflowExecutionInfo_closeTimestamp' - The time when the workflow execution was closed. Set only if the
-- execution status is CLOSED.
--
-- 'cancelRequested', 'workflowExecutionInfo_cancelRequested' - Set to true if a cancellation is requested for this workflow execution.
--
-- 'execution', 'workflowExecutionInfo_execution' - The workflow execution this information is about.
--
-- 'workflowType', 'workflowExecutionInfo_workflowType' - The type of the workflow execution.
--
-- 'startTimestamp', 'workflowExecutionInfo_startTimestamp' - The time when the execution was started.
--
-- 'executionStatus', 'workflowExecutionInfo_executionStatus' - The current status of the execution.
newWorkflowExecutionInfo ::
  -- | 'execution'
  WorkflowExecution ->
  -- | 'workflowType'
  WorkflowType ->
  -- | 'startTimestamp'
  Prelude.UTCTime ->
  -- | 'executionStatus'
  ExecutionStatus ->
  WorkflowExecutionInfo
newWorkflowExecutionInfo :: WorkflowExecution
-> WorkflowType
-> UTCTime
-> ExecutionStatus
-> WorkflowExecutionInfo
newWorkflowExecutionInfo
  WorkflowExecution
pExecution_
  WorkflowType
pWorkflowType_
  UTCTime
pStartTimestamp_
  ExecutionStatus
pExecutionStatus_ =
    WorkflowExecutionInfo' :: Maybe WorkflowExecution
-> Maybe [Text]
-> Maybe CloseStatus
-> Maybe POSIX
-> Maybe Bool
-> WorkflowExecution
-> WorkflowType
-> POSIX
-> ExecutionStatus
-> WorkflowExecutionInfo
WorkflowExecutionInfo'
      { $sel:parent:WorkflowExecutionInfo' :: Maybe WorkflowExecution
parent = Maybe WorkflowExecution
forall a. Maybe a
Prelude.Nothing,
        $sel:tagList:WorkflowExecutionInfo' :: Maybe [Text]
tagList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:closeStatus:WorkflowExecutionInfo' :: Maybe CloseStatus
closeStatus = Maybe CloseStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:closeTimestamp:WorkflowExecutionInfo' :: Maybe POSIX
closeTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:cancelRequested:WorkflowExecutionInfo' :: Maybe Bool
cancelRequested = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:execution:WorkflowExecutionInfo' :: WorkflowExecution
execution = WorkflowExecution
pExecution_,
        $sel:workflowType:WorkflowExecutionInfo' :: WorkflowType
workflowType = WorkflowType
pWorkflowType_,
        $sel:startTimestamp:WorkflowExecutionInfo' :: POSIX
startTimestamp = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTimestamp_,
        $sel:executionStatus:WorkflowExecutionInfo' :: ExecutionStatus
executionStatus = ExecutionStatus
pExecutionStatus_
      }

-- | If this workflow execution is a child of another execution then contains
-- the workflow execution that started this execution.
workflowExecutionInfo_parent :: Lens.Lens' WorkflowExecutionInfo (Prelude.Maybe WorkflowExecution)
workflowExecutionInfo_parent :: (Maybe WorkflowExecution -> f (Maybe WorkflowExecution))
-> WorkflowExecutionInfo -> f WorkflowExecutionInfo
workflowExecutionInfo_parent = (WorkflowExecutionInfo -> Maybe WorkflowExecution)
-> (WorkflowExecutionInfo
    -> Maybe WorkflowExecution -> WorkflowExecutionInfo)
-> Lens
     WorkflowExecutionInfo
     WorkflowExecutionInfo
     (Maybe WorkflowExecution)
     (Maybe WorkflowExecution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfo' {Maybe WorkflowExecution
parent :: Maybe WorkflowExecution
$sel:parent:WorkflowExecutionInfo' :: WorkflowExecutionInfo -> Maybe WorkflowExecution
parent} -> Maybe WorkflowExecution
parent) (\s :: WorkflowExecutionInfo
s@WorkflowExecutionInfo' {} Maybe WorkflowExecution
a -> WorkflowExecutionInfo
s {$sel:parent:WorkflowExecutionInfo' :: Maybe WorkflowExecution
parent = Maybe WorkflowExecution
a} :: WorkflowExecutionInfo)

-- | The list of tags associated with the workflow execution. Tags can be
-- used to identify and list workflow executions of interest through the
-- visibility APIs. A workflow execution can have a maximum of 5 tags.
workflowExecutionInfo_tagList :: Lens.Lens' WorkflowExecutionInfo (Prelude.Maybe [Prelude.Text])
workflowExecutionInfo_tagList :: (Maybe [Text] -> f (Maybe [Text]))
-> WorkflowExecutionInfo -> f WorkflowExecutionInfo
workflowExecutionInfo_tagList = (WorkflowExecutionInfo -> Maybe [Text])
-> (WorkflowExecutionInfo -> Maybe [Text] -> WorkflowExecutionInfo)
-> Lens
     WorkflowExecutionInfo
     WorkflowExecutionInfo
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfo' {Maybe [Text]
tagList :: Maybe [Text]
$sel:tagList:WorkflowExecutionInfo' :: WorkflowExecutionInfo -> Maybe [Text]
tagList} -> Maybe [Text]
tagList) (\s :: WorkflowExecutionInfo
s@WorkflowExecutionInfo' {} Maybe [Text]
a -> WorkflowExecutionInfo
s {$sel:tagList:WorkflowExecutionInfo' :: Maybe [Text]
tagList = Maybe [Text]
a} :: WorkflowExecutionInfo) ((Maybe [Text] -> f (Maybe [Text]))
 -> WorkflowExecutionInfo -> f WorkflowExecutionInfo)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> WorkflowExecutionInfo
-> f WorkflowExecutionInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the execution status is closed then this specifies how the execution
-- was closed:
--
-- -   @COMPLETED@ – the execution was successfully completed.
--
-- -   @CANCELED@ – the execution was canceled.Cancellation allows the
--     implementation to gracefully clean up before the execution is
--     closed.
--
-- -   @TERMINATED@ – the execution was force terminated.
--
-- -   @FAILED@ – the execution failed to complete.
--
-- -   @TIMED_OUT@ – the execution did not complete in the alloted time and
--     was automatically timed out.
--
-- -   @CONTINUED_AS_NEW@ – the execution is logically continued. This
--     means the current execution was completed and a new execution was
--     started to carry on the workflow.
workflowExecutionInfo_closeStatus :: Lens.Lens' WorkflowExecutionInfo (Prelude.Maybe CloseStatus)
workflowExecutionInfo_closeStatus :: (Maybe CloseStatus -> f (Maybe CloseStatus))
-> WorkflowExecutionInfo -> f WorkflowExecutionInfo
workflowExecutionInfo_closeStatus = (WorkflowExecutionInfo -> Maybe CloseStatus)
-> (WorkflowExecutionInfo
    -> Maybe CloseStatus -> WorkflowExecutionInfo)
-> Lens
     WorkflowExecutionInfo
     WorkflowExecutionInfo
     (Maybe CloseStatus)
     (Maybe CloseStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfo' {Maybe CloseStatus
closeStatus :: Maybe CloseStatus
$sel:closeStatus:WorkflowExecutionInfo' :: WorkflowExecutionInfo -> Maybe CloseStatus
closeStatus} -> Maybe CloseStatus
closeStatus) (\s :: WorkflowExecutionInfo
s@WorkflowExecutionInfo' {} Maybe CloseStatus
a -> WorkflowExecutionInfo
s {$sel:closeStatus:WorkflowExecutionInfo' :: Maybe CloseStatus
closeStatus = Maybe CloseStatus
a} :: WorkflowExecutionInfo)

-- | The time when the workflow execution was closed. Set only if the
-- execution status is CLOSED.
workflowExecutionInfo_closeTimestamp :: Lens.Lens' WorkflowExecutionInfo (Prelude.Maybe Prelude.UTCTime)
workflowExecutionInfo_closeTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkflowExecutionInfo -> f WorkflowExecutionInfo
workflowExecutionInfo_closeTimestamp = (WorkflowExecutionInfo -> Maybe POSIX)
-> (WorkflowExecutionInfo -> Maybe POSIX -> WorkflowExecutionInfo)
-> Lens
     WorkflowExecutionInfo
     WorkflowExecutionInfo
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfo' {Maybe POSIX
closeTimestamp :: Maybe POSIX
$sel:closeTimestamp:WorkflowExecutionInfo' :: WorkflowExecutionInfo -> Maybe POSIX
closeTimestamp} -> Maybe POSIX
closeTimestamp) (\s :: WorkflowExecutionInfo
s@WorkflowExecutionInfo' {} Maybe POSIX
a -> WorkflowExecutionInfo
s {$sel:closeTimestamp:WorkflowExecutionInfo' :: Maybe POSIX
closeTimestamp = Maybe POSIX
a} :: WorkflowExecutionInfo) ((Maybe POSIX -> f (Maybe POSIX))
 -> WorkflowExecutionInfo -> f WorkflowExecutionInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkflowExecutionInfo
-> f WorkflowExecutionInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Set to true if a cancellation is requested for this workflow execution.
workflowExecutionInfo_cancelRequested :: Lens.Lens' WorkflowExecutionInfo (Prelude.Maybe Prelude.Bool)
workflowExecutionInfo_cancelRequested :: (Maybe Bool -> f (Maybe Bool))
-> WorkflowExecutionInfo -> f WorkflowExecutionInfo
workflowExecutionInfo_cancelRequested = (WorkflowExecutionInfo -> Maybe Bool)
-> (WorkflowExecutionInfo -> Maybe Bool -> WorkflowExecutionInfo)
-> Lens
     WorkflowExecutionInfo
     WorkflowExecutionInfo
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfo' {Maybe Bool
cancelRequested :: Maybe Bool
$sel:cancelRequested:WorkflowExecutionInfo' :: WorkflowExecutionInfo -> Maybe Bool
cancelRequested} -> Maybe Bool
cancelRequested) (\s :: WorkflowExecutionInfo
s@WorkflowExecutionInfo' {} Maybe Bool
a -> WorkflowExecutionInfo
s {$sel:cancelRequested:WorkflowExecutionInfo' :: Maybe Bool
cancelRequested = Maybe Bool
a} :: WorkflowExecutionInfo)

-- | The workflow execution this information is about.
workflowExecutionInfo_execution :: Lens.Lens' WorkflowExecutionInfo WorkflowExecution
workflowExecutionInfo_execution :: (WorkflowExecution -> f WorkflowExecution)
-> WorkflowExecutionInfo -> f WorkflowExecutionInfo
workflowExecutionInfo_execution = (WorkflowExecutionInfo -> WorkflowExecution)
-> (WorkflowExecutionInfo
    -> WorkflowExecution -> WorkflowExecutionInfo)
-> Lens
     WorkflowExecutionInfo
     WorkflowExecutionInfo
     WorkflowExecution
     WorkflowExecution
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfo' {WorkflowExecution
execution :: WorkflowExecution
$sel:execution:WorkflowExecutionInfo' :: WorkflowExecutionInfo -> WorkflowExecution
execution} -> WorkflowExecution
execution) (\s :: WorkflowExecutionInfo
s@WorkflowExecutionInfo' {} WorkflowExecution
a -> WorkflowExecutionInfo
s {$sel:execution:WorkflowExecutionInfo' :: WorkflowExecution
execution = WorkflowExecution
a} :: WorkflowExecutionInfo)

-- | The type of the workflow execution.
workflowExecutionInfo_workflowType :: Lens.Lens' WorkflowExecutionInfo WorkflowType
workflowExecutionInfo_workflowType :: (WorkflowType -> f WorkflowType)
-> WorkflowExecutionInfo -> f WorkflowExecutionInfo
workflowExecutionInfo_workflowType = (WorkflowExecutionInfo -> WorkflowType)
-> (WorkflowExecutionInfo -> WorkflowType -> WorkflowExecutionInfo)
-> Lens
     WorkflowExecutionInfo
     WorkflowExecutionInfo
     WorkflowType
     WorkflowType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfo' {WorkflowType
workflowType :: WorkflowType
$sel:workflowType:WorkflowExecutionInfo' :: WorkflowExecutionInfo -> WorkflowType
workflowType} -> WorkflowType
workflowType) (\s :: WorkflowExecutionInfo
s@WorkflowExecutionInfo' {} WorkflowType
a -> WorkflowExecutionInfo
s {$sel:workflowType:WorkflowExecutionInfo' :: WorkflowType
workflowType = WorkflowType
a} :: WorkflowExecutionInfo)

-- | The time when the execution was started.
workflowExecutionInfo_startTimestamp :: Lens.Lens' WorkflowExecutionInfo Prelude.UTCTime
workflowExecutionInfo_startTimestamp :: (UTCTime -> f UTCTime)
-> WorkflowExecutionInfo -> f WorkflowExecutionInfo
workflowExecutionInfo_startTimestamp = (WorkflowExecutionInfo -> POSIX)
-> (WorkflowExecutionInfo -> POSIX -> WorkflowExecutionInfo)
-> Lens WorkflowExecutionInfo WorkflowExecutionInfo POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfo' {POSIX
startTimestamp :: POSIX
$sel:startTimestamp:WorkflowExecutionInfo' :: WorkflowExecutionInfo -> POSIX
startTimestamp} -> POSIX
startTimestamp) (\s :: WorkflowExecutionInfo
s@WorkflowExecutionInfo' {} POSIX
a -> WorkflowExecutionInfo
s {$sel:startTimestamp:WorkflowExecutionInfo' :: POSIX
startTimestamp = POSIX
a} :: WorkflowExecutionInfo) ((POSIX -> f POSIX)
 -> WorkflowExecutionInfo -> f WorkflowExecutionInfo)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> WorkflowExecutionInfo
-> f WorkflowExecutionInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The current status of the execution.
workflowExecutionInfo_executionStatus :: Lens.Lens' WorkflowExecutionInfo ExecutionStatus
workflowExecutionInfo_executionStatus :: (ExecutionStatus -> f ExecutionStatus)
-> WorkflowExecutionInfo -> f WorkflowExecutionInfo
workflowExecutionInfo_executionStatus = (WorkflowExecutionInfo -> ExecutionStatus)
-> (WorkflowExecutionInfo
    -> ExecutionStatus -> WorkflowExecutionInfo)
-> Lens
     WorkflowExecutionInfo
     WorkflowExecutionInfo
     ExecutionStatus
     ExecutionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowExecutionInfo' {ExecutionStatus
executionStatus :: ExecutionStatus
$sel:executionStatus:WorkflowExecutionInfo' :: WorkflowExecutionInfo -> ExecutionStatus
executionStatus} -> ExecutionStatus
executionStatus) (\s :: WorkflowExecutionInfo
s@WorkflowExecutionInfo' {} ExecutionStatus
a -> WorkflowExecutionInfo
s {$sel:executionStatus:WorkflowExecutionInfo' :: ExecutionStatus
executionStatus = ExecutionStatus
a} :: WorkflowExecutionInfo)

instance Core.FromJSON WorkflowExecutionInfo where
  parseJSON :: Value -> Parser WorkflowExecutionInfo
parseJSON =
    String
-> (Object -> Parser WorkflowExecutionInfo)
-> Value
-> Parser WorkflowExecutionInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WorkflowExecutionInfo"
      ( \Object
x ->
          Maybe WorkflowExecution
-> Maybe [Text]
-> Maybe CloseStatus
-> Maybe POSIX
-> Maybe Bool
-> WorkflowExecution
-> WorkflowType
-> POSIX
-> ExecutionStatus
-> WorkflowExecutionInfo
WorkflowExecutionInfo'
            (Maybe WorkflowExecution
 -> Maybe [Text]
 -> Maybe CloseStatus
 -> Maybe POSIX
 -> Maybe Bool
 -> WorkflowExecution
 -> WorkflowType
 -> POSIX
 -> ExecutionStatus
 -> WorkflowExecutionInfo)
-> Parser (Maybe WorkflowExecution)
-> Parser
     (Maybe [Text]
      -> Maybe CloseStatus
      -> Maybe POSIX
      -> Maybe Bool
      -> WorkflowExecution
      -> WorkflowType
      -> POSIX
      -> ExecutionStatus
      -> WorkflowExecutionInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe WorkflowExecution)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"parent")
            Parser
  (Maybe [Text]
   -> Maybe CloseStatus
   -> Maybe POSIX
   -> Maybe Bool
   -> WorkflowExecution
   -> WorkflowType
   -> POSIX
   -> ExecutionStatus
   -> WorkflowExecutionInfo)
-> Parser (Maybe [Text])
-> Parser
     (Maybe CloseStatus
      -> Maybe POSIX
      -> Maybe Bool
      -> WorkflowExecution
      -> WorkflowType
      -> POSIX
      -> ExecutionStatus
      -> WorkflowExecutionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tagList" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe CloseStatus
   -> Maybe POSIX
   -> Maybe Bool
   -> WorkflowExecution
   -> WorkflowType
   -> POSIX
   -> ExecutionStatus
   -> WorkflowExecutionInfo)
-> Parser (Maybe CloseStatus)
-> Parser
     (Maybe POSIX
      -> Maybe Bool
      -> WorkflowExecution
      -> WorkflowType
      -> POSIX
      -> ExecutionStatus
      -> WorkflowExecutionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CloseStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"closeStatus")
            Parser
  (Maybe POSIX
   -> Maybe Bool
   -> WorkflowExecution
   -> WorkflowType
   -> POSIX
   -> ExecutionStatus
   -> WorkflowExecutionInfo)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Bool
      -> WorkflowExecution
      -> WorkflowType
      -> POSIX
      -> ExecutionStatus
      -> WorkflowExecutionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"closeTimestamp")
            Parser
  (Maybe Bool
   -> WorkflowExecution
   -> WorkflowType
   -> POSIX
   -> ExecutionStatus
   -> WorkflowExecutionInfo)
-> Parser (Maybe Bool)
-> Parser
     (WorkflowExecution
      -> WorkflowType
      -> POSIX
      -> ExecutionStatus
      -> WorkflowExecutionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cancelRequested")
            Parser
  (WorkflowExecution
   -> WorkflowType
   -> POSIX
   -> ExecutionStatus
   -> WorkflowExecutionInfo)
-> Parser WorkflowExecution
-> Parser
     (WorkflowType -> POSIX -> ExecutionStatus -> WorkflowExecutionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser WorkflowExecution
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"execution")
            Parser
  (WorkflowType -> POSIX -> ExecutionStatus -> WorkflowExecutionInfo)
-> Parser WorkflowType
-> Parser (POSIX -> ExecutionStatus -> WorkflowExecutionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser WorkflowType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"workflowType")
            Parser (POSIX -> ExecutionStatus -> WorkflowExecutionInfo)
-> Parser POSIX
-> Parser (ExecutionStatus -> WorkflowExecutionInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"startTimestamp")
            Parser (ExecutionStatus -> WorkflowExecutionInfo)
-> Parser ExecutionStatus -> Parser WorkflowExecutionInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ExecutionStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"executionStatus")
      )

instance Prelude.Hashable WorkflowExecutionInfo

instance Prelude.NFData WorkflowExecutionInfo