{-# 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.Batch.Types.JobDetail
-- 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.Batch.Types.JobDetail where

import Amazonka.Batch.Types.ArrayPropertiesDetail
import Amazonka.Batch.Types.AttemptDetail
import Amazonka.Batch.Types.ContainerDetail
import Amazonka.Batch.Types.JobDependency
import Amazonka.Batch.Types.JobStatus
import Amazonka.Batch.Types.JobTimeout
import Amazonka.Batch.Types.NodeDetails
import Amazonka.Batch.Types.NodeProperties
import Amazonka.Batch.Types.PlatformCapability
import Amazonka.Batch.Types.RetryStrategy
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object representing an Batch job.
--
-- /See:/ 'newJobDetail' smart constructor.
data JobDetail = JobDetail'
  { -- | The Unix timestamp (in milliseconds) for when the job was stopped (when
    -- the job transitioned from the @RUNNING@ state to a terminal state, such
    -- as @SUCCEEDED@ or @FAILED@).
    JobDetail -> Maybe Integer
stoppedAt :: Prelude.Maybe Prelude.Integer,
    -- | The Amazon Resource Name (ARN) of the job.
    JobDetail -> Maybe Text
jobArn :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to propagate the tags from the job or job definition
    -- to the corresponding Amazon ECS task. If no value is specified, the tags
    -- aren\'t propagated. Tags can only be propagated to the tasks during task
    -- creation. For tags with the same name, job tags are given priority over
    -- job definitions tags. If the total number of combined tags from the job
    -- and job definition is over 50, the job is moved to the @FAILED@ state.
    JobDetail -> Maybe Bool
propagateTags :: Prelude.Maybe Prelude.Bool,
    -- | The Unix timestamp (in milliseconds) for when the job was created. For
    -- non-array jobs and parent array jobs, this is when the job entered the
    -- @SUBMITTED@ state (at the time SubmitJob was called). For array child
    -- jobs, this is when the child job was spawned by its parent and entered
    -- the @PENDING@ state.
    JobDetail -> Maybe Integer
createdAt :: Prelude.Maybe Prelude.Integer,
    -- | The retry strategy to use for this job if an attempt fails.
    JobDetail -> Maybe RetryStrategy
retryStrategy :: Prelude.Maybe RetryStrategy,
    -- | A list of job attempts associated with this job.
    JobDetail -> Maybe [AttemptDetail]
attempts :: Prelude.Maybe [AttemptDetail],
    -- | The platform capabilities required by the job definition. If no value is
    -- specified, it defaults to @EC2@. Jobs run on Fargate resources specify
    -- @FARGATE@.
    JobDetail -> Maybe [PlatformCapability]
platformCapabilities :: Prelude.Maybe [PlatformCapability],
    -- | The Unix timestamp (in milliseconds) for when the job was started (when
    -- the job transitioned from the @STARTING@ state to the @RUNNING@ state).
    -- This parameter isn\'t provided for child jobs of array jobs or
    -- multi-node parallel jobs.
    JobDetail -> Maybe Integer
startedAt :: Prelude.Maybe Prelude.Integer,
    -- | A list of job IDs that this job depends on.
    JobDetail -> Maybe [JobDependency]
dependsOn :: Prelude.Maybe [JobDependency],
    -- | An object representing the details of the container that\'s associated
    -- with the job.
    JobDetail -> Maybe ContainerDetail
container :: Prelude.Maybe ContainerDetail,
    -- | An object representing the details of a node that\'s associated with a
    -- multi-node parallel job.
    JobDetail -> Maybe NodeDetails
nodeDetails :: Prelude.Maybe NodeDetails,
    -- | Additional parameters passed to the job that replace parameter
    -- substitution placeholders or override any corresponding parameter
    -- defaults from the job definition.
    JobDetail -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A short, human-readable string to provide additional details about the
    -- current status of the job.
    JobDetail -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | The array properties of the job, if it is an array job.
    JobDetail -> Maybe ArrayPropertiesDetail
arrayProperties :: Prelude.Maybe ArrayPropertiesDetail,
    -- | The timeout configuration for the job.
    JobDetail -> Maybe JobTimeout
timeout :: Prelude.Maybe JobTimeout,
    -- | An object representing the node properties of a multi-node parallel job.
    --
    -- This isn\'t applicable to jobs that are running on Fargate resources.
    JobDetail -> Maybe NodeProperties
nodeProperties :: Prelude.Maybe NodeProperties,
    -- | The tags applied to the job.
    JobDetail -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the job.
    JobDetail -> Text
jobName :: Prelude.Text,
    -- | The ID for the job.
    JobDetail -> Text
jobId :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the job queue that the job is
    -- associated with.
    JobDetail -> Text
jobQueue :: Prelude.Text,
    -- | The current status for the job.
    --
    -- If your jobs don\'t progress to @STARTING@, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#job_stuck_in_runnable Jobs Stuck in RUNNABLE Status>
    -- in the troubleshooting section of the /Batch User Guide/.
    JobDetail -> JobStatus
status :: JobStatus,
    -- | The job definition that\'s used by this job.
    JobDetail -> Text
jobDefinition :: Prelude.Text
  }
  deriving (JobDetail -> JobDetail -> Bool
(JobDetail -> JobDetail -> Bool)
-> (JobDetail -> JobDetail -> Bool) -> Eq JobDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobDetail -> JobDetail -> Bool
$c/= :: JobDetail -> JobDetail -> Bool
== :: JobDetail -> JobDetail -> Bool
$c== :: JobDetail -> JobDetail -> Bool
Prelude.Eq, ReadPrec [JobDetail]
ReadPrec JobDetail
Int -> ReadS JobDetail
ReadS [JobDetail]
(Int -> ReadS JobDetail)
-> ReadS [JobDetail]
-> ReadPrec JobDetail
-> ReadPrec [JobDetail]
-> Read JobDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobDetail]
$creadListPrec :: ReadPrec [JobDetail]
readPrec :: ReadPrec JobDetail
$creadPrec :: ReadPrec JobDetail
readList :: ReadS [JobDetail]
$creadList :: ReadS [JobDetail]
readsPrec :: Int -> ReadS JobDetail
$creadsPrec :: Int -> ReadS JobDetail
Prelude.Read, Int -> JobDetail -> ShowS
[JobDetail] -> ShowS
JobDetail -> String
(Int -> JobDetail -> ShowS)
-> (JobDetail -> String)
-> ([JobDetail] -> ShowS)
-> Show JobDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobDetail] -> ShowS
$cshowList :: [JobDetail] -> ShowS
show :: JobDetail -> String
$cshow :: JobDetail -> String
showsPrec :: Int -> JobDetail -> ShowS
$cshowsPrec :: Int -> JobDetail -> ShowS
Prelude.Show, (forall x. JobDetail -> Rep JobDetail x)
-> (forall x. Rep JobDetail x -> JobDetail) -> Generic JobDetail
forall x. Rep JobDetail x -> JobDetail
forall x. JobDetail -> Rep JobDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobDetail x -> JobDetail
$cfrom :: forall x. JobDetail -> Rep JobDetail x
Prelude.Generic)

-- |
-- Create a value of 'JobDetail' 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:
--
-- 'stoppedAt', 'jobDetail_stoppedAt' - The Unix timestamp (in milliseconds) for when the job was stopped (when
-- the job transitioned from the @RUNNING@ state to a terminal state, such
-- as @SUCCEEDED@ or @FAILED@).
--
-- 'jobArn', 'jobDetail_jobArn' - The Amazon Resource Name (ARN) of the job.
--
-- 'propagateTags', 'jobDetail_propagateTags' - Specifies whether to propagate the tags from the job or job definition
-- to the corresponding Amazon ECS task. If no value is specified, the tags
-- aren\'t propagated. Tags can only be propagated to the tasks during task
-- creation. For tags with the same name, job tags are given priority over
-- job definitions tags. If the total number of combined tags from the job
-- and job definition is over 50, the job is moved to the @FAILED@ state.
--
-- 'createdAt', 'jobDetail_createdAt' - The Unix timestamp (in milliseconds) for when the job was created. For
-- non-array jobs and parent array jobs, this is when the job entered the
-- @SUBMITTED@ state (at the time SubmitJob was called). For array child
-- jobs, this is when the child job was spawned by its parent and entered
-- the @PENDING@ state.
--
-- 'retryStrategy', 'jobDetail_retryStrategy' - The retry strategy to use for this job if an attempt fails.
--
-- 'attempts', 'jobDetail_attempts' - A list of job attempts associated with this job.
--
-- 'platformCapabilities', 'jobDetail_platformCapabilities' - The platform capabilities required by the job definition. If no value is
-- specified, it defaults to @EC2@. Jobs run on Fargate resources specify
-- @FARGATE@.
--
-- 'startedAt', 'jobDetail_startedAt' - The Unix timestamp (in milliseconds) for when the job was started (when
-- the job transitioned from the @STARTING@ state to the @RUNNING@ state).
-- This parameter isn\'t provided for child jobs of array jobs or
-- multi-node parallel jobs.
--
-- 'dependsOn', 'jobDetail_dependsOn' - A list of job IDs that this job depends on.
--
-- 'container', 'jobDetail_container' - An object representing the details of the container that\'s associated
-- with the job.
--
-- 'nodeDetails', 'jobDetail_nodeDetails' - An object representing the details of a node that\'s associated with a
-- multi-node parallel job.
--
-- 'parameters', 'jobDetail_parameters' - Additional parameters passed to the job that replace parameter
-- substitution placeholders or override any corresponding parameter
-- defaults from the job definition.
--
-- 'statusReason', 'jobDetail_statusReason' - A short, human-readable string to provide additional details about the
-- current status of the job.
--
-- 'arrayProperties', 'jobDetail_arrayProperties' - The array properties of the job, if it is an array job.
--
-- 'timeout', 'jobDetail_timeout' - The timeout configuration for the job.
--
-- 'nodeProperties', 'jobDetail_nodeProperties' - An object representing the node properties of a multi-node parallel job.
--
-- This isn\'t applicable to jobs that are running on Fargate resources.
--
-- 'tags', 'jobDetail_tags' - The tags applied to the job.
--
-- 'jobName', 'jobDetail_jobName' - The name of the job.
--
-- 'jobId', 'jobDetail_jobId' - The ID for the job.
--
-- 'jobQueue', 'jobDetail_jobQueue' - The Amazon Resource Name (ARN) of the job queue that the job is
-- associated with.
--
-- 'status', 'jobDetail_status' - The current status for the job.
--
-- If your jobs don\'t progress to @STARTING@, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#job_stuck_in_runnable Jobs Stuck in RUNNABLE Status>
-- in the troubleshooting section of the /Batch User Guide/.
--
-- 'jobDefinition', 'jobDetail_jobDefinition' - The job definition that\'s used by this job.
newJobDetail ::
  -- | 'jobName'
  Prelude.Text ->
  -- | 'jobId'
  Prelude.Text ->
  -- | 'jobQueue'
  Prelude.Text ->
  -- | 'status'
  JobStatus ->
  -- | 'jobDefinition'
  Prelude.Text ->
  JobDetail
newJobDetail :: Text -> Text -> Text -> JobStatus -> Text -> JobDetail
newJobDetail
  Text
pJobName_
  Text
pJobId_
  Text
pJobQueue_
  JobStatus
pStatus_
  Text
pJobDefinition_ =
    JobDetail' :: Maybe Integer
-> Maybe Text
-> Maybe Bool
-> Maybe Integer
-> Maybe RetryStrategy
-> Maybe [AttemptDetail]
-> Maybe [PlatformCapability]
-> Maybe Integer
-> Maybe [JobDependency]
-> Maybe ContainerDetail
-> Maybe NodeDetails
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe ArrayPropertiesDetail
-> Maybe JobTimeout
-> Maybe NodeProperties
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> JobStatus
-> Text
-> JobDetail
JobDetail'
      { $sel:stoppedAt:JobDetail' :: Maybe Integer
stoppedAt = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
        $sel:jobArn:JobDetail' :: Maybe Text
jobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:propagateTags:JobDetail' :: Maybe Bool
propagateTags = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:createdAt:JobDetail' :: Maybe Integer
createdAt = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
        $sel:retryStrategy:JobDetail' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
forall a. Maybe a
Prelude.Nothing,
        $sel:attempts:JobDetail' :: Maybe [AttemptDetail]
attempts = Maybe [AttemptDetail]
forall a. Maybe a
Prelude.Nothing,
        $sel:platformCapabilities:JobDetail' :: Maybe [PlatformCapability]
platformCapabilities = Maybe [PlatformCapability]
forall a. Maybe a
Prelude.Nothing,
        $sel:startedAt:JobDetail' :: Maybe Integer
startedAt = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
        $sel:dependsOn:JobDetail' :: Maybe [JobDependency]
dependsOn = Maybe [JobDependency]
forall a. Maybe a
Prelude.Nothing,
        $sel:container:JobDetail' :: Maybe ContainerDetail
container = Maybe ContainerDetail
forall a. Maybe a
Prelude.Nothing,
        $sel:nodeDetails:JobDetail' :: Maybe NodeDetails
nodeDetails = Maybe NodeDetails
forall a. Maybe a
Prelude.Nothing,
        $sel:parameters:JobDetail' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:statusReason:JobDetail' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:arrayProperties:JobDetail' :: Maybe ArrayPropertiesDetail
arrayProperties = Maybe ArrayPropertiesDetail
forall a. Maybe a
Prelude.Nothing,
        $sel:timeout:JobDetail' :: Maybe JobTimeout
timeout = Maybe JobTimeout
forall a. Maybe a
Prelude.Nothing,
        $sel:nodeProperties:JobDetail' :: Maybe NodeProperties
nodeProperties = Maybe NodeProperties
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:JobDetail' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:jobName:JobDetail' :: Text
jobName = Text
pJobName_,
        $sel:jobId:JobDetail' :: Text
jobId = Text
pJobId_,
        $sel:jobQueue:JobDetail' :: Text
jobQueue = Text
pJobQueue_,
        $sel:status:JobDetail' :: JobStatus
status = JobStatus
pStatus_,
        $sel:jobDefinition:JobDetail' :: Text
jobDefinition = Text
pJobDefinition_
      }

-- | The Unix timestamp (in milliseconds) for when the job was stopped (when
-- the job transitioned from the @RUNNING@ state to a terminal state, such
-- as @SUCCEEDED@ or @FAILED@).
jobDetail_stoppedAt :: Lens.Lens' JobDetail (Prelude.Maybe Prelude.Integer)
jobDetail_stoppedAt :: (Maybe Integer -> f (Maybe Integer)) -> JobDetail -> f JobDetail
jobDetail_stoppedAt = (JobDetail -> Maybe Integer)
-> (JobDetail -> Maybe Integer -> JobDetail)
-> Lens JobDetail JobDetail (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe Integer
stoppedAt :: Maybe Integer
$sel:stoppedAt:JobDetail' :: JobDetail -> Maybe Integer
stoppedAt} -> Maybe Integer
stoppedAt) (\s :: JobDetail
s@JobDetail' {} Maybe Integer
a -> JobDetail
s {$sel:stoppedAt:JobDetail' :: Maybe Integer
stoppedAt = Maybe Integer
a} :: JobDetail)

-- | The Amazon Resource Name (ARN) of the job.
jobDetail_jobArn :: Lens.Lens' JobDetail (Prelude.Maybe Prelude.Text)
jobDetail_jobArn :: (Maybe Text -> f (Maybe Text)) -> JobDetail -> f JobDetail
jobDetail_jobArn = (JobDetail -> Maybe Text)
-> (JobDetail -> Maybe Text -> JobDetail)
-> Lens JobDetail JobDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe Text
jobArn :: Maybe Text
$sel:jobArn:JobDetail' :: JobDetail -> Maybe Text
jobArn} -> Maybe Text
jobArn) (\s :: JobDetail
s@JobDetail' {} Maybe Text
a -> JobDetail
s {$sel:jobArn:JobDetail' :: Maybe Text
jobArn = Maybe Text
a} :: JobDetail)

-- | Specifies whether to propagate the tags from the job or job definition
-- to the corresponding Amazon ECS task. If no value is specified, the tags
-- aren\'t propagated. Tags can only be propagated to the tasks during task
-- creation. For tags with the same name, job tags are given priority over
-- job definitions tags. If the total number of combined tags from the job
-- and job definition is over 50, the job is moved to the @FAILED@ state.
jobDetail_propagateTags :: Lens.Lens' JobDetail (Prelude.Maybe Prelude.Bool)
jobDetail_propagateTags :: (Maybe Bool -> f (Maybe Bool)) -> JobDetail -> f JobDetail
jobDetail_propagateTags = (JobDetail -> Maybe Bool)
-> (JobDetail -> Maybe Bool -> JobDetail)
-> Lens JobDetail JobDetail (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe Bool
propagateTags :: Maybe Bool
$sel:propagateTags:JobDetail' :: JobDetail -> Maybe Bool
propagateTags} -> Maybe Bool
propagateTags) (\s :: JobDetail
s@JobDetail' {} Maybe Bool
a -> JobDetail
s {$sel:propagateTags:JobDetail' :: Maybe Bool
propagateTags = Maybe Bool
a} :: JobDetail)

-- | The Unix timestamp (in milliseconds) for when the job was created. For
-- non-array jobs and parent array jobs, this is when the job entered the
-- @SUBMITTED@ state (at the time SubmitJob was called). For array child
-- jobs, this is when the child job was spawned by its parent and entered
-- the @PENDING@ state.
jobDetail_createdAt :: Lens.Lens' JobDetail (Prelude.Maybe Prelude.Integer)
jobDetail_createdAt :: (Maybe Integer -> f (Maybe Integer)) -> JobDetail -> f JobDetail
jobDetail_createdAt = (JobDetail -> Maybe Integer)
-> (JobDetail -> Maybe Integer -> JobDetail)
-> Lens JobDetail JobDetail (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe Integer
createdAt :: Maybe Integer
$sel:createdAt:JobDetail' :: JobDetail -> Maybe Integer
createdAt} -> Maybe Integer
createdAt) (\s :: JobDetail
s@JobDetail' {} Maybe Integer
a -> JobDetail
s {$sel:createdAt:JobDetail' :: Maybe Integer
createdAt = Maybe Integer
a} :: JobDetail)

-- | The retry strategy to use for this job if an attempt fails.
jobDetail_retryStrategy :: Lens.Lens' JobDetail (Prelude.Maybe RetryStrategy)
jobDetail_retryStrategy :: (Maybe RetryStrategy -> f (Maybe RetryStrategy))
-> JobDetail -> f JobDetail
jobDetail_retryStrategy = (JobDetail -> Maybe RetryStrategy)
-> (JobDetail -> Maybe RetryStrategy -> JobDetail)
-> Lens
     JobDetail JobDetail (Maybe RetryStrategy) (Maybe RetryStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe RetryStrategy
retryStrategy :: Maybe RetryStrategy
$sel:retryStrategy:JobDetail' :: JobDetail -> Maybe RetryStrategy
retryStrategy} -> Maybe RetryStrategy
retryStrategy) (\s :: JobDetail
s@JobDetail' {} Maybe RetryStrategy
a -> JobDetail
s {$sel:retryStrategy:JobDetail' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
a} :: JobDetail)

-- | A list of job attempts associated with this job.
jobDetail_attempts :: Lens.Lens' JobDetail (Prelude.Maybe [AttemptDetail])
jobDetail_attempts :: (Maybe [AttemptDetail] -> f (Maybe [AttemptDetail]))
-> JobDetail -> f JobDetail
jobDetail_attempts = (JobDetail -> Maybe [AttemptDetail])
-> (JobDetail -> Maybe [AttemptDetail] -> JobDetail)
-> Lens
     JobDetail JobDetail (Maybe [AttemptDetail]) (Maybe [AttemptDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe [AttemptDetail]
attempts :: Maybe [AttemptDetail]
$sel:attempts:JobDetail' :: JobDetail -> Maybe [AttemptDetail]
attempts} -> Maybe [AttemptDetail]
attempts) (\s :: JobDetail
s@JobDetail' {} Maybe [AttemptDetail]
a -> JobDetail
s {$sel:attempts:JobDetail' :: Maybe [AttemptDetail]
attempts = Maybe [AttemptDetail]
a} :: JobDetail) ((Maybe [AttemptDetail] -> f (Maybe [AttemptDetail]))
 -> JobDetail -> f JobDetail)
-> ((Maybe [AttemptDetail] -> f (Maybe [AttemptDetail]))
    -> Maybe [AttemptDetail] -> f (Maybe [AttemptDetail]))
-> (Maybe [AttemptDetail] -> f (Maybe [AttemptDetail]))
-> JobDetail
-> f JobDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AttemptDetail] [AttemptDetail] [AttemptDetail] [AttemptDetail]
-> Iso
     (Maybe [AttemptDetail])
     (Maybe [AttemptDetail])
     (Maybe [AttemptDetail])
     (Maybe [AttemptDetail])
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
  [AttemptDetail] [AttemptDetail] [AttemptDetail] [AttemptDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The platform capabilities required by the job definition. If no value is
-- specified, it defaults to @EC2@. Jobs run on Fargate resources specify
-- @FARGATE@.
jobDetail_platformCapabilities :: Lens.Lens' JobDetail (Prelude.Maybe [PlatformCapability])
jobDetail_platformCapabilities :: (Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> JobDetail -> f JobDetail
jobDetail_platformCapabilities = (JobDetail -> Maybe [PlatformCapability])
-> (JobDetail -> Maybe [PlatformCapability] -> JobDetail)
-> Lens
     JobDetail
     JobDetail
     (Maybe [PlatformCapability])
     (Maybe [PlatformCapability])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe [PlatformCapability]
platformCapabilities :: Maybe [PlatformCapability]
$sel:platformCapabilities:JobDetail' :: JobDetail -> Maybe [PlatformCapability]
platformCapabilities} -> Maybe [PlatformCapability]
platformCapabilities) (\s :: JobDetail
s@JobDetail' {} Maybe [PlatformCapability]
a -> JobDetail
s {$sel:platformCapabilities:JobDetail' :: Maybe [PlatformCapability]
platformCapabilities = Maybe [PlatformCapability]
a} :: JobDetail) ((Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
 -> JobDetail -> f JobDetail)
-> ((Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
    -> Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> (Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> JobDetail
-> f JobDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlatformCapability]
  [PlatformCapability]
  [PlatformCapability]
  [PlatformCapability]
-> Iso
     (Maybe [PlatformCapability])
     (Maybe [PlatformCapability])
     (Maybe [PlatformCapability])
     (Maybe [PlatformCapability])
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
  [PlatformCapability]
  [PlatformCapability]
  [PlatformCapability]
  [PlatformCapability]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Unix timestamp (in milliseconds) for when the job was started (when
-- the job transitioned from the @STARTING@ state to the @RUNNING@ state).
-- This parameter isn\'t provided for child jobs of array jobs or
-- multi-node parallel jobs.
jobDetail_startedAt :: Lens.Lens' JobDetail (Prelude.Maybe Prelude.Integer)
jobDetail_startedAt :: (Maybe Integer -> f (Maybe Integer)) -> JobDetail -> f JobDetail
jobDetail_startedAt = (JobDetail -> Maybe Integer)
-> (JobDetail -> Maybe Integer -> JobDetail)
-> Lens JobDetail JobDetail (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe Integer
startedAt :: Maybe Integer
$sel:startedAt:JobDetail' :: JobDetail -> Maybe Integer
startedAt} -> Maybe Integer
startedAt) (\s :: JobDetail
s@JobDetail' {} Maybe Integer
a -> JobDetail
s {$sel:startedAt:JobDetail' :: Maybe Integer
startedAt = Maybe Integer
a} :: JobDetail)

-- | A list of job IDs that this job depends on.
jobDetail_dependsOn :: Lens.Lens' JobDetail (Prelude.Maybe [JobDependency])
jobDetail_dependsOn :: (Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> JobDetail -> f JobDetail
jobDetail_dependsOn = (JobDetail -> Maybe [JobDependency])
-> (JobDetail -> Maybe [JobDependency] -> JobDetail)
-> Lens
     JobDetail JobDetail (Maybe [JobDependency]) (Maybe [JobDependency])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe [JobDependency]
dependsOn :: Maybe [JobDependency]
$sel:dependsOn:JobDetail' :: JobDetail -> Maybe [JobDependency]
dependsOn} -> Maybe [JobDependency]
dependsOn) (\s :: JobDetail
s@JobDetail' {} Maybe [JobDependency]
a -> JobDetail
s {$sel:dependsOn:JobDetail' :: Maybe [JobDependency]
dependsOn = Maybe [JobDependency]
a} :: JobDetail) ((Maybe [JobDependency] -> f (Maybe [JobDependency]))
 -> JobDetail -> f JobDetail)
-> ((Maybe [JobDependency] -> f (Maybe [JobDependency]))
    -> Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> (Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> JobDetail
-> f JobDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [JobDependency] [JobDependency] [JobDependency] [JobDependency]
-> Iso
     (Maybe [JobDependency])
     (Maybe [JobDependency])
     (Maybe [JobDependency])
     (Maybe [JobDependency])
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
  [JobDependency] [JobDependency] [JobDependency] [JobDependency]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An object representing the details of the container that\'s associated
-- with the job.
jobDetail_container :: Lens.Lens' JobDetail (Prelude.Maybe ContainerDetail)
jobDetail_container :: (Maybe ContainerDetail -> f (Maybe ContainerDetail))
-> JobDetail -> f JobDetail
jobDetail_container = (JobDetail -> Maybe ContainerDetail)
-> (JobDetail -> Maybe ContainerDetail -> JobDetail)
-> Lens
     JobDetail JobDetail (Maybe ContainerDetail) (Maybe ContainerDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe ContainerDetail
container :: Maybe ContainerDetail
$sel:container:JobDetail' :: JobDetail -> Maybe ContainerDetail
container} -> Maybe ContainerDetail
container) (\s :: JobDetail
s@JobDetail' {} Maybe ContainerDetail
a -> JobDetail
s {$sel:container:JobDetail' :: Maybe ContainerDetail
container = Maybe ContainerDetail
a} :: JobDetail)

-- | An object representing the details of a node that\'s associated with a
-- multi-node parallel job.
jobDetail_nodeDetails :: Lens.Lens' JobDetail (Prelude.Maybe NodeDetails)
jobDetail_nodeDetails :: (Maybe NodeDetails -> f (Maybe NodeDetails))
-> JobDetail -> f JobDetail
jobDetail_nodeDetails = (JobDetail -> Maybe NodeDetails)
-> (JobDetail -> Maybe NodeDetails -> JobDetail)
-> Lens JobDetail JobDetail (Maybe NodeDetails) (Maybe NodeDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe NodeDetails
nodeDetails :: Maybe NodeDetails
$sel:nodeDetails:JobDetail' :: JobDetail -> Maybe NodeDetails
nodeDetails} -> Maybe NodeDetails
nodeDetails) (\s :: JobDetail
s@JobDetail' {} Maybe NodeDetails
a -> JobDetail
s {$sel:nodeDetails:JobDetail' :: Maybe NodeDetails
nodeDetails = Maybe NodeDetails
a} :: JobDetail)

-- | Additional parameters passed to the job that replace parameter
-- substitution placeholders or override any corresponding parameter
-- defaults from the job definition.
jobDetail_parameters :: Lens.Lens' JobDetail (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
jobDetail_parameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> JobDetail -> f JobDetail
jobDetail_parameters = (JobDetail -> Maybe (HashMap Text Text))
-> (JobDetail -> Maybe (HashMap Text Text) -> JobDetail)
-> Lens
     JobDetail
     JobDetail
     (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 (\JobDetail' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:JobDetail' :: JobDetail -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: JobDetail
s@JobDetail' {} Maybe (HashMap Text Text)
a -> JobDetail
s {$sel:parameters:JobDetail' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: JobDetail) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> JobDetail -> f JobDetail)
-> ((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)))
-> JobDetail
-> f JobDetail
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

-- | A short, human-readable string to provide additional details about the
-- current status of the job.
jobDetail_statusReason :: Lens.Lens' JobDetail (Prelude.Maybe Prelude.Text)
jobDetail_statusReason :: (Maybe Text -> f (Maybe Text)) -> JobDetail -> f JobDetail
jobDetail_statusReason = (JobDetail -> Maybe Text)
-> (JobDetail -> Maybe Text -> JobDetail)
-> Lens JobDetail JobDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:JobDetail' :: JobDetail -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: JobDetail
s@JobDetail' {} Maybe Text
a -> JobDetail
s {$sel:statusReason:JobDetail' :: Maybe Text
statusReason = Maybe Text
a} :: JobDetail)

-- | The array properties of the job, if it is an array job.
jobDetail_arrayProperties :: Lens.Lens' JobDetail (Prelude.Maybe ArrayPropertiesDetail)
jobDetail_arrayProperties :: (Maybe ArrayPropertiesDetail -> f (Maybe ArrayPropertiesDetail))
-> JobDetail -> f JobDetail
jobDetail_arrayProperties = (JobDetail -> Maybe ArrayPropertiesDetail)
-> (JobDetail -> Maybe ArrayPropertiesDetail -> JobDetail)
-> Lens
     JobDetail
     JobDetail
     (Maybe ArrayPropertiesDetail)
     (Maybe ArrayPropertiesDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe ArrayPropertiesDetail
arrayProperties :: Maybe ArrayPropertiesDetail
$sel:arrayProperties:JobDetail' :: JobDetail -> Maybe ArrayPropertiesDetail
arrayProperties} -> Maybe ArrayPropertiesDetail
arrayProperties) (\s :: JobDetail
s@JobDetail' {} Maybe ArrayPropertiesDetail
a -> JobDetail
s {$sel:arrayProperties:JobDetail' :: Maybe ArrayPropertiesDetail
arrayProperties = Maybe ArrayPropertiesDetail
a} :: JobDetail)

-- | The timeout configuration for the job.
jobDetail_timeout :: Lens.Lens' JobDetail (Prelude.Maybe JobTimeout)
jobDetail_timeout :: (Maybe JobTimeout -> f (Maybe JobTimeout))
-> JobDetail -> f JobDetail
jobDetail_timeout = (JobDetail -> Maybe JobTimeout)
-> (JobDetail -> Maybe JobTimeout -> JobDetail)
-> Lens JobDetail JobDetail (Maybe JobTimeout) (Maybe JobTimeout)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe JobTimeout
timeout :: Maybe JobTimeout
$sel:timeout:JobDetail' :: JobDetail -> Maybe JobTimeout
timeout} -> Maybe JobTimeout
timeout) (\s :: JobDetail
s@JobDetail' {} Maybe JobTimeout
a -> JobDetail
s {$sel:timeout:JobDetail' :: Maybe JobTimeout
timeout = Maybe JobTimeout
a} :: JobDetail)

-- | An object representing the node properties of a multi-node parallel job.
--
-- This isn\'t applicable to jobs that are running on Fargate resources.
jobDetail_nodeProperties :: Lens.Lens' JobDetail (Prelude.Maybe NodeProperties)
jobDetail_nodeProperties :: (Maybe NodeProperties -> f (Maybe NodeProperties))
-> JobDetail -> f JobDetail
jobDetail_nodeProperties = (JobDetail -> Maybe NodeProperties)
-> (JobDetail -> Maybe NodeProperties -> JobDetail)
-> Lens
     JobDetail JobDetail (Maybe NodeProperties) (Maybe NodeProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Maybe NodeProperties
nodeProperties :: Maybe NodeProperties
$sel:nodeProperties:JobDetail' :: JobDetail -> Maybe NodeProperties
nodeProperties} -> Maybe NodeProperties
nodeProperties) (\s :: JobDetail
s@JobDetail' {} Maybe NodeProperties
a -> JobDetail
s {$sel:nodeProperties:JobDetail' :: Maybe NodeProperties
nodeProperties = Maybe NodeProperties
a} :: JobDetail)

-- | The tags applied to the job.
jobDetail_tags :: Lens.Lens' JobDetail (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
jobDetail_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> JobDetail -> f JobDetail
jobDetail_tags = (JobDetail -> Maybe (HashMap Text Text))
-> (JobDetail -> Maybe (HashMap Text Text) -> JobDetail)
-> Lens
     JobDetail
     JobDetail
     (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 (\JobDetail' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:JobDetail' :: JobDetail -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: JobDetail
s@JobDetail' {} Maybe (HashMap Text Text)
a -> JobDetail
s {$sel:tags:JobDetail' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: JobDetail) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> JobDetail -> f JobDetail)
-> ((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)))
-> JobDetail
-> f JobDetail
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.
jobDetail_jobName :: Lens.Lens' JobDetail Prelude.Text
jobDetail_jobName :: (Text -> f Text) -> JobDetail -> f JobDetail
jobDetail_jobName = (JobDetail -> Text)
-> (JobDetail -> Text -> JobDetail)
-> Lens JobDetail JobDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Text
jobName :: Text
$sel:jobName:JobDetail' :: JobDetail -> Text
jobName} -> Text
jobName) (\s :: JobDetail
s@JobDetail' {} Text
a -> JobDetail
s {$sel:jobName:JobDetail' :: Text
jobName = Text
a} :: JobDetail)

-- | The ID for the job.
jobDetail_jobId :: Lens.Lens' JobDetail Prelude.Text
jobDetail_jobId :: (Text -> f Text) -> JobDetail -> f JobDetail
jobDetail_jobId = (JobDetail -> Text)
-> (JobDetail -> Text -> JobDetail)
-> Lens JobDetail JobDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Text
jobId :: Text
$sel:jobId:JobDetail' :: JobDetail -> Text
jobId} -> Text
jobId) (\s :: JobDetail
s@JobDetail' {} Text
a -> JobDetail
s {$sel:jobId:JobDetail' :: Text
jobId = Text
a} :: JobDetail)

-- | The Amazon Resource Name (ARN) of the job queue that the job is
-- associated with.
jobDetail_jobQueue :: Lens.Lens' JobDetail Prelude.Text
jobDetail_jobQueue :: (Text -> f Text) -> JobDetail -> f JobDetail
jobDetail_jobQueue = (JobDetail -> Text)
-> (JobDetail -> Text -> JobDetail)
-> Lens JobDetail JobDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Text
jobQueue :: Text
$sel:jobQueue:JobDetail' :: JobDetail -> Text
jobQueue} -> Text
jobQueue) (\s :: JobDetail
s@JobDetail' {} Text
a -> JobDetail
s {$sel:jobQueue:JobDetail' :: Text
jobQueue = Text
a} :: JobDetail)

-- | The current status for the job.
--
-- If your jobs don\'t progress to @STARTING@, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#job_stuck_in_runnable Jobs Stuck in RUNNABLE Status>
-- in the troubleshooting section of the /Batch User Guide/.
jobDetail_status :: Lens.Lens' JobDetail JobStatus
jobDetail_status :: (JobStatus -> f JobStatus) -> JobDetail -> f JobDetail
jobDetail_status = (JobDetail -> JobStatus)
-> (JobDetail -> JobStatus -> JobDetail)
-> Lens JobDetail JobDetail JobStatus JobStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {JobStatus
status :: JobStatus
$sel:status:JobDetail' :: JobDetail -> JobStatus
status} -> JobStatus
status) (\s :: JobDetail
s@JobDetail' {} JobStatus
a -> JobDetail
s {$sel:status:JobDetail' :: JobStatus
status = JobStatus
a} :: JobDetail)

-- | The job definition that\'s used by this job.
jobDetail_jobDefinition :: Lens.Lens' JobDetail Prelude.Text
jobDetail_jobDefinition :: (Text -> f Text) -> JobDetail -> f JobDetail
jobDetail_jobDefinition = (JobDetail -> Text)
-> (JobDetail -> Text -> JobDetail)
-> Lens JobDetail JobDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobDetail' {Text
jobDefinition :: Text
$sel:jobDefinition:JobDetail' :: JobDetail -> Text
jobDefinition} -> Text
jobDefinition) (\s :: JobDetail
s@JobDetail' {} Text
a -> JobDetail
s {$sel:jobDefinition:JobDetail' :: Text
jobDefinition = Text
a} :: JobDetail)

instance Core.FromJSON JobDetail where
  parseJSON :: Value -> Parser JobDetail
parseJSON =
    String -> (Object -> Parser JobDetail) -> Value -> Parser JobDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"JobDetail"
      ( \Object
x ->
          Maybe Integer
-> Maybe Text
-> Maybe Bool
-> Maybe Integer
-> Maybe RetryStrategy
-> Maybe [AttemptDetail]
-> Maybe [PlatformCapability]
-> Maybe Integer
-> Maybe [JobDependency]
-> Maybe ContainerDetail
-> Maybe NodeDetails
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe ArrayPropertiesDetail
-> Maybe JobTimeout
-> Maybe NodeProperties
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> JobStatus
-> Text
-> JobDetail
JobDetail'
            (Maybe Integer
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Integer
 -> Maybe RetryStrategy
 -> Maybe [AttemptDetail]
 -> Maybe [PlatformCapability]
 -> Maybe Integer
 -> Maybe [JobDependency]
 -> Maybe ContainerDetail
 -> Maybe NodeDetails
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Maybe ArrayPropertiesDetail
 -> Maybe JobTimeout
 -> Maybe NodeProperties
 -> Maybe (HashMap Text Text)
 -> Text
 -> Text
 -> Text
 -> JobStatus
 -> Text
 -> JobDetail)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Integer
      -> Maybe RetryStrategy
      -> Maybe [AttemptDetail]
      -> Maybe [PlatformCapability]
      -> Maybe Integer
      -> Maybe [JobDependency]
      -> Maybe ContainerDetail
      -> Maybe NodeDetails
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stoppedAt")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Integer
   -> Maybe RetryStrategy
   -> Maybe [AttemptDetail]
   -> Maybe [PlatformCapability]
   -> Maybe Integer
   -> Maybe [JobDependency]
   -> Maybe ContainerDetail
   -> Maybe NodeDetails
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Integer
      -> Maybe RetryStrategy
      -> Maybe [AttemptDetail]
      -> Maybe [PlatformCapability]
      -> Maybe Integer
      -> Maybe [JobDependency]
      -> Maybe ContainerDetail
      -> Maybe NodeDetails
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
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
"jobArn")
            Parser
  (Maybe Bool
   -> Maybe Integer
   -> Maybe RetryStrategy
   -> Maybe [AttemptDetail]
   -> Maybe [PlatformCapability]
   -> Maybe Integer
   -> Maybe [JobDependency]
   -> Maybe ContainerDetail
   -> Maybe NodeDetails
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Integer
      -> Maybe RetryStrategy
      -> Maybe [AttemptDetail]
      -> Maybe [PlatformCapability]
      -> Maybe Integer
      -> Maybe [JobDependency]
      -> Maybe ContainerDetail
      -> Maybe NodeDetails
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
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
"propagateTags")
            Parser
  (Maybe Integer
   -> Maybe RetryStrategy
   -> Maybe [AttemptDetail]
   -> Maybe [PlatformCapability]
   -> Maybe Integer
   -> Maybe [JobDependency]
   -> Maybe ContainerDetail
   -> Maybe NodeDetails
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe Integer)
-> Parser
     (Maybe RetryStrategy
      -> Maybe [AttemptDetail]
      -> Maybe [PlatformCapability]
      -> Maybe Integer
      -> Maybe [JobDependency]
      -> Maybe ContainerDetail
      -> Maybe NodeDetails
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
            Parser
  (Maybe RetryStrategy
   -> Maybe [AttemptDetail]
   -> Maybe [PlatformCapability]
   -> Maybe Integer
   -> Maybe [JobDependency]
   -> Maybe ContainerDetail
   -> Maybe NodeDetails
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe RetryStrategy)
-> Parser
     (Maybe [AttemptDetail]
      -> Maybe [PlatformCapability]
      -> Maybe Integer
      -> Maybe [JobDependency]
      -> Maybe ContainerDetail
      -> Maybe NodeDetails
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RetryStrategy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"retryStrategy")
            Parser
  (Maybe [AttemptDetail]
   -> Maybe [PlatformCapability]
   -> Maybe Integer
   -> Maybe [JobDependency]
   -> Maybe ContainerDetail
   -> Maybe NodeDetails
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe [AttemptDetail])
-> Parser
     (Maybe [PlatformCapability]
      -> Maybe Integer
      -> Maybe [JobDependency]
      -> Maybe ContainerDetail
      -> Maybe NodeDetails
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [AttemptDetail]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attempts" Parser (Maybe (Maybe [AttemptDetail]))
-> Maybe [AttemptDetail] -> Parser (Maybe [AttemptDetail])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AttemptDetail]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [PlatformCapability]
   -> Maybe Integer
   -> Maybe [JobDependency]
   -> Maybe ContainerDetail
   -> Maybe NodeDetails
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe [PlatformCapability])
-> Parser
     (Maybe Integer
      -> Maybe [JobDependency]
      -> Maybe ContainerDetail
      -> Maybe NodeDetails
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PlatformCapability]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"platformCapabilities"
                            Parser (Maybe (Maybe [PlatformCapability]))
-> Maybe [PlatformCapability]
-> Parser (Maybe [PlatformCapability])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PlatformCapability]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Integer
   -> Maybe [JobDependency]
   -> Maybe ContainerDetail
   -> Maybe NodeDetails
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe Integer)
-> Parser
     (Maybe [JobDependency]
      -> Maybe ContainerDetail
      -> Maybe NodeDetails
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"startedAt")
            Parser
  (Maybe [JobDependency]
   -> Maybe ContainerDetail
   -> Maybe NodeDetails
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe [JobDependency])
-> Parser
     (Maybe ContainerDetail
      -> Maybe NodeDetails
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [JobDependency]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dependsOn" Parser (Maybe (Maybe [JobDependency]))
-> Maybe [JobDependency] -> Parser (Maybe [JobDependency])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [JobDependency]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe ContainerDetail
   -> Maybe NodeDetails
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe ContainerDetail)
-> Parser
     (Maybe NodeDetails
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ContainerDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"container")
            Parser
  (Maybe NodeDetails
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe NodeDetails)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NodeDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"nodeDetails")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe Text
   -> Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Text
      -> Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
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
"parameters" 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 ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe ArrayPropertiesDetail
      -> Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
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
"statusReason")
            Parser
  (Maybe ArrayPropertiesDetail
   -> Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe ArrayPropertiesDetail)
-> Parser
     (Maybe JobTimeout
      -> Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ArrayPropertiesDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arrayProperties")
            Parser
  (Maybe JobTimeout
   -> Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe JobTimeout)
-> Parser
     (Maybe NodeProperties
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> JobStatus
      -> Text
      -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobTimeout)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"timeout")
            Parser
  (Maybe NodeProperties
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> JobStatus
   -> Text
   -> JobDetail)
-> Parser (Maybe NodeProperties)
-> Parser
     (Maybe (HashMap Text Text)
      -> Text -> Text -> Text -> JobStatus -> Text -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NodeProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"nodeProperties")
            Parser
  (Maybe (HashMap Text Text)
   -> Text -> Text -> Text -> JobStatus -> Text -> JobDetail)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> Text -> Text -> JobStatus -> Text -> JobDetail)
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
"tags" 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 (Text -> Text -> Text -> JobStatus -> Text -> JobDetail)
-> Parser Text
-> Parser (Text -> Text -> JobStatus -> Text -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"jobName")
            Parser (Text -> Text -> JobStatus -> Text -> JobDetail)
-> Parser Text -> Parser (Text -> JobStatus -> Text -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"jobId")
            Parser (Text -> JobStatus -> Text -> JobDetail)
-> Parser Text -> Parser (JobStatus -> Text -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"jobQueue")
            Parser (JobStatus -> Text -> JobDetail)
-> Parser JobStatus -> Parser (Text -> JobDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser JobStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
            Parser (Text -> JobDetail) -> Parser Text -> Parser JobDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"jobDefinition")
      )

instance Prelude.Hashable JobDetail

instance Prelude.NFData JobDetail