{-# 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.Glue.Types.WorkflowRun
-- 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.Glue.Types.WorkflowRun where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.StartingEventBatchCondition
import Amazonka.Glue.Types.WorkflowGraph
import Amazonka.Glue.Types.WorkflowRunStatistics
import Amazonka.Glue.Types.WorkflowRunStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A workflow run is an execution of a workflow providing all the runtime
-- information.
--
-- /See:/ 'newWorkflowRun' smart constructor.
data WorkflowRun = WorkflowRun'
  { -- | The date and time when the workflow run completed.
    WorkflowRun -> Maybe POSIX
completedOn :: Prelude.Maybe Core.POSIX,
    -- | The status of the workflow run.
    WorkflowRun -> Maybe WorkflowRunStatus
status :: Prelude.Maybe WorkflowRunStatus,
    -- | The graph representing all the Glue components that belong to the
    -- workflow as nodes and directed connections between them as edges.
    WorkflowRun -> Maybe WorkflowGraph
graph :: Prelude.Maybe WorkflowGraph,
    -- | The date and time when the workflow run was started.
    WorkflowRun -> Maybe POSIX
startedOn :: Prelude.Maybe Core.POSIX,
    -- | The ID of this workflow run.
    WorkflowRun -> Maybe Text
workflowRunId :: Prelude.Maybe Prelude.Text,
    -- | Name of the workflow that was run.
    WorkflowRun -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the previous workflow run.
    WorkflowRun -> Maybe Text
previousRunId :: Prelude.Maybe Prelude.Text,
    -- | The statistics of the run.
    WorkflowRun -> Maybe WorkflowRunStatistics
statistics :: Prelude.Maybe WorkflowRunStatistics,
    -- | The batch condition that started the workflow run.
    WorkflowRun -> Maybe StartingEventBatchCondition
startingEventBatchCondition :: Prelude.Maybe StartingEventBatchCondition,
    -- | This error message describes any error that may have occurred in
    -- starting the workflow run. Currently the only error message is
    -- \"Concurrent runs exceeded for workflow: @foo@.\"
    WorkflowRun -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | The workflow run properties which were set during the run.
    WorkflowRun -> Maybe (HashMap Text Text)
workflowRunProperties :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (WorkflowRun -> WorkflowRun -> Bool
(WorkflowRun -> WorkflowRun -> Bool)
-> (WorkflowRun -> WorkflowRun -> Bool) -> Eq WorkflowRun
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkflowRun -> WorkflowRun -> Bool
$c/= :: WorkflowRun -> WorkflowRun -> Bool
== :: WorkflowRun -> WorkflowRun -> Bool
$c== :: WorkflowRun -> WorkflowRun -> Bool
Prelude.Eq, ReadPrec [WorkflowRun]
ReadPrec WorkflowRun
Int -> ReadS WorkflowRun
ReadS [WorkflowRun]
(Int -> ReadS WorkflowRun)
-> ReadS [WorkflowRun]
-> ReadPrec WorkflowRun
-> ReadPrec [WorkflowRun]
-> Read WorkflowRun
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkflowRun]
$creadListPrec :: ReadPrec [WorkflowRun]
readPrec :: ReadPrec WorkflowRun
$creadPrec :: ReadPrec WorkflowRun
readList :: ReadS [WorkflowRun]
$creadList :: ReadS [WorkflowRun]
readsPrec :: Int -> ReadS WorkflowRun
$creadsPrec :: Int -> ReadS WorkflowRun
Prelude.Read, Int -> WorkflowRun -> ShowS
[WorkflowRun] -> ShowS
WorkflowRun -> String
(Int -> WorkflowRun -> ShowS)
-> (WorkflowRun -> String)
-> ([WorkflowRun] -> ShowS)
-> Show WorkflowRun
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkflowRun] -> ShowS
$cshowList :: [WorkflowRun] -> ShowS
show :: WorkflowRun -> String
$cshow :: WorkflowRun -> String
showsPrec :: Int -> WorkflowRun -> ShowS
$cshowsPrec :: Int -> WorkflowRun -> ShowS
Prelude.Show, (forall x. WorkflowRun -> Rep WorkflowRun x)
-> (forall x. Rep WorkflowRun x -> WorkflowRun)
-> Generic WorkflowRun
forall x. Rep WorkflowRun x -> WorkflowRun
forall x. WorkflowRun -> Rep WorkflowRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkflowRun x -> WorkflowRun
$cfrom :: forall x. WorkflowRun -> Rep WorkflowRun x
Prelude.Generic)

-- |
-- Create a value of 'WorkflowRun' 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:
--
-- 'completedOn', 'workflowRun_completedOn' - The date and time when the workflow run completed.
--
-- 'status', 'workflowRun_status' - The status of the workflow run.
--
-- 'graph', 'workflowRun_graph' - The graph representing all the Glue components that belong to the
-- workflow as nodes and directed connections between them as edges.
--
-- 'startedOn', 'workflowRun_startedOn' - The date and time when the workflow run was started.
--
-- 'workflowRunId', 'workflowRun_workflowRunId' - The ID of this workflow run.
--
-- 'name', 'workflowRun_name' - Name of the workflow that was run.
--
-- 'previousRunId', 'workflowRun_previousRunId' - The ID of the previous workflow run.
--
-- 'statistics', 'workflowRun_statistics' - The statistics of the run.
--
-- 'startingEventBatchCondition', 'workflowRun_startingEventBatchCondition' - The batch condition that started the workflow run.
--
-- 'errorMessage', 'workflowRun_errorMessage' - This error message describes any error that may have occurred in
-- starting the workflow run. Currently the only error message is
-- \"Concurrent runs exceeded for workflow: @foo@.\"
--
-- 'workflowRunProperties', 'workflowRun_workflowRunProperties' - The workflow run properties which were set during the run.
newWorkflowRun ::
  WorkflowRun
newWorkflowRun :: WorkflowRun
newWorkflowRun =
  WorkflowRun' :: Maybe POSIX
-> Maybe WorkflowRunStatus
-> Maybe WorkflowGraph
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe WorkflowRunStatistics
-> Maybe StartingEventBatchCondition
-> Maybe Text
-> Maybe (HashMap Text Text)
-> WorkflowRun
WorkflowRun'
    { $sel:completedOn:WorkflowRun' :: Maybe POSIX
completedOn = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:WorkflowRun' :: Maybe WorkflowRunStatus
status = Maybe WorkflowRunStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:graph:WorkflowRun' :: Maybe WorkflowGraph
graph = Maybe WorkflowGraph
forall a. Maybe a
Prelude.Nothing,
      $sel:startedOn:WorkflowRun' :: Maybe POSIX
startedOn = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:workflowRunId:WorkflowRun' :: Maybe Text
workflowRunId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:WorkflowRun' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:previousRunId:WorkflowRun' :: Maybe Text
previousRunId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statistics:WorkflowRun' :: Maybe WorkflowRunStatistics
statistics = Maybe WorkflowRunStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:startingEventBatchCondition:WorkflowRun' :: Maybe StartingEventBatchCondition
startingEventBatchCondition = Maybe StartingEventBatchCondition
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:WorkflowRun' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workflowRunProperties:WorkflowRun' :: Maybe (HashMap Text Text)
workflowRunProperties = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time when the workflow run completed.
workflowRun_completedOn :: Lens.Lens' WorkflowRun (Prelude.Maybe Prelude.UTCTime)
workflowRun_completedOn :: (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkflowRun -> f WorkflowRun
workflowRun_completedOn = (WorkflowRun -> Maybe POSIX)
-> (WorkflowRun -> Maybe POSIX -> WorkflowRun)
-> Lens WorkflowRun WorkflowRun (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe POSIX
completedOn :: Maybe POSIX
$sel:completedOn:WorkflowRun' :: WorkflowRun -> Maybe POSIX
completedOn} -> Maybe POSIX
completedOn) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe POSIX
a -> WorkflowRun
s {$sel:completedOn:WorkflowRun' :: Maybe POSIX
completedOn = Maybe POSIX
a} :: WorkflowRun) ((Maybe POSIX -> f (Maybe POSIX)) -> WorkflowRun -> f WorkflowRun)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkflowRun
-> f WorkflowRun
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

-- | The status of the workflow run.
workflowRun_status :: Lens.Lens' WorkflowRun (Prelude.Maybe WorkflowRunStatus)
workflowRun_status :: (Maybe WorkflowRunStatus -> f (Maybe WorkflowRunStatus))
-> WorkflowRun -> f WorkflowRun
workflowRun_status = (WorkflowRun -> Maybe WorkflowRunStatus)
-> (WorkflowRun -> Maybe WorkflowRunStatus -> WorkflowRun)
-> Lens
     WorkflowRun
     WorkflowRun
     (Maybe WorkflowRunStatus)
     (Maybe WorkflowRunStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe WorkflowRunStatus
status :: Maybe WorkflowRunStatus
$sel:status:WorkflowRun' :: WorkflowRun -> Maybe WorkflowRunStatus
status} -> Maybe WorkflowRunStatus
status) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe WorkflowRunStatus
a -> WorkflowRun
s {$sel:status:WorkflowRun' :: Maybe WorkflowRunStatus
status = Maybe WorkflowRunStatus
a} :: WorkflowRun)

-- | The graph representing all the Glue components that belong to the
-- workflow as nodes and directed connections between them as edges.
workflowRun_graph :: Lens.Lens' WorkflowRun (Prelude.Maybe WorkflowGraph)
workflowRun_graph :: (Maybe WorkflowGraph -> f (Maybe WorkflowGraph))
-> WorkflowRun -> f WorkflowRun
workflowRun_graph = (WorkflowRun -> Maybe WorkflowGraph)
-> (WorkflowRun -> Maybe WorkflowGraph -> WorkflowRun)
-> Lens
     WorkflowRun WorkflowRun (Maybe WorkflowGraph) (Maybe WorkflowGraph)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe WorkflowGraph
graph :: Maybe WorkflowGraph
$sel:graph:WorkflowRun' :: WorkflowRun -> Maybe WorkflowGraph
graph} -> Maybe WorkflowGraph
graph) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe WorkflowGraph
a -> WorkflowRun
s {$sel:graph:WorkflowRun' :: Maybe WorkflowGraph
graph = Maybe WorkflowGraph
a} :: WorkflowRun)

-- | The date and time when the workflow run was started.
workflowRun_startedOn :: Lens.Lens' WorkflowRun (Prelude.Maybe Prelude.UTCTime)
workflowRun_startedOn :: (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkflowRun -> f WorkflowRun
workflowRun_startedOn = (WorkflowRun -> Maybe POSIX)
-> (WorkflowRun -> Maybe POSIX -> WorkflowRun)
-> Lens WorkflowRun WorkflowRun (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe POSIX
startedOn :: Maybe POSIX
$sel:startedOn:WorkflowRun' :: WorkflowRun -> Maybe POSIX
startedOn} -> Maybe POSIX
startedOn) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe POSIX
a -> WorkflowRun
s {$sel:startedOn:WorkflowRun' :: Maybe POSIX
startedOn = Maybe POSIX
a} :: WorkflowRun) ((Maybe POSIX -> f (Maybe POSIX)) -> WorkflowRun -> f WorkflowRun)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkflowRun
-> f WorkflowRun
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

-- | The ID of this workflow run.
workflowRun_workflowRunId :: Lens.Lens' WorkflowRun (Prelude.Maybe Prelude.Text)
workflowRun_workflowRunId :: (Maybe Text -> f (Maybe Text)) -> WorkflowRun -> f WorkflowRun
workflowRun_workflowRunId = (WorkflowRun -> Maybe Text)
-> (WorkflowRun -> Maybe Text -> WorkflowRun)
-> Lens WorkflowRun WorkflowRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe Text
workflowRunId :: Maybe Text
$sel:workflowRunId:WorkflowRun' :: WorkflowRun -> Maybe Text
workflowRunId} -> Maybe Text
workflowRunId) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe Text
a -> WorkflowRun
s {$sel:workflowRunId:WorkflowRun' :: Maybe Text
workflowRunId = Maybe Text
a} :: WorkflowRun)

-- | Name of the workflow that was run.
workflowRun_name :: Lens.Lens' WorkflowRun (Prelude.Maybe Prelude.Text)
workflowRun_name :: (Maybe Text -> f (Maybe Text)) -> WorkflowRun -> f WorkflowRun
workflowRun_name = (WorkflowRun -> Maybe Text)
-> (WorkflowRun -> Maybe Text -> WorkflowRun)
-> Lens WorkflowRun WorkflowRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe Text
name :: Maybe Text
$sel:name:WorkflowRun' :: WorkflowRun -> Maybe Text
name} -> Maybe Text
name) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe Text
a -> WorkflowRun
s {$sel:name:WorkflowRun' :: Maybe Text
name = Maybe Text
a} :: WorkflowRun)

-- | The ID of the previous workflow run.
workflowRun_previousRunId :: Lens.Lens' WorkflowRun (Prelude.Maybe Prelude.Text)
workflowRun_previousRunId :: (Maybe Text -> f (Maybe Text)) -> WorkflowRun -> f WorkflowRun
workflowRun_previousRunId = (WorkflowRun -> Maybe Text)
-> (WorkflowRun -> Maybe Text -> WorkflowRun)
-> Lens WorkflowRun WorkflowRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe Text
previousRunId :: Maybe Text
$sel:previousRunId:WorkflowRun' :: WorkflowRun -> Maybe Text
previousRunId} -> Maybe Text
previousRunId) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe Text
a -> WorkflowRun
s {$sel:previousRunId:WorkflowRun' :: Maybe Text
previousRunId = Maybe Text
a} :: WorkflowRun)

-- | The statistics of the run.
workflowRun_statistics :: Lens.Lens' WorkflowRun (Prelude.Maybe WorkflowRunStatistics)
workflowRun_statistics :: (Maybe WorkflowRunStatistics -> f (Maybe WorkflowRunStatistics))
-> WorkflowRun -> f WorkflowRun
workflowRun_statistics = (WorkflowRun -> Maybe WorkflowRunStatistics)
-> (WorkflowRun -> Maybe WorkflowRunStatistics -> WorkflowRun)
-> Lens
     WorkflowRun
     WorkflowRun
     (Maybe WorkflowRunStatistics)
     (Maybe WorkflowRunStatistics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe WorkflowRunStatistics
statistics :: Maybe WorkflowRunStatistics
$sel:statistics:WorkflowRun' :: WorkflowRun -> Maybe WorkflowRunStatistics
statistics} -> Maybe WorkflowRunStatistics
statistics) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe WorkflowRunStatistics
a -> WorkflowRun
s {$sel:statistics:WorkflowRun' :: Maybe WorkflowRunStatistics
statistics = Maybe WorkflowRunStatistics
a} :: WorkflowRun)

-- | The batch condition that started the workflow run.
workflowRun_startingEventBatchCondition :: Lens.Lens' WorkflowRun (Prelude.Maybe StartingEventBatchCondition)
workflowRun_startingEventBatchCondition :: (Maybe StartingEventBatchCondition
 -> f (Maybe StartingEventBatchCondition))
-> WorkflowRun -> f WorkflowRun
workflowRun_startingEventBatchCondition = (WorkflowRun -> Maybe StartingEventBatchCondition)
-> (WorkflowRun
    -> Maybe StartingEventBatchCondition -> WorkflowRun)
-> Lens
     WorkflowRun
     WorkflowRun
     (Maybe StartingEventBatchCondition)
     (Maybe StartingEventBatchCondition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe StartingEventBatchCondition
startingEventBatchCondition :: Maybe StartingEventBatchCondition
$sel:startingEventBatchCondition:WorkflowRun' :: WorkflowRun -> Maybe StartingEventBatchCondition
startingEventBatchCondition} -> Maybe StartingEventBatchCondition
startingEventBatchCondition) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe StartingEventBatchCondition
a -> WorkflowRun
s {$sel:startingEventBatchCondition:WorkflowRun' :: Maybe StartingEventBatchCondition
startingEventBatchCondition = Maybe StartingEventBatchCondition
a} :: WorkflowRun)

-- | This error message describes any error that may have occurred in
-- starting the workflow run. Currently the only error message is
-- \"Concurrent runs exceeded for workflow: @foo@.\"
workflowRun_errorMessage :: Lens.Lens' WorkflowRun (Prelude.Maybe Prelude.Text)
workflowRun_errorMessage :: (Maybe Text -> f (Maybe Text)) -> WorkflowRun -> f WorkflowRun
workflowRun_errorMessage = (WorkflowRun -> Maybe Text)
-> (WorkflowRun -> Maybe Text -> WorkflowRun)
-> Lens WorkflowRun WorkflowRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:WorkflowRun' :: WorkflowRun -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe Text
a -> WorkflowRun
s {$sel:errorMessage:WorkflowRun' :: Maybe Text
errorMessage = Maybe Text
a} :: WorkflowRun)

-- | The workflow run properties which were set during the run.
workflowRun_workflowRunProperties :: Lens.Lens' WorkflowRun (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
workflowRun_workflowRunProperties :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WorkflowRun -> f WorkflowRun
workflowRun_workflowRunProperties = (WorkflowRun -> Maybe (HashMap Text Text))
-> (WorkflowRun -> Maybe (HashMap Text Text) -> WorkflowRun)
-> Lens
     WorkflowRun
     WorkflowRun
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkflowRun' {Maybe (HashMap Text Text)
workflowRunProperties :: Maybe (HashMap Text Text)
$sel:workflowRunProperties:WorkflowRun' :: WorkflowRun -> Maybe (HashMap Text Text)
workflowRunProperties} -> Maybe (HashMap Text Text)
workflowRunProperties) (\s :: WorkflowRun
s@WorkflowRun' {} Maybe (HashMap Text Text)
a -> WorkflowRun
s {$sel:workflowRunProperties:WorkflowRun' :: Maybe (HashMap Text Text)
workflowRunProperties = Maybe (HashMap Text Text)
a} :: WorkflowRun) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> WorkflowRun -> f WorkflowRun)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WorkflowRun
-> f WorkflowRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON WorkflowRun where
  parseJSON :: Value -> Parser WorkflowRun
parseJSON =
    String
-> (Object -> Parser WorkflowRun) -> Value -> Parser WorkflowRun
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WorkflowRun"
      ( \Object
x ->
          Maybe POSIX
-> Maybe WorkflowRunStatus
-> Maybe WorkflowGraph
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe WorkflowRunStatistics
-> Maybe StartingEventBatchCondition
-> Maybe Text
-> Maybe (HashMap Text Text)
-> WorkflowRun
WorkflowRun'
            (Maybe POSIX
 -> Maybe WorkflowRunStatus
 -> Maybe WorkflowGraph
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe WorkflowRunStatistics
 -> Maybe StartingEventBatchCondition
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> WorkflowRun)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe WorkflowRunStatus
      -> Maybe WorkflowGraph
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkflowRunStatistics
      -> Maybe StartingEventBatchCondition
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> WorkflowRun)
forall (f :: * -> *) a b. Functor 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
"CompletedOn")
            Parser
  (Maybe WorkflowRunStatus
   -> Maybe WorkflowGraph
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkflowRunStatistics
   -> Maybe StartingEventBatchCondition
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> WorkflowRun)
-> Parser (Maybe WorkflowRunStatus)
-> Parser
     (Maybe WorkflowGraph
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkflowRunStatistics
      -> Maybe StartingEventBatchCondition
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> WorkflowRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkflowRunStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe WorkflowGraph
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkflowRunStatistics
   -> Maybe StartingEventBatchCondition
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> WorkflowRun)
-> Parser (Maybe WorkflowGraph)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkflowRunStatistics
      -> Maybe StartingEventBatchCondition
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> WorkflowRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkflowGraph)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Graph")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkflowRunStatistics
   -> Maybe StartingEventBatchCondition
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> WorkflowRun)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkflowRunStatistics
      -> Maybe StartingEventBatchCondition
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> WorkflowRun)
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
"StartedOn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkflowRunStatistics
   -> Maybe StartingEventBatchCondition
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> WorkflowRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe WorkflowRunStatistics
      -> Maybe StartingEventBatchCondition
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> WorkflowRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WorkflowRunId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe WorkflowRunStatistics
   -> Maybe StartingEventBatchCondition
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> WorkflowRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe WorkflowRunStatistics
      -> Maybe StartingEventBatchCondition
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> WorkflowRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Text
   -> Maybe WorkflowRunStatistics
   -> Maybe StartingEventBatchCondition
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> WorkflowRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe WorkflowRunStatistics
      -> Maybe StartingEventBatchCondition
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> WorkflowRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PreviousRunId")
            Parser
  (Maybe WorkflowRunStatistics
   -> Maybe StartingEventBatchCondition
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> WorkflowRun)
-> Parser (Maybe WorkflowRunStatistics)
-> Parser
     (Maybe StartingEventBatchCondition
      -> Maybe Text -> Maybe (HashMap Text Text) -> WorkflowRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkflowRunStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Statistics")
            Parser
  (Maybe StartingEventBatchCondition
   -> Maybe Text -> Maybe (HashMap Text Text) -> WorkflowRun)
-> Parser (Maybe StartingEventBatchCondition)
-> Parser (Maybe Text -> Maybe (HashMap Text Text) -> WorkflowRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StartingEventBatchCondition)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StartingEventBatchCondition")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> WorkflowRun)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> WorkflowRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorMessage")
            Parser (Maybe (HashMap Text Text) -> WorkflowRun)
-> Parser (Maybe (HashMap Text Text)) -> Parser WorkflowRun
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WorkflowRunProperties"
                            Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable WorkflowRun

instance Prelude.NFData WorkflowRun