{-# 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.IoT.Types.Job
-- 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.IoT.Types.Job where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.AbortConfig
import Amazonka.IoT.Types.JobExecutionsRolloutConfig
import Amazonka.IoT.Types.JobProcessDetails
import Amazonka.IoT.Types.JobStatus
import Amazonka.IoT.Types.PresignedUrlConfig
import Amazonka.IoT.Types.TargetSelection
import Amazonka.IoT.Types.TimeoutConfig
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The @Job@ object contains details about a job.
--
-- /See:/ 'newJob' smart constructor.
data Job = Job'
  { -- | The status of the job, one of @IN_PROGRESS@, @CANCELED@,
    -- @DELETION_IN_PROGRESS@ or @COMPLETED@.
    Job -> Maybe JobStatus
status :: Prelude.Maybe JobStatus,
    -- | Allows you to create a staged rollout of a job.
    Job -> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig :: Prelude.Maybe JobExecutionsRolloutConfig,
    -- | The unique identifier you assigned to this job when it was created.
    Job -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | The time, in seconds since the epoch, when the job was last updated.
    Job -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
    -- | An ARN identifying the job with format
    -- \"arn:aws:iot:region:account:job\/jobId\".
    Job -> Maybe Text
jobArn :: Prelude.Maybe Prelude.Text,
    -- | The time, in seconds since the epoch, when the job was created.
    Job -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | Configuration for criteria to abort the job.
    Job -> Maybe AbortConfig
abortConfig :: Prelude.Maybe AbortConfig,
    -- | Details about the job process.
    Job -> Maybe JobProcessDetails
jobProcessDetails :: Prelude.Maybe JobProcessDetails,
    -- | The namespace used to indicate that a job is a customer-managed job.
    --
    -- When you specify a value for this parameter, Amazon Web Services IoT
    -- Core sends jobs notifications to MQTT topics that contain the value in
    -- the following format.
    --
    -- @$aws\/things\/THING_NAME\/jobs\/JOB_ID\/notify-namespace-NAMESPACE_ID\/@
    --
    -- The @namespaceId@ feature is in public preview.
    Job -> Maybe Text
namespaceId :: Prelude.Maybe Prelude.Text,
    -- | If the job was updated, provides the reason code for the update.
    Job -> Maybe Text
reasonCode :: Prelude.Maybe Prelude.Text,
    -- | Configuration for pre-signed S3 URLs.
    Job -> Maybe PresignedUrlConfig
presignedUrlConfig :: Prelude.Maybe PresignedUrlConfig,
    -- | Will be @true@ if the job was canceled with the optional @force@
    -- parameter set to @true@.
    Job -> Maybe Bool
forceCanceled :: Prelude.Maybe Prelude.Bool,
    -- | The ARN of the job template used to create the job.
    Job -> Maybe Text
jobTemplateArn :: Prelude.Maybe Prelude.Text,
    -- | A list of IoT things and thing groups to which the job should be sent.
    Job -> Maybe (NonEmpty Text)
targets :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The time, in seconds since the epoch, when the job was completed.
    Job -> Maybe POSIX
completedAt :: Prelude.Maybe Core.POSIX,
    -- | If the job was updated, describes the reason for the update.
    Job -> Maybe Text
comment :: Prelude.Maybe Prelude.Text,
    -- | A short text description of the job.
    Job -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the job will continue to run (CONTINUOUS), or will be
    -- complete after all those things specified as targets have completed the
    -- job (SNAPSHOT). If continuous, the job may also be run on a thing when a
    -- change is detected in a target. For example, a job will run on a device
    -- when the thing representing the device is added to a target group, even
    -- after the job was completed by all things originally in the group.
    Job -> Maybe TargetSelection
targetSelection :: Prelude.Maybe TargetSelection,
    -- | Specifies the amount of time each device has to finish its execution of
    -- the job. A timer is started when the job execution status is set to
    -- @IN_PROGRESS@. If the job execution status is not set to another
    -- terminal state before the timer expires, it will be automatically set to
    -- @TIMED_OUT@.
    Job -> Maybe TimeoutConfig
timeoutConfig :: Prelude.Maybe TimeoutConfig
  }
  deriving (Job -> Job -> Bool
(Job -> Job -> Bool) -> (Job -> Job -> Bool) -> Eq Job
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Job -> Job -> Bool
$c/= :: Job -> Job -> Bool
== :: Job -> Job -> Bool
$c== :: Job -> Job -> Bool
Prelude.Eq, ReadPrec [Job]
ReadPrec Job
Int -> ReadS Job
ReadS [Job]
(Int -> ReadS Job)
-> ReadS [Job] -> ReadPrec Job -> ReadPrec [Job] -> Read Job
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Job]
$creadListPrec :: ReadPrec [Job]
readPrec :: ReadPrec Job
$creadPrec :: ReadPrec Job
readList :: ReadS [Job]
$creadList :: ReadS [Job]
readsPrec :: Int -> ReadS Job
$creadsPrec :: Int -> ReadS Job
Prelude.Read, Int -> Job -> ShowS
[Job] -> ShowS
Job -> String
(Int -> Job -> ShowS)
-> (Job -> String) -> ([Job] -> ShowS) -> Show Job
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Job] -> ShowS
$cshowList :: [Job] -> ShowS
show :: Job -> String
$cshow :: Job -> String
showsPrec :: Int -> Job -> ShowS
$cshowsPrec :: Int -> Job -> ShowS
Prelude.Show, (forall x. Job -> Rep Job x)
-> (forall x. Rep Job x -> Job) -> Generic Job
forall x. Rep Job x -> Job
forall x. Job -> Rep Job x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Job x -> Job
$cfrom :: forall x. Job -> Rep Job x
Prelude.Generic)

-- |
-- Create a value of 'Job' 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:
--
-- 'status', 'job_status' - The status of the job, one of @IN_PROGRESS@, @CANCELED@,
-- @DELETION_IN_PROGRESS@ or @COMPLETED@.
--
-- 'jobExecutionsRolloutConfig', 'job_jobExecutionsRolloutConfig' - Allows you to create a staged rollout of a job.
--
-- 'jobId', 'job_jobId' - The unique identifier you assigned to this job when it was created.
--
-- 'lastUpdatedAt', 'job_lastUpdatedAt' - The time, in seconds since the epoch, when the job was last updated.
--
-- 'jobArn', 'job_jobArn' - An ARN identifying the job with format
-- \"arn:aws:iot:region:account:job\/jobId\".
--
-- 'createdAt', 'job_createdAt' - The time, in seconds since the epoch, when the job was created.
--
-- 'abortConfig', 'job_abortConfig' - Configuration for criteria to abort the job.
--
-- 'jobProcessDetails', 'job_jobProcessDetails' - Details about the job process.
--
-- 'namespaceId', 'job_namespaceId' - The namespace used to indicate that a job is a customer-managed job.
--
-- When you specify a value for this parameter, Amazon Web Services IoT
-- Core sends jobs notifications to MQTT topics that contain the value in
-- the following format.
--
-- @$aws\/things\/THING_NAME\/jobs\/JOB_ID\/notify-namespace-NAMESPACE_ID\/@
--
-- The @namespaceId@ feature is in public preview.
--
-- 'reasonCode', 'job_reasonCode' - If the job was updated, provides the reason code for the update.
--
-- 'presignedUrlConfig', 'job_presignedUrlConfig' - Configuration for pre-signed S3 URLs.
--
-- 'forceCanceled', 'job_forceCanceled' - Will be @true@ if the job was canceled with the optional @force@
-- parameter set to @true@.
--
-- 'jobTemplateArn', 'job_jobTemplateArn' - The ARN of the job template used to create the job.
--
-- 'targets', 'job_targets' - A list of IoT things and thing groups to which the job should be sent.
--
-- 'completedAt', 'job_completedAt' - The time, in seconds since the epoch, when the job was completed.
--
-- 'comment', 'job_comment' - If the job was updated, describes the reason for the update.
--
-- 'description', 'job_description' - A short text description of the job.
--
-- 'targetSelection', 'job_targetSelection' - Specifies whether the job will continue to run (CONTINUOUS), or will be
-- complete after all those things specified as targets have completed the
-- job (SNAPSHOT). If continuous, the job may also be run on a thing when a
-- change is detected in a target. For example, a job will run on a device
-- when the thing representing the device is added to a target group, even
-- after the job was completed by all things originally in the group.
--
-- 'timeoutConfig', 'job_timeoutConfig' - Specifies the amount of time each device has to finish its execution of
-- the job. A timer is started when the job execution status is set to
-- @IN_PROGRESS@. If the job execution status is not set to another
-- terminal state before the timer expires, it will be automatically set to
-- @TIMED_OUT@.
newJob ::
  Job
newJob :: Job
newJob =
  Job' :: Maybe JobStatus
-> Maybe JobExecutionsRolloutConfig
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe AbortConfig
-> Maybe JobProcessDetails
-> Maybe Text
-> Maybe Text
-> Maybe PresignedUrlConfig
-> Maybe Bool
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe TargetSelection
-> Maybe TimeoutConfig
-> Job
Job'
    { $sel:status:Job' :: Maybe JobStatus
status = Maybe JobStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:jobExecutionsRolloutConfig:Job' :: Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig = Maybe JobExecutionsRolloutConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:Job' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedAt:Job' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:jobArn:Job' :: Maybe Text
jobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Job' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:abortConfig:Job' :: Maybe AbortConfig
abortConfig = Maybe AbortConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:jobProcessDetails:Job' :: Maybe JobProcessDetails
jobProcessDetails = Maybe JobProcessDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:namespaceId:Job' :: Maybe Text
namespaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:reasonCode:Job' :: Maybe Text
reasonCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:presignedUrlConfig:Job' :: Maybe PresignedUrlConfig
presignedUrlConfig = Maybe PresignedUrlConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:forceCanceled:Job' :: Maybe Bool
forceCanceled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:jobTemplateArn:Job' :: Maybe Text
jobTemplateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targets:Job' :: Maybe (NonEmpty Text)
targets = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:completedAt:Job' :: Maybe POSIX
completedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:comment:Job' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Job' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetSelection:Job' :: Maybe TargetSelection
targetSelection = Maybe TargetSelection
forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutConfig:Job' :: Maybe TimeoutConfig
timeoutConfig = Maybe TimeoutConfig
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the job, one of @IN_PROGRESS@, @CANCELED@,
-- @DELETION_IN_PROGRESS@ or @COMPLETED@.
job_status :: Lens.Lens' Job (Prelude.Maybe JobStatus)
job_status :: (Maybe JobStatus -> f (Maybe JobStatus)) -> Job -> f Job
job_status = (Job -> Maybe JobStatus)
-> (Job -> Maybe JobStatus -> Job)
-> Lens Job Job (Maybe JobStatus) (Maybe JobStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe JobStatus
status :: Maybe JobStatus
$sel:status:Job' :: Job -> Maybe JobStatus
status} -> Maybe JobStatus
status) (\s :: Job
s@Job' {} Maybe JobStatus
a -> Job
s {$sel:status:Job' :: Maybe JobStatus
status = Maybe JobStatus
a} :: Job)

-- | Allows you to create a staged rollout of a job.
job_jobExecutionsRolloutConfig :: Lens.Lens' Job (Prelude.Maybe JobExecutionsRolloutConfig)
job_jobExecutionsRolloutConfig :: (Maybe JobExecutionsRolloutConfig
 -> f (Maybe JobExecutionsRolloutConfig))
-> Job -> f Job
job_jobExecutionsRolloutConfig = (Job -> Maybe JobExecutionsRolloutConfig)
-> (Job -> Maybe JobExecutionsRolloutConfig -> Job)
-> Lens
     Job
     Job
     (Maybe JobExecutionsRolloutConfig)
     (Maybe JobExecutionsRolloutConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig :: Maybe JobExecutionsRolloutConfig
$sel:jobExecutionsRolloutConfig:Job' :: Job -> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig} -> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig) (\s :: Job
s@Job' {} Maybe JobExecutionsRolloutConfig
a -> Job
s {$sel:jobExecutionsRolloutConfig:Job' :: Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig = Maybe JobExecutionsRolloutConfig
a} :: Job)

-- | The unique identifier you assigned to this job when it was created.
job_jobId :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_jobId :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_jobId = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
jobId :: Maybe Text
$sel:jobId:Job' :: Job -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:jobId:Job' :: Maybe Text
jobId = Maybe Text
a} :: Job)

-- | The time, in seconds since the epoch, when the job was last updated.
job_lastUpdatedAt :: Lens.Lens' Job (Prelude.Maybe Prelude.UTCTime)
job_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Job -> f Job
job_lastUpdatedAt = (Job -> Maybe POSIX)
-> (Job -> Maybe POSIX -> Job)
-> Lens Job Job (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:Job' :: Job -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: Job
s@Job' {} Maybe POSIX
a -> Job
s {$sel:lastUpdatedAt:Job' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: Job) ((Maybe POSIX -> f (Maybe POSIX)) -> Job -> f Job)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Job
-> f Job
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

-- | An ARN identifying the job with format
-- \"arn:aws:iot:region:account:job\/jobId\".
job_jobArn :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_jobArn :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_jobArn = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
jobArn :: Maybe Text
$sel:jobArn:Job' :: Job -> Maybe Text
jobArn} -> Maybe Text
jobArn) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:jobArn:Job' :: Maybe Text
jobArn = Maybe Text
a} :: Job)

-- | The time, in seconds since the epoch, when the job was created.
job_createdAt :: Lens.Lens' Job (Prelude.Maybe Prelude.UTCTime)
job_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Job -> f Job
job_createdAt = (Job -> Maybe POSIX)
-> (Job -> Maybe POSIX -> Job)
-> Lens Job Job (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Job' :: Job -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Job
s@Job' {} Maybe POSIX
a -> Job
s {$sel:createdAt:Job' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Job) ((Maybe POSIX -> f (Maybe POSIX)) -> Job -> f Job)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Job
-> f Job
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

-- | Configuration for criteria to abort the job.
job_abortConfig :: Lens.Lens' Job (Prelude.Maybe AbortConfig)
job_abortConfig :: (Maybe AbortConfig -> f (Maybe AbortConfig)) -> Job -> f Job
job_abortConfig = (Job -> Maybe AbortConfig)
-> (Job -> Maybe AbortConfig -> Job)
-> Lens Job Job (Maybe AbortConfig) (Maybe AbortConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe AbortConfig
abortConfig :: Maybe AbortConfig
$sel:abortConfig:Job' :: Job -> Maybe AbortConfig
abortConfig} -> Maybe AbortConfig
abortConfig) (\s :: Job
s@Job' {} Maybe AbortConfig
a -> Job
s {$sel:abortConfig:Job' :: Maybe AbortConfig
abortConfig = Maybe AbortConfig
a} :: Job)

-- | Details about the job process.
job_jobProcessDetails :: Lens.Lens' Job (Prelude.Maybe JobProcessDetails)
job_jobProcessDetails :: (Maybe JobProcessDetails -> f (Maybe JobProcessDetails))
-> Job -> f Job
job_jobProcessDetails = (Job -> Maybe JobProcessDetails)
-> (Job -> Maybe JobProcessDetails -> Job)
-> Lens Job Job (Maybe JobProcessDetails) (Maybe JobProcessDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe JobProcessDetails
jobProcessDetails :: Maybe JobProcessDetails
$sel:jobProcessDetails:Job' :: Job -> Maybe JobProcessDetails
jobProcessDetails} -> Maybe JobProcessDetails
jobProcessDetails) (\s :: Job
s@Job' {} Maybe JobProcessDetails
a -> Job
s {$sel:jobProcessDetails:Job' :: Maybe JobProcessDetails
jobProcessDetails = Maybe JobProcessDetails
a} :: Job)

-- | The namespace used to indicate that a job is a customer-managed job.
--
-- When you specify a value for this parameter, Amazon Web Services IoT
-- Core sends jobs notifications to MQTT topics that contain the value in
-- the following format.
--
-- @$aws\/things\/THING_NAME\/jobs\/JOB_ID\/notify-namespace-NAMESPACE_ID\/@
--
-- The @namespaceId@ feature is in public preview.
job_namespaceId :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_namespaceId :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_namespaceId = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
namespaceId :: Maybe Text
$sel:namespaceId:Job' :: Job -> Maybe Text
namespaceId} -> Maybe Text
namespaceId) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:namespaceId:Job' :: Maybe Text
namespaceId = Maybe Text
a} :: Job)

-- | If the job was updated, provides the reason code for the update.
job_reasonCode :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_reasonCode :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_reasonCode = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
reasonCode :: Maybe Text
$sel:reasonCode:Job' :: Job -> Maybe Text
reasonCode} -> Maybe Text
reasonCode) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:reasonCode:Job' :: Maybe Text
reasonCode = Maybe Text
a} :: Job)

-- | Configuration for pre-signed S3 URLs.
job_presignedUrlConfig :: Lens.Lens' Job (Prelude.Maybe PresignedUrlConfig)
job_presignedUrlConfig :: (Maybe PresignedUrlConfig -> f (Maybe PresignedUrlConfig))
-> Job -> f Job
job_presignedUrlConfig = (Job -> Maybe PresignedUrlConfig)
-> (Job -> Maybe PresignedUrlConfig -> Job)
-> Lens
     Job Job (Maybe PresignedUrlConfig) (Maybe PresignedUrlConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe PresignedUrlConfig
presignedUrlConfig :: Maybe PresignedUrlConfig
$sel:presignedUrlConfig:Job' :: Job -> Maybe PresignedUrlConfig
presignedUrlConfig} -> Maybe PresignedUrlConfig
presignedUrlConfig) (\s :: Job
s@Job' {} Maybe PresignedUrlConfig
a -> Job
s {$sel:presignedUrlConfig:Job' :: Maybe PresignedUrlConfig
presignedUrlConfig = Maybe PresignedUrlConfig
a} :: Job)

-- | Will be @true@ if the job was canceled with the optional @force@
-- parameter set to @true@.
job_forceCanceled :: Lens.Lens' Job (Prelude.Maybe Prelude.Bool)
job_forceCanceled :: (Maybe Bool -> f (Maybe Bool)) -> Job -> f Job
job_forceCanceled = (Job -> Maybe Bool)
-> (Job -> Maybe Bool -> Job)
-> Lens Job Job (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Bool
forceCanceled :: Maybe Bool
$sel:forceCanceled:Job' :: Job -> Maybe Bool
forceCanceled} -> Maybe Bool
forceCanceled) (\s :: Job
s@Job' {} Maybe Bool
a -> Job
s {$sel:forceCanceled:Job' :: Maybe Bool
forceCanceled = Maybe Bool
a} :: Job)

-- | The ARN of the job template used to create the job.
job_jobTemplateArn :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_jobTemplateArn :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_jobTemplateArn = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
jobTemplateArn :: Maybe Text
$sel:jobTemplateArn:Job' :: Job -> Maybe Text
jobTemplateArn} -> Maybe Text
jobTemplateArn) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:jobTemplateArn:Job' :: Maybe Text
jobTemplateArn = Maybe Text
a} :: Job)

-- | A list of IoT things and thing groups to which the job should be sent.
job_targets :: Lens.Lens' Job (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
job_targets :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Job -> f Job
job_targets = (Job -> Maybe (NonEmpty Text))
-> (Job -> Maybe (NonEmpty Text) -> Job)
-> Lens Job Job (Maybe (NonEmpty Text)) (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe (NonEmpty Text)
targets :: Maybe (NonEmpty Text)
$sel:targets:Job' :: Job -> Maybe (NonEmpty Text)
targets} -> Maybe (NonEmpty Text)
targets) (\s :: Job
s@Job' {} Maybe (NonEmpty Text)
a -> Job
s {$sel:targets:Job' :: Maybe (NonEmpty Text)
targets = Maybe (NonEmpty Text)
a} :: Job) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> Job -> f Job)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Job
-> f Job
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time, in seconds since the epoch, when the job was completed.
job_completedAt :: Lens.Lens' Job (Prelude.Maybe Prelude.UTCTime)
job_completedAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Job -> f Job
job_completedAt = (Job -> Maybe POSIX)
-> (Job -> Maybe POSIX -> Job)
-> Lens Job Job (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe POSIX
completedAt :: Maybe POSIX
$sel:completedAt:Job' :: Job -> Maybe POSIX
completedAt} -> Maybe POSIX
completedAt) (\s :: Job
s@Job' {} Maybe POSIX
a -> Job
s {$sel:completedAt:Job' :: Maybe POSIX
completedAt = Maybe POSIX
a} :: Job) ((Maybe POSIX -> f (Maybe POSIX)) -> Job -> f Job)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Job
-> f Job
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

-- | If the job was updated, describes the reason for the update.
job_comment :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_comment :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_comment = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
comment :: Maybe Text
$sel:comment:Job' :: Job -> Maybe Text
comment} -> Maybe Text
comment) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:comment:Job' :: Maybe Text
comment = Maybe Text
a} :: Job)

-- | A short text description of the job.
job_description :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_description :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_description = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
description :: Maybe Text
$sel:description:Job' :: Job -> Maybe Text
description} -> Maybe Text
description) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:description:Job' :: Maybe Text
description = Maybe Text
a} :: Job)

-- | Specifies whether the job will continue to run (CONTINUOUS), or will be
-- complete after all those things specified as targets have completed the
-- job (SNAPSHOT). If continuous, the job may also be run on a thing when a
-- change is detected in a target. For example, a job will run on a device
-- when the thing representing the device is added to a target group, even
-- after the job was completed by all things originally in the group.
job_targetSelection :: Lens.Lens' Job (Prelude.Maybe TargetSelection)
job_targetSelection :: (Maybe TargetSelection -> f (Maybe TargetSelection))
-> Job -> f Job
job_targetSelection = (Job -> Maybe TargetSelection)
-> (Job -> Maybe TargetSelection -> Job)
-> Lens Job Job (Maybe TargetSelection) (Maybe TargetSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe TargetSelection
targetSelection :: Maybe TargetSelection
$sel:targetSelection:Job' :: Job -> Maybe TargetSelection
targetSelection} -> Maybe TargetSelection
targetSelection) (\s :: Job
s@Job' {} Maybe TargetSelection
a -> Job
s {$sel:targetSelection:Job' :: Maybe TargetSelection
targetSelection = Maybe TargetSelection
a} :: Job)

-- | Specifies the amount of time each device has to finish its execution of
-- the job. A timer is started when the job execution status is set to
-- @IN_PROGRESS@. If the job execution status is not set to another
-- terminal state before the timer expires, it will be automatically set to
-- @TIMED_OUT@.
job_timeoutConfig :: Lens.Lens' Job (Prelude.Maybe TimeoutConfig)
job_timeoutConfig :: (Maybe TimeoutConfig -> f (Maybe TimeoutConfig)) -> Job -> f Job
job_timeoutConfig = (Job -> Maybe TimeoutConfig)
-> (Job -> Maybe TimeoutConfig -> Job)
-> Lens Job Job (Maybe TimeoutConfig) (Maybe TimeoutConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe TimeoutConfig
timeoutConfig :: Maybe TimeoutConfig
$sel:timeoutConfig:Job' :: Job -> Maybe TimeoutConfig
timeoutConfig} -> Maybe TimeoutConfig
timeoutConfig) (\s :: Job
s@Job' {} Maybe TimeoutConfig
a -> Job
s {$sel:timeoutConfig:Job' :: Maybe TimeoutConfig
timeoutConfig = Maybe TimeoutConfig
a} :: Job)

instance Core.FromJSON Job where
  parseJSON :: Value -> Parser Job
parseJSON =
    String -> (Object -> Parser Job) -> Value -> Parser Job
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Job"
      ( \Object
x ->
          Maybe JobStatus
-> Maybe JobExecutionsRolloutConfig
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe AbortConfig
-> Maybe JobProcessDetails
-> Maybe Text
-> Maybe Text
-> Maybe PresignedUrlConfig
-> Maybe Bool
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe TargetSelection
-> Maybe TimeoutConfig
-> Job
Job'
            (Maybe JobStatus
 -> Maybe JobExecutionsRolloutConfig
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe AbortConfig
 -> Maybe JobProcessDetails
 -> Maybe Text
 -> Maybe Text
 -> Maybe PresignedUrlConfig
 -> Maybe Bool
 -> Maybe Text
 -> Maybe (NonEmpty Text)
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe TargetSelection
 -> Maybe TimeoutConfig
 -> Job)
-> Parser (Maybe JobStatus)
-> Parser
     (Maybe JobExecutionsRolloutConfig
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe AbortConfig
      -> Maybe JobProcessDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe PresignedUrlConfig
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe JobStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe JobExecutionsRolloutConfig
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe AbortConfig
   -> Maybe JobProcessDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe PresignedUrlConfig
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe JobExecutionsRolloutConfig)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe AbortConfig
      -> Maybe JobProcessDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe PresignedUrlConfig
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobExecutionsRolloutConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"jobExecutionsRolloutConfig")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe AbortConfig
   -> Maybe JobProcessDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe PresignedUrlConfig
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe AbortConfig
      -> Maybe JobProcessDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe PresignedUrlConfig
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
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
"jobId")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe AbortConfig
   -> Maybe JobProcessDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe PresignedUrlConfig
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe AbortConfig
      -> Maybe JobProcessDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe PresignedUrlConfig
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
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
"lastUpdatedAt")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe AbortConfig
   -> Maybe JobProcessDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe PresignedUrlConfig
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe AbortConfig
      -> Maybe JobProcessDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe PresignedUrlConfig
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
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 POSIX
   -> Maybe AbortConfig
   -> Maybe JobProcessDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe PresignedUrlConfig
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe AbortConfig
      -> Maybe JobProcessDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe PresignedUrlConfig
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
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
"createdAt")
            Parser
  (Maybe AbortConfig
   -> Maybe JobProcessDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe PresignedUrlConfig
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe AbortConfig)
-> Parser
     (Maybe JobProcessDetails
      -> Maybe Text
      -> Maybe Text
      -> Maybe PresignedUrlConfig
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AbortConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"abortConfig")
            Parser
  (Maybe JobProcessDetails
   -> Maybe Text
   -> Maybe Text
   -> Maybe PresignedUrlConfig
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe JobProcessDetails)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe PresignedUrlConfig
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobProcessDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"jobProcessDetails")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe PresignedUrlConfig
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe PresignedUrlConfig
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
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
"namespaceId")
            Parser
  (Maybe Text
   -> Maybe PresignedUrlConfig
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe PresignedUrlConfig
      -> Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
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
"reasonCode")
            Parser
  (Maybe PresignedUrlConfig
   -> Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe PresignedUrlConfig)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PresignedUrlConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"presignedUrlConfig")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
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
"forceCanceled")
            Parser
  (Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty Text)
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
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
"jobTemplateArn")
            Parser
  (Maybe (NonEmpty Text)
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe (NonEmpty Text))
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"targets")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe TargetSelection
      -> Maybe TimeoutConfig
      -> Job)
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
"completedAt")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe TargetSelection
   -> Maybe TimeoutConfig
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe TargetSelection -> Maybe TimeoutConfig -> Job)
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
"comment")
            Parser
  (Maybe Text -> Maybe TargetSelection -> Maybe TimeoutConfig -> Job)
-> Parser (Maybe Text)
-> Parser (Maybe TargetSelection -> Maybe TimeoutConfig -> Job)
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
"description")
            Parser (Maybe TargetSelection -> Maybe TimeoutConfig -> Job)
-> Parser (Maybe TargetSelection)
-> Parser (Maybe TimeoutConfig -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TargetSelection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"targetSelection")
            Parser (Maybe TimeoutConfig -> Job)
-> Parser (Maybe TimeoutConfig) -> Parser Job
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TimeoutConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"timeoutConfig")
      )

instance Prelude.Hashable Job

instance Prelude.NFData Job