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

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.JobRunState
import Amazonka.Glue.Types.NotificationProperty
import Amazonka.Glue.Types.Predecessor
import Amazonka.Glue.Types.WorkerType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a job run.
--
-- /See:/ 'newJobRun' smart constructor.
data JobRun = JobRun'
  { -- | The date and time that this job run completed.
    JobRun -> Maybe POSIX
completedOn :: Prelude.Maybe Core.POSIX,
    -- | The number of workers of a defined @workerType@ that are allocated when
    -- a job runs.
    --
    -- The maximum number of workers you can define are 299 for @G.1X@, and 149
    -- for @G.2X@.
    JobRun -> Maybe Int
numberOfWorkers :: Prelude.Maybe Prelude.Int,
    -- | The name of the trigger that started this job run.
    JobRun -> Maybe Text
triggerName :: Prelude.Maybe Prelude.Text,
    -- | Specifies configuration properties of a job run notification.
    JobRun -> Maybe NotificationProperty
notificationProperty :: Prelude.Maybe NotificationProperty,
    -- | The last time that this job run was modified.
    JobRun -> Maybe POSIX
lastModifiedOn :: Prelude.Maybe Core.POSIX,
    -- | The job arguments associated with this run. For this job run, they
    -- replace the default arguments set in the job definition itself.
    --
    -- You can specify arguments here that your own job-execution script
    -- consumes, as well as arguments that Glue itself consumes.
    --
    -- For information about how to specify and consume your own job arguments,
    -- see the
    -- <https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-python-calling.html Calling Glue APIs in Python>
    -- topic in the developer guide.
    --
    -- For information about the key-value pairs that Glue consumes to set up
    -- your job, see the
    -- <https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html Special Parameters Used by Glue>
    -- topic in the developer guide.
    JobRun -> Maybe (HashMap Text Text)
arguments :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the job definition being used in this run.
    JobRun -> Maybe Text
jobName :: Prelude.Maybe Prelude.Text,
    -- | The date and time at which this job run was started.
    JobRun -> Maybe POSIX
startedOn :: Prelude.Maybe Core.POSIX,
    -- | The type of predefined worker that is allocated when a job runs. Accepts
    -- a value of Standard, G.1X, or G.2X.
    --
    -- -   For the @Standard@ worker type, each worker provides 4 vCPU, 16 GB
    --     of memory and a 50GB disk, and 2 executors per worker.
    --
    -- -   For the @G.1X@ worker type, each worker provides 4 vCPU, 16 GB of
    --     memory and a 64GB disk, and 1 executor per worker.
    --
    -- -   For the @G.2X@ worker type, each worker provides 8 vCPU, 32 GB of
    --     memory and a 128GB disk, and 1 executor per worker.
    JobRun -> Maybe WorkerType
workerType :: Prelude.Maybe WorkerType,
    -- | The name of the @SecurityConfiguration@ structure to be used with this
    -- job run.
    JobRun -> Maybe Text
securityConfiguration :: Prelude.Maybe Prelude.Text,
    -- | Glue version determines the versions of Apache Spark and Python that
    -- Glue supports. The Python version indicates the version supported for
    -- jobs of type Spark.
    --
    -- For more information about the available Glue versions and corresponding
    -- Spark and Python versions, see
    -- <https://docs.aws.amazon.com/glue/latest/dg/add-job.html Glue version>
    -- in the developer guide.
    --
    -- Jobs that are created without specifying a Glue version default to Glue
    -- 0.9.
    JobRun -> Maybe Text
glueVersion :: Prelude.Maybe Prelude.Text,
    -- | The current state of the job run. For more information about the
    -- statuses of jobs that have terminated abnormally, see
    -- <https://docs.aws.amazon.com/glue/latest/dg/job-run-statuses.html Glue Job Run Statuses>.
    JobRun -> Maybe JobRunState
jobRunState :: Prelude.Maybe JobRunState,
    -- | The name of the log group for secure logging that can be server-side
    -- encrypted in Amazon CloudWatch using KMS. This name can be
    -- @\/aws-glue\/jobs\/@, in which case the default encryption is @NONE@. If
    -- you add a role name and @SecurityConfiguration@ name (in other words,
    -- @\/aws-glue\/jobs-yourRoleName-yourSecurityConfigurationName\/@), then
    -- that security configuration is used to encrypt the log group.
    JobRun -> Maybe Text
logGroupName :: Prelude.Maybe Prelude.Text,
    -- | The amount of time (in seconds) that the job run consumed resources.
    JobRun -> Maybe Int
executionTime :: Prelude.Maybe Prelude.Int,
    -- | A list of predecessors to this job run.
    JobRun -> Maybe [Predecessor]
predecessorRuns :: Prelude.Maybe [Predecessor],
    -- | The ID of the previous run of this job. For example, the @JobRunId@
    -- specified in the @StartJobRun@ action.
    JobRun -> Maybe Text
previousRunId :: Prelude.Maybe Prelude.Text,
    -- | The ID of this job run.
    JobRun -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The number of the attempt to run this job.
    JobRun -> Maybe Int
attempt :: Prelude.Maybe Prelude.Int,
    -- | This field is deprecated. Use @MaxCapacity@ instead.
    --
    -- The number of Glue data processing units (DPUs) allocated to this
    -- JobRun. From 2 to 100 DPUs can be allocated; the default is 10. A DPU is
    -- a relative measure of processing power that consists of 4 vCPUs of
    -- compute capacity and 16 GB of memory. For more information, see the
    -- <https://aws.amazon.com/glue/pricing/ Glue pricing page>.
    JobRun -> Maybe Int
allocatedCapacity :: Prelude.Maybe Prelude.Int,
    -- | The number of Glue data processing units (DPUs) that can be allocated
    -- when this job runs. A DPU is a relative measure of processing power that
    -- consists of 4 vCPUs of compute capacity and 16 GB of memory. For more
    -- information, see the
    -- <https://aws.amazon.com/glue/pricing/ Glue pricing page>.
    --
    -- Do not set @Max Capacity@ if using @WorkerType@ and @NumberOfWorkers@.
    --
    -- The value that can be allocated for @MaxCapacity@ depends on whether you
    -- are running a Python shell job or an Apache Spark ETL job:
    --
    -- -   When you specify a Python shell job
    --     (@JobCommand.Name@=\"pythonshell\"), you can allocate either 0.0625
    --     or 1 DPU. The default is 0.0625 DPU.
    --
    -- -   When you specify an Apache Spark ETL job
    --     (@JobCommand.Name@=\"glueetl\"), you can allocate from 2 to 100
    --     DPUs. The default is 10 DPUs. This job type cannot have a fractional
    --     DPU allocation.
    JobRun -> Maybe Double
maxCapacity :: Prelude.Maybe Prelude.Double,
    -- | The @JobRun@ timeout in minutes. This is the maximum time that a job run
    -- can consume resources before it is terminated and enters @TIMEOUT@
    -- status. The default is 2,880 minutes (48 hours). This overrides the
    -- timeout value set in the parent job.
    JobRun -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
    -- | An error message associated with this job run.
    JobRun -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (JobRun -> JobRun -> Bool
(JobRun -> JobRun -> Bool)
-> (JobRun -> JobRun -> Bool) -> Eq JobRun
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobRun -> JobRun -> Bool
$c/= :: JobRun -> JobRun -> Bool
== :: JobRun -> JobRun -> Bool
$c== :: JobRun -> JobRun -> Bool
Prelude.Eq, ReadPrec [JobRun]
ReadPrec JobRun
Int -> ReadS JobRun
ReadS [JobRun]
(Int -> ReadS JobRun)
-> ReadS [JobRun]
-> ReadPrec JobRun
-> ReadPrec [JobRun]
-> Read JobRun
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobRun]
$creadListPrec :: ReadPrec [JobRun]
readPrec :: ReadPrec JobRun
$creadPrec :: ReadPrec JobRun
readList :: ReadS [JobRun]
$creadList :: ReadS [JobRun]
readsPrec :: Int -> ReadS JobRun
$creadsPrec :: Int -> ReadS JobRun
Prelude.Read, Int -> JobRun -> ShowS
[JobRun] -> ShowS
JobRun -> String
(Int -> JobRun -> ShowS)
-> (JobRun -> String) -> ([JobRun] -> ShowS) -> Show JobRun
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobRun] -> ShowS
$cshowList :: [JobRun] -> ShowS
show :: JobRun -> String
$cshow :: JobRun -> String
showsPrec :: Int -> JobRun -> ShowS
$cshowsPrec :: Int -> JobRun -> ShowS
Prelude.Show, (forall x. JobRun -> Rep JobRun x)
-> (forall x. Rep JobRun x -> JobRun) -> Generic JobRun
forall x. Rep JobRun x -> JobRun
forall x. JobRun -> Rep JobRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobRun x -> JobRun
$cfrom :: forall x. JobRun -> Rep JobRun x
Prelude.Generic)

-- |
-- Create a value of 'JobRun' 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', 'jobRun_completedOn' - The date and time that this job run completed.
--
-- 'numberOfWorkers', 'jobRun_numberOfWorkers' - The number of workers of a defined @workerType@ that are allocated when
-- a job runs.
--
-- The maximum number of workers you can define are 299 for @G.1X@, and 149
-- for @G.2X@.
--
-- 'triggerName', 'jobRun_triggerName' - The name of the trigger that started this job run.
--
-- 'notificationProperty', 'jobRun_notificationProperty' - Specifies configuration properties of a job run notification.
--
-- 'lastModifiedOn', 'jobRun_lastModifiedOn' - The last time that this job run was modified.
--
-- 'arguments', 'jobRun_arguments' - The job arguments associated with this run. For this job run, they
-- replace the default arguments set in the job definition itself.
--
-- You can specify arguments here that your own job-execution script
-- consumes, as well as arguments that Glue itself consumes.
--
-- For information about how to specify and consume your own job arguments,
-- see the
-- <https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-python-calling.html Calling Glue APIs in Python>
-- topic in the developer guide.
--
-- For information about the key-value pairs that Glue consumes to set up
-- your job, see the
-- <https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html Special Parameters Used by Glue>
-- topic in the developer guide.
--
-- 'jobName', 'jobRun_jobName' - The name of the job definition being used in this run.
--
-- 'startedOn', 'jobRun_startedOn' - The date and time at which this job run was started.
--
-- 'workerType', 'jobRun_workerType' - The type of predefined worker that is allocated when a job runs. Accepts
-- a value of Standard, G.1X, or G.2X.
--
-- -   For the @Standard@ worker type, each worker provides 4 vCPU, 16 GB
--     of memory and a 50GB disk, and 2 executors per worker.
--
-- -   For the @G.1X@ worker type, each worker provides 4 vCPU, 16 GB of
--     memory and a 64GB disk, and 1 executor per worker.
--
-- -   For the @G.2X@ worker type, each worker provides 8 vCPU, 32 GB of
--     memory and a 128GB disk, and 1 executor per worker.
--
-- 'securityConfiguration', 'jobRun_securityConfiguration' - The name of the @SecurityConfiguration@ structure to be used with this
-- job run.
--
-- 'glueVersion', 'jobRun_glueVersion' - Glue version determines the versions of Apache Spark and Python that
-- Glue supports. The Python version indicates the version supported for
-- jobs of type Spark.
--
-- For more information about the available Glue versions and corresponding
-- Spark and Python versions, see
-- <https://docs.aws.amazon.com/glue/latest/dg/add-job.html Glue version>
-- in the developer guide.
--
-- Jobs that are created without specifying a Glue version default to Glue
-- 0.9.
--
-- 'jobRunState', 'jobRun_jobRunState' - The current state of the job run. For more information about the
-- statuses of jobs that have terminated abnormally, see
-- <https://docs.aws.amazon.com/glue/latest/dg/job-run-statuses.html Glue Job Run Statuses>.
--
-- 'logGroupName', 'jobRun_logGroupName' - The name of the log group for secure logging that can be server-side
-- encrypted in Amazon CloudWatch using KMS. This name can be
-- @\/aws-glue\/jobs\/@, in which case the default encryption is @NONE@. If
-- you add a role name and @SecurityConfiguration@ name (in other words,
-- @\/aws-glue\/jobs-yourRoleName-yourSecurityConfigurationName\/@), then
-- that security configuration is used to encrypt the log group.
--
-- 'executionTime', 'jobRun_executionTime' - The amount of time (in seconds) that the job run consumed resources.
--
-- 'predecessorRuns', 'jobRun_predecessorRuns' - A list of predecessors to this job run.
--
-- 'previousRunId', 'jobRun_previousRunId' - The ID of the previous run of this job. For example, the @JobRunId@
-- specified in the @StartJobRun@ action.
--
-- 'id', 'jobRun_id' - The ID of this job run.
--
-- 'attempt', 'jobRun_attempt' - The number of the attempt to run this job.
--
-- 'allocatedCapacity', 'jobRun_allocatedCapacity' - This field is deprecated. Use @MaxCapacity@ instead.
--
-- The number of Glue data processing units (DPUs) allocated to this
-- JobRun. From 2 to 100 DPUs can be allocated; the default is 10. A DPU is
-- a relative measure of processing power that consists of 4 vCPUs of
-- compute capacity and 16 GB of memory. For more information, see the
-- <https://aws.amazon.com/glue/pricing/ Glue pricing page>.
--
-- 'maxCapacity', 'jobRun_maxCapacity' - The number of Glue data processing units (DPUs) that can be allocated
-- when this job runs. A DPU is a relative measure of processing power that
-- consists of 4 vCPUs of compute capacity and 16 GB of memory. For more
-- information, see the
-- <https://aws.amazon.com/glue/pricing/ Glue pricing page>.
--
-- Do not set @Max Capacity@ if using @WorkerType@ and @NumberOfWorkers@.
--
-- The value that can be allocated for @MaxCapacity@ depends on whether you
-- are running a Python shell job or an Apache Spark ETL job:
--
-- -   When you specify a Python shell job
--     (@JobCommand.Name@=\"pythonshell\"), you can allocate either 0.0625
--     or 1 DPU. The default is 0.0625 DPU.
--
-- -   When you specify an Apache Spark ETL job
--     (@JobCommand.Name@=\"glueetl\"), you can allocate from 2 to 100
--     DPUs. The default is 10 DPUs. This job type cannot have a fractional
--     DPU allocation.
--
-- 'timeout', 'jobRun_timeout' - The @JobRun@ timeout in minutes. This is the maximum time that a job run
-- can consume resources before it is terminated and enters @TIMEOUT@
-- status. The default is 2,880 minutes (48 hours). This overrides the
-- timeout value set in the parent job.
--
-- 'errorMessage', 'jobRun_errorMessage' - An error message associated with this job run.
newJobRun ::
  JobRun
newJobRun :: JobRun
newJobRun =
  JobRun' :: Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe NotificationProperty
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe WorkerType
-> Maybe Text
-> Maybe Text
-> Maybe JobRunState
-> Maybe Text
-> Maybe Int
-> Maybe [Predecessor]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Double
-> Maybe Natural
-> Maybe Text
-> JobRun
JobRun'
    { $sel:completedOn:JobRun' :: Maybe POSIX
completedOn = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfWorkers:JobRun' :: Maybe Int
numberOfWorkers = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:triggerName:JobRun' :: Maybe Text
triggerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationProperty:JobRun' :: Maybe NotificationProperty
notificationProperty = Maybe NotificationProperty
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedOn:JobRun' :: Maybe POSIX
lastModifiedOn = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arguments:JobRun' :: Maybe (HashMap Text Text)
arguments = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:jobName:JobRun' :: Maybe Text
jobName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startedOn:JobRun' :: Maybe POSIX
startedOn = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:workerType:JobRun' :: Maybe WorkerType
workerType = Maybe WorkerType
forall a. Maybe a
Prelude.Nothing,
      $sel:securityConfiguration:JobRun' :: Maybe Text
securityConfiguration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:glueVersion:JobRun' :: Maybe Text
glueVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobRunState:JobRun' :: Maybe JobRunState
jobRunState = Maybe JobRunState
forall a. Maybe a
Prelude.Nothing,
      $sel:logGroupName:JobRun' :: Maybe Text
logGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:executionTime:JobRun' :: Maybe Int
executionTime = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:predecessorRuns:JobRun' :: Maybe [Predecessor]
predecessorRuns = Maybe [Predecessor]
forall a. Maybe a
Prelude.Nothing,
      $sel:previousRunId:JobRun' :: Maybe Text
previousRunId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:JobRun' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attempt:JobRun' :: Maybe Int
attempt = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:allocatedCapacity:JobRun' :: Maybe Int
allocatedCapacity = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:maxCapacity:JobRun' :: Maybe Double
maxCapacity = Maybe Double
forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:JobRun' :: Maybe Natural
timeout = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:JobRun' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time that this job run completed.
jobRun_completedOn :: Lens.Lens' JobRun (Prelude.Maybe Prelude.UTCTime)
jobRun_completedOn :: (Maybe UTCTime -> f (Maybe UTCTime)) -> JobRun -> f JobRun
jobRun_completedOn = (JobRun -> Maybe POSIX)
-> (JobRun -> Maybe POSIX -> JobRun)
-> Lens JobRun JobRun (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe POSIX
completedOn :: Maybe POSIX
$sel:completedOn:JobRun' :: JobRun -> Maybe POSIX
completedOn} -> Maybe POSIX
completedOn) (\s :: JobRun
s@JobRun' {} Maybe POSIX
a -> JobRun
s {$sel:completedOn:JobRun' :: Maybe POSIX
completedOn = Maybe POSIX
a} :: JobRun) ((Maybe POSIX -> f (Maybe POSIX)) -> JobRun -> f JobRun)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JobRun
-> f JobRun
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 number of workers of a defined @workerType@ that are allocated when
-- a job runs.
--
-- The maximum number of workers you can define are 299 for @G.1X@, and 149
-- for @G.2X@.
jobRun_numberOfWorkers :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Int)
jobRun_numberOfWorkers :: (Maybe Int -> f (Maybe Int)) -> JobRun -> f JobRun
jobRun_numberOfWorkers = (JobRun -> Maybe Int)
-> (JobRun -> Maybe Int -> JobRun)
-> Lens JobRun JobRun (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Int
numberOfWorkers :: Maybe Int
$sel:numberOfWorkers:JobRun' :: JobRun -> Maybe Int
numberOfWorkers} -> Maybe Int
numberOfWorkers) (\s :: JobRun
s@JobRun' {} Maybe Int
a -> JobRun
s {$sel:numberOfWorkers:JobRun' :: Maybe Int
numberOfWorkers = Maybe Int
a} :: JobRun)

-- | The name of the trigger that started this job run.
jobRun_triggerName :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Text)
jobRun_triggerName :: (Maybe Text -> f (Maybe Text)) -> JobRun -> f JobRun
jobRun_triggerName = (JobRun -> Maybe Text)
-> (JobRun -> Maybe Text -> JobRun)
-> Lens JobRun JobRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Text
triggerName :: Maybe Text
$sel:triggerName:JobRun' :: JobRun -> Maybe Text
triggerName} -> Maybe Text
triggerName) (\s :: JobRun
s@JobRun' {} Maybe Text
a -> JobRun
s {$sel:triggerName:JobRun' :: Maybe Text
triggerName = Maybe Text
a} :: JobRun)

-- | Specifies configuration properties of a job run notification.
jobRun_notificationProperty :: Lens.Lens' JobRun (Prelude.Maybe NotificationProperty)
jobRun_notificationProperty :: (Maybe NotificationProperty -> f (Maybe NotificationProperty))
-> JobRun -> f JobRun
jobRun_notificationProperty = (JobRun -> Maybe NotificationProperty)
-> (JobRun -> Maybe NotificationProperty -> JobRun)
-> Lens
     JobRun
     JobRun
     (Maybe NotificationProperty)
     (Maybe NotificationProperty)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe NotificationProperty
notificationProperty :: Maybe NotificationProperty
$sel:notificationProperty:JobRun' :: JobRun -> Maybe NotificationProperty
notificationProperty} -> Maybe NotificationProperty
notificationProperty) (\s :: JobRun
s@JobRun' {} Maybe NotificationProperty
a -> JobRun
s {$sel:notificationProperty:JobRun' :: Maybe NotificationProperty
notificationProperty = Maybe NotificationProperty
a} :: JobRun)

-- | The last time that this job run was modified.
jobRun_lastModifiedOn :: Lens.Lens' JobRun (Prelude.Maybe Prelude.UTCTime)
jobRun_lastModifiedOn :: (Maybe UTCTime -> f (Maybe UTCTime)) -> JobRun -> f JobRun
jobRun_lastModifiedOn = (JobRun -> Maybe POSIX)
-> (JobRun -> Maybe POSIX -> JobRun)
-> Lens JobRun JobRun (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe POSIX
lastModifiedOn :: Maybe POSIX
$sel:lastModifiedOn:JobRun' :: JobRun -> Maybe POSIX
lastModifiedOn} -> Maybe POSIX
lastModifiedOn) (\s :: JobRun
s@JobRun' {} Maybe POSIX
a -> JobRun
s {$sel:lastModifiedOn:JobRun' :: Maybe POSIX
lastModifiedOn = Maybe POSIX
a} :: JobRun) ((Maybe POSIX -> f (Maybe POSIX)) -> JobRun -> f JobRun)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JobRun
-> f JobRun
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 job arguments associated with this run. For this job run, they
-- replace the default arguments set in the job definition itself.
--
-- You can specify arguments here that your own job-execution script
-- consumes, as well as arguments that Glue itself consumes.
--
-- For information about how to specify and consume your own job arguments,
-- see the
-- <https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-python-calling.html Calling Glue APIs in Python>
-- topic in the developer guide.
--
-- For information about the key-value pairs that Glue consumes to set up
-- your job, see the
-- <https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html Special Parameters Used by Glue>
-- topic in the developer guide.
jobRun_arguments :: Lens.Lens' JobRun (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
jobRun_arguments :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> JobRun -> f JobRun
jobRun_arguments = (JobRun -> Maybe (HashMap Text Text))
-> (JobRun -> Maybe (HashMap Text Text) -> JobRun)
-> Lens
     JobRun
     JobRun
     (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 (\JobRun' {Maybe (HashMap Text Text)
arguments :: Maybe (HashMap Text Text)
$sel:arguments:JobRun' :: JobRun -> Maybe (HashMap Text Text)
arguments} -> Maybe (HashMap Text Text)
arguments) (\s :: JobRun
s@JobRun' {} Maybe (HashMap Text Text)
a -> JobRun
s {$sel:arguments:JobRun' :: Maybe (HashMap Text Text)
arguments = Maybe (HashMap Text Text)
a} :: JobRun) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> JobRun -> f JobRun)
-> ((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)))
-> JobRun
-> f JobRun
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

-- | The name of the job definition being used in this run.
jobRun_jobName :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Text)
jobRun_jobName :: (Maybe Text -> f (Maybe Text)) -> JobRun -> f JobRun
jobRun_jobName = (JobRun -> Maybe Text)
-> (JobRun -> Maybe Text -> JobRun)
-> Lens JobRun JobRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Text
jobName :: Maybe Text
$sel:jobName:JobRun' :: JobRun -> Maybe Text
jobName} -> Maybe Text
jobName) (\s :: JobRun
s@JobRun' {} Maybe Text
a -> JobRun
s {$sel:jobName:JobRun' :: Maybe Text
jobName = Maybe Text
a} :: JobRun)

-- | The date and time at which this job run was started.
jobRun_startedOn :: Lens.Lens' JobRun (Prelude.Maybe Prelude.UTCTime)
jobRun_startedOn :: (Maybe UTCTime -> f (Maybe UTCTime)) -> JobRun -> f JobRun
jobRun_startedOn = (JobRun -> Maybe POSIX)
-> (JobRun -> Maybe POSIX -> JobRun)
-> Lens JobRun JobRun (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe POSIX
startedOn :: Maybe POSIX
$sel:startedOn:JobRun' :: JobRun -> Maybe POSIX
startedOn} -> Maybe POSIX
startedOn) (\s :: JobRun
s@JobRun' {} Maybe POSIX
a -> JobRun
s {$sel:startedOn:JobRun' :: Maybe POSIX
startedOn = Maybe POSIX
a} :: JobRun) ((Maybe POSIX -> f (Maybe POSIX)) -> JobRun -> f JobRun)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JobRun
-> f JobRun
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 type of predefined worker that is allocated when a job runs. Accepts
-- a value of Standard, G.1X, or G.2X.
--
-- -   For the @Standard@ worker type, each worker provides 4 vCPU, 16 GB
--     of memory and a 50GB disk, and 2 executors per worker.
--
-- -   For the @G.1X@ worker type, each worker provides 4 vCPU, 16 GB of
--     memory and a 64GB disk, and 1 executor per worker.
--
-- -   For the @G.2X@ worker type, each worker provides 8 vCPU, 32 GB of
--     memory and a 128GB disk, and 1 executor per worker.
jobRun_workerType :: Lens.Lens' JobRun (Prelude.Maybe WorkerType)
jobRun_workerType :: (Maybe WorkerType -> f (Maybe WorkerType)) -> JobRun -> f JobRun
jobRun_workerType = (JobRun -> Maybe WorkerType)
-> (JobRun -> Maybe WorkerType -> JobRun)
-> Lens JobRun JobRun (Maybe WorkerType) (Maybe WorkerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe WorkerType
workerType :: Maybe WorkerType
$sel:workerType:JobRun' :: JobRun -> Maybe WorkerType
workerType} -> Maybe WorkerType
workerType) (\s :: JobRun
s@JobRun' {} Maybe WorkerType
a -> JobRun
s {$sel:workerType:JobRun' :: Maybe WorkerType
workerType = Maybe WorkerType
a} :: JobRun)

-- | The name of the @SecurityConfiguration@ structure to be used with this
-- job run.
jobRun_securityConfiguration :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Text)
jobRun_securityConfiguration :: (Maybe Text -> f (Maybe Text)) -> JobRun -> f JobRun
jobRun_securityConfiguration = (JobRun -> Maybe Text)
-> (JobRun -> Maybe Text -> JobRun)
-> Lens JobRun JobRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Text
securityConfiguration :: Maybe Text
$sel:securityConfiguration:JobRun' :: JobRun -> Maybe Text
securityConfiguration} -> Maybe Text
securityConfiguration) (\s :: JobRun
s@JobRun' {} Maybe Text
a -> JobRun
s {$sel:securityConfiguration:JobRun' :: Maybe Text
securityConfiguration = Maybe Text
a} :: JobRun)

-- | Glue version determines the versions of Apache Spark and Python that
-- Glue supports. The Python version indicates the version supported for
-- jobs of type Spark.
--
-- For more information about the available Glue versions and corresponding
-- Spark and Python versions, see
-- <https://docs.aws.amazon.com/glue/latest/dg/add-job.html Glue version>
-- in the developer guide.
--
-- Jobs that are created without specifying a Glue version default to Glue
-- 0.9.
jobRun_glueVersion :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Text)
jobRun_glueVersion :: (Maybe Text -> f (Maybe Text)) -> JobRun -> f JobRun
jobRun_glueVersion = (JobRun -> Maybe Text)
-> (JobRun -> Maybe Text -> JobRun)
-> Lens JobRun JobRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Text
glueVersion :: Maybe Text
$sel:glueVersion:JobRun' :: JobRun -> Maybe Text
glueVersion} -> Maybe Text
glueVersion) (\s :: JobRun
s@JobRun' {} Maybe Text
a -> JobRun
s {$sel:glueVersion:JobRun' :: Maybe Text
glueVersion = Maybe Text
a} :: JobRun)

-- | The current state of the job run. For more information about the
-- statuses of jobs that have terminated abnormally, see
-- <https://docs.aws.amazon.com/glue/latest/dg/job-run-statuses.html Glue Job Run Statuses>.
jobRun_jobRunState :: Lens.Lens' JobRun (Prelude.Maybe JobRunState)
jobRun_jobRunState :: (Maybe JobRunState -> f (Maybe JobRunState)) -> JobRun -> f JobRun
jobRun_jobRunState = (JobRun -> Maybe JobRunState)
-> (JobRun -> Maybe JobRunState -> JobRun)
-> Lens JobRun JobRun (Maybe JobRunState) (Maybe JobRunState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe JobRunState
jobRunState :: Maybe JobRunState
$sel:jobRunState:JobRun' :: JobRun -> Maybe JobRunState
jobRunState} -> Maybe JobRunState
jobRunState) (\s :: JobRun
s@JobRun' {} Maybe JobRunState
a -> JobRun
s {$sel:jobRunState:JobRun' :: Maybe JobRunState
jobRunState = Maybe JobRunState
a} :: JobRun)

-- | The name of the log group for secure logging that can be server-side
-- encrypted in Amazon CloudWatch using KMS. This name can be
-- @\/aws-glue\/jobs\/@, in which case the default encryption is @NONE@. If
-- you add a role name and @SecurityConfiguration@ name (in other words,
-- @\/aws-glue\/jobs-yourRoleName-yourSecurityConfigurationName\/@), then
-- that security configuration is used to encrypt the log group.
jobRun_logGroupName :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Text)
jobRun_logGroupName :: (Maybe Text -> f (Maybe Text)) -> JobRun -> f JobRun
jobRun_logGroupName = (JobRun -> Maybe Text)
-> (JobRun -> Maybe Text -> JobRun)
-> Lens JobRun JobRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Text
logGroupName :: Maybe Text
$sel:logGroupName:JobRun' :: JobRun -> Maybe Text
logGroupName} -> Maybe Text
logGroupName) (\s :: JobRun
s@JobRun' {} Maybe Text
a -> JobRun
s {$sel:logGroupName:JobRun' :: Maybe Text
logGroupName = Maybe Text
a} :: JobRun)

-- | The amount of time (in seconds) that the job run consumed resources.
jobRun_executionTime :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Int)
jobRun_executionTime :: (Maybe Int -> f (Maybe Int)) -> JobRun -> f JobRun
jobRun_executionTime = (JobRun -> Maybe Int)
-> (JobRun -> Maybe Int -> JobRun)
-> Lens JobRun JobRun (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Int
executionTime :: Maybe Int
$sel:executionTime:JobRun' :: JobRun -> Maybe Int
executionTime} -> Maybe Int
executionTime) (\s :: JobRun
s@JobRun' {} Maybe Int
a -> JobRun
s {$sel:executionTime:JobRun' :: Maybe Int
executionTime = Maybe Int
a} :: JobRun)

-- | A list of predecessors to this job run.
jobRun_predecessorRuns :: Lens.Lens' JobRun (Prelude.Maybe [Predecessor])
jobRun_predecessorRuns :: (Maybe [Predecessor] -> f (Maybe [Predecessor]))
-> JobRun -> f JobRun
jobRun_predecessorRuns = (JobRun -> Maybe [Predecessor])
-> (JobRun -> Maybe [Predecessor] -> JobRun)
-> Lens JobRun JobRun (Maybe [Predecessor]) (Maybe [Predecessor])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe [Predecessor]
predecessorRuns :: Maybe [Predecessor]
$sel:predecessorRuns:JobRun' :: JobRun -> Maybe [Predecessor]
predecessorRuns} -> Maybe [Predecessor]
predecessorRuns) (\s :: JobRun
s@JobRun' {} Maybe [Predecessor]
a -> JobRun
s {$sel:predecessorRuns:JobRun' :: Maybe [Predecessor]
predecessorRuns = Maybe [Predecessor]
a} :: JobRun) ((Maybe [Predecessor] -> f (Maybe [Predecessor]))
 -> JobRun -> f JobRun)
-> ((Maybe [Predecessor] -> f (Maybe [Predecessor]))
    -> Maybe [Predecessor] -> f (Maybe [Predecessor]))
-> (Maybe [Predecessor] -> f (Maybe [Predecessor]))
-> JobRun
-> f JobRun
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Predecessor] [Predecessor] [Predecessor] [Predecessor]
-> Iso
     (Maybe [Predecessor])
     (Maybe [Predecessor])
     (Maybe [Predecessor])
     (Maybe [Predecessor])
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 [Predecessor] [Predecessor] [Predecessor] [Predecessor]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the previous run of this job. For example, the @JobRunId@
-- specified in the @StartJobRun@ action.
jobRun_previousRunId :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Text)
jobRun_previousRunId :: (Maybe Text -> f (Maybe Text)) -> JobRun -> f JobRun
jobRun_previousRunId = (JobRun -> Maybe Text)
-> (JobRun -> Maybe Text -> JobRun)
-> Lens JobRun JobRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Text
previousRunId :: Maybe Text
$sel:previousRunId:JobRun' :: JobRun -> Maybe Text
previousRunId} -> Maybe Text
previousRunId) (\s :: JobRun
s@JobRun' {} Maybe Text
a -> JobRun
s {$sel:previousRunId:JobRun' :: Maybe Text
previousRunId = Maybe Text
a} :: JobRun)

-- | The ID of this job run.
jobRun_id :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Text)
jobRun_id :: (Maybe Text -> f (Maybe Text)) -> JobRun -> f JobRun
jobRun_id = (JobRun -> Maybe Text)
-> (JobRun -> Maybe Text -> JobRun)
-> Lens JobRun JobRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Text
id :: Maybe Text
$sel:id:JobRun' :: JobRun -> Maybe Text
id} -> Maybe Text
id) (\s :: JobRun
s@JobRun' {} Maybe Text
a -> JobRun
s {$sel:id:JobRun' :: Maybe Text
id = Maybe Text
a} :: JobRun)

-- | The number of the attempt to run this job.
jobRun_attempt :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Int)
jobRun_attempt :: (Maybe Int -> f (Maybe Int)) -> JobRun -> f JobRun
jobRun_attempt = (JobRun -> Maybe Int)
-> (JobRun -> Maybe Int -> JobRun)
-> Lens JobRun JobRun (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Int
attempt :: Maybe Int
$sel:attempt:JobRun' :: JobRun -> Maybe Int
attempt} -> Maybe Int
attempt) (\s :: JobRun
s@JobRun' {} Maybe Int
a -> JobRun
s {$sel:attempt:JobRun' :: Maybe Int
attempt = Maybe Int
a} :: JobRun)

-- | This field is deprecated. Use @MaxCapacity@ instead.
--
-- The number of Glue data processing units (DPUs) allocated to this
-- JobRun. From 2 to 100 DPUs can be allocated; the default is 10. A DPU is
-- a relative measure of processing power that consists of 4 vCPUs of
-- compute capacity and 16 GB of memory. For more information, see the
-- <https://aws.amazon.com/glue/pricing/ Glue pricing page>.
jobRun_allocatedCapacity :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Int)
jobRun_allocatedCapacity :: (Maybe Int -> f (Maybe Int)) -> JobRun -> f JobRun
jobRun_allocatedCapacity = (JobRun -> Maybe Int)
-> (JobRun -> Maybe Int -> JobRun)
-> Lens JobRun JobRun (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Int
allocatedCapacity :: Maybe Int
$sel:allocatedCapacity:JobRun' :: JobRun -> Maybe Int
allocatedCapacity} -> Maybe Int
allocatedCapacity) (\s :: JobRun
s@JobRun' {} Maybe Int
a -> JobRun
s {$sel:allocatedCapacity:JobRun' :: Maybe Int
allocatedCapacity = Maybe Int
a} :: JobRun)

-- | The number of Glue data processing units (DPUs) that can be allocated
-- when this job runs. A DPU is a relative measure of processing power that
-- consists of 4 vCPUs of compute capacity and 16 GB of memory. For more
-- information, see the
-- <https://aws.amazon.com/glue/pricing/ Glue pricing page>.
--
-- Do not set @Max Capacity@ if using @WorkerType@ and @NumberOfWorkers@.
--
-- The value that can be allocated for @MaxCapacity@ depends on whether you
-- are running a Python shell job or an Apache Spark ETL job:
--
-- -   When you specify a Python shell job
--     (@JobCommand.Name@=\"pythonshell\"), you can allocate either 0.0625
--     or 1 DPU. The default is 0.0625 DPU.
--
-- -   When you specify an Apache Spark ETL job
--     (@JobCommand.Name@=\"glueetl\"), you can allocate from 2 to 100
--     DPUs. The default is 10 DPUs. This job type cannot have a fractional
--     DPU allocation.
jobRun_maxCapacity :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Double)
jobRun_maxCapacity :: (Maybe Double -> f (Maybe Double)) -> JobRun -> f JobRun
jobRun_maxCapacity = (JobRun -> Maybe Double)
-> (JobRun -> Maybe Double -> JobRun)
-> Lens JobRun JobRun (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Double
maxCapacity :: Maybe Double
$sel:maxCapacity:JobRun' :: JobRun -> Maybe Double
maxCapacity} -> Maybe Double
maxCapacity) (\s :: JobRun
s@JobRun' {} Maybe Double
a -> JobRun
s {$sel:maxCapacity:JobRun' :: Maybe Double
maxCapacity = Maybe Double
a} :: JobRun)

-- | The @JobRun@ timeout in minutes. This is the maximum time that a job run
-- can consume resources before it is terminated and enters @TIMEOUT@
-- status. The default is 2,880 minutes (48 hours). This overrides the
-- timeout value set in the parent job.
jobRun_timeout :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Natural)
jobRun_timeout :: (Maybe Natural -> f (Maybe Natural)) -> JobRun -> f JobRun
jobRun_timeout = (JobRun -> Maybe Natural)
-> (JobRun -> Maybe Natural -> JobRun)
-> Lens JobRun JobRun (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Natural
timeout :: Maybe Natural
$sel:timeout:JobRun' :: JobRun -> Maybe Natural
timeout} -> Maybe Natural
timeout) (\s :: JobRun
s@JobRun' {} Maybe Natural
a -> JobRun
s {$sel:timeout:JobRun' :: Maybe Natural
timeout = Maybe Natural
a} :: JobRun)

-- | An error message associated with this job run.
jobRun_errorMessage :: Lens.Lens' JobRun (Prelude.Maybe Prelude.Text)
jobRun_errorMessage :: (Maybe Text -> f (Maybe Text)) -> JobRun -> f JobRun
jobRun_errorMessage = (JobRun -> Maybe Text)
-> (JobRun -> Maybe Text -> JobRun)
-> Lens JobRun JobRun (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobRun' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:JobRun' :: JobRun -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: JobRun
s@JobRun' {} Maybe Text
a -> JobRun
s {$sel:errorMessage:JobRun' :: Maybe Text
errorMessage = Maybe Text
a} :: JobRun)

instance Core.FromJSON JobRun where
  parseJSON :: Value -> Parser JobRun
parseJSON =
    String -> (Object -> Parser JobRun) -> Value -> Parser JobRun
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"JobRun"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Int
-> Maybe Text
-> Maybe NotificationProperty
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe WorkerType
-> Maybe Text
-> Maybe Text
-> Maybe JobRunState
-> Maybe Text
-> Maybe Int
-> Maybe [Predecessor]
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Double
-> Maybe Natural
-> Maybe Text
-> JobRun
JobRun'
            (Maybe POSIX
 -> Maybe Int
 -> Maybe Text
 -> Maybe NotificationProperty
 -> Maybe POSIX
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe WorkerType
 -> Maybe Text
 -> Maybe Text
 -> Maybe JobRunState
 -> Maybe Text
 -> Maybe Int
 -> Maybe [Predecessor]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe Double
 -> Maybe Natural
 -> Maybe Text
 -> JobRun)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe NotificationProperty
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe WorkerType
      -> Maybe Text
      -> Maybe Text
      -> Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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 Int
   -> Maybe Text
   -> Maybe NotificationProperty
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe WorkerType
   -> Maybe Text
   -> Maybe Text
   -> Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe NotificationProperty
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe WorkerType
      -> Maybe Text
      -> Maybe Text
      -> Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumberOfWorkers")
            Parser
  (Maybe Text
   -> Maybe NotificationProperty
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe WorkerType
   -> Maybe Text
   -> Maybe Text
   -> Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe NotificationProperty
      -> Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe WorkerType
      -> Maybe Text
      -> Maybe Text
      -> Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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
"TriggerName")
            Parser
  (Maybe NotificationProperty
   -> Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe WorkerType
   -> Maybe Text
   -> Maybe Text
   -> Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe NotificationProperty)
-> Parser
     (Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe WorkerType
      -> Maybe Text
      -> Maybe Text
      -> Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NotificationProperty)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NotificationProperty")
            Parser
  (Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe WorkerType
   -> Maybe Text
   -> Maybe Text
   -> Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe WorkerType
      -> Maybe Text
      -> Maybe Text
      -> Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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
"LastModifiedOn")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe WorkerType
   -> Maybe Text
   -> Maybe Text
   -> Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe WorkerType
      -> Maybe Text
      -> Maybe Text
      -> Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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
"Arguments" 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)
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe WorkerType
   -> Maybe Text
   -> Maybe Text
   -> Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe WorkerType
      -> Maybe Text
      -> Maybe Text
      -> Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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
"JobName")
            Parser
  (Maybe POSIX
   -> Maybe WorkerType
   -> Maybe Text
   -> Maybe Text
   -> Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe WorkerType
      -> Maybe Text
      -> Maybe Text
      -> Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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 WorkerType
   -> Maybe Text
   -> Maybe Text
   -> Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe WorkerType)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkerType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WorkerType")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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
"SecurityConfiguration")
            Parser
  (Maybe Text
   -> Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe JobRunState
      -> Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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
"GlueVersion")
            Parser
  (Maybe JobRunState
   -> Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe JobRunState)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobRunState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JobRunState")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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
"LogGroupName")
            Parser
  (Maybe Int
   -> Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe Int)
-> Parser
     (Maybe [Predecessor]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExecutionTime")
            Parser
  (Maybe [Predecessor]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe [Predecessor])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Predecessor]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PredecessorRuns"
                            Parser (Maybe (Maybe [Predecessor]))
-> Maybe [Predecessor] -> Parser (Maybe [Predecessor])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Predecessor]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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 Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Double
      -> Maybe Natural
      -> Maybe Text
      -> JobRun)
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
"Id")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Double
   -> Maybe Natural
   -> Maybe Text
   -> JobRun)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Double -> Maybe Natural -> Maybe Text -> JobRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Attempt")
            Parser
  (Maybe Int
   -> Maybe Double -> Maybe Natural -> Maybe Text -> JobRun)
-> Parser (Maybe Int)
-> Parser (Maybe Double -> Maybe Natural -> Maybe Text -> JobRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AllocatedCapacity")
            Parser (Maybe Double -> Maybe Natural -> Maybe Text -> JobRun)
-> Parser (Maybe Double)
-> Parser (Maybe Natural -> Maybe Text -> JobRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxCapacity")
            Parser (Maybe Natural -> Maybe Text -> JobRun)
-> Parser (Maybe Natural) -> Parser (Maybe Text -> JobRun)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Timeout")
            Parser (Maybe Text -> JobRun)
-> Parser (Maybe Text) -> Parser JobRun
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")
      )

instance Prelude.Hashable JobRun

instance Prelude.NFData JobRun