{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateJob
-- 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)
--
-- Creates a job.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions CreateJob>
-- action.
module Amazonka.IoT.CreateJob
  ( -- * Creating a Request
    CreateJob (..),
    newCreateJob,

    -- * Request Lenses
    createJob_jobExecutionsRolloutConfig,
    createJob_documentSource,
    createJob_abortConfig,
    createJob_namespaceId,
    createJob_presignedUrlConfig,
    createJob_document,
    createJob_jobTemplateArn,
    createJob_description,
    createJob_targetSelection,
    createJob_timeoutConfig,
    createJob_tags,
    createJob_jobId,
    createJob_targets,

    -- * Destructuring the Response
    CreateJobResponse (..),
    newCreateJobResponse,

    -- * Response Lenses
    createJobResponse_jobId,
    createJobResponse_jobArn,
    createJobResponse_description,
    createJobResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateJob' smart constructor.
data CreateJob = CreateJob'
  { -- | Allows you to create a staged rollout of the job.
    CreateJob -> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig :: Prelude.Maybe JobExecutionsRolloutConfig,
    -- | An S3 link to the job document. Required if you don\'t specify a value
    -- for @document@.
    --
    -- If the job document resides in an S3 bucket, you must use a placeholder
    -- link when specifying the document.
    --
    -- The placeholder link is of the following form:
    --
    -- @${aws:iot:s3-presigned-url:https:\/\/s3.amazonaws.com\/bucket\/key}@
    --
    -- where /bucket/ is your bucket name and /key/ is the object in the bucket
    -- to which you are linking.
    CreateJob -> Maybe Text
documentSource :: Prelude.Maybe Prelude.Text,
    -- | Allows you to create criteria to abort a job.
    CreateJob -> Maybe AbortConfig
abortConfig :: Prelude.Maybe AbortConfig,
    -- | 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.
    CreateJob -> Maybe Text
namespaceId :: Prelude.Maybe Prelude.Text,
    -- | Configuration information for pre-signed S3 URLs.
    CreateJob -> Maybe PresignedUrlConfig
presignedUrlConfig :: Prelude.Maybe PresignedUrlConfig,
    -- | The job document. Required if you don\'t specify a value for
    -- @documentSource@.
    CreateJob -> Maybe Text
document :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the job template used to create the job.
    CreateJob -> Maybe Text
jobTemplateArn :: Prelude.Maybe Prelude.Text,
    -- | A short text description of the job.
    CreateJob -> 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 thing
    -- when the thing is added to a target group, even after the job was
    -- completed by all things originally in the group.
    CreateJob -> Maybe TargetSelection
targetSelection :: Prelude.Maybe TargetSelection,
    -- | Specifies the amount of time each device has to finish its execution of
    -- the job. The 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 time expires, it will be automatically set to
    -- @TIMED_OUT@.
    CreateJob -> Maybe TimeoutConfig
timeoutConfig :: Prelude.Maybe TimeoutConfig,
    -- | Metadata which can be used to manage the job.
    CreateJob -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A job identifier which must be unique for your Amazon Web Services
    -- account. We recommend using a UUID. Alpha-numeric characters, \"-\" and
    -- \"_\" are valid for use here.
    CreateJob -> Text
jobId :: Prelude.Text,
    -- | A list of things and thing groups to which the job should be sent.
    CreateJob -> NonEmpty Text
targets :: Prelude.NonEmpty Prelude.Text
  }
  deriving (CreateJob -> CreateJob -> Bool
(CreateJob -> CreateJob -> Bool)
-> (CreateJob -> CreateJob -> Bool) -> Eq CreateJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJob -> CreateJob -> Bool
$c/= :: CreateJob -> CreateJob -> Bool
== :: CreateJob -> CreateJob -> Bool
$c== :: CreateJob -> CreateJob -> Bool
Prelude.Eq, ReadPrec [CreateJob]
ReadPrec CreateJob
Int -> ReadS CreateJob
ReadS [CreateJob]
(Int -> ReadS CreateJob)
-> ReadS [CreateJob]
-> ReadPrec CreateJob
-> ReadPrec [CreateJob]
-> Read CreateJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJob]
$creadListPrec :: ReadPrec [CreateJob]
readPrec :: ReadPrec CreateJob
$creadPrec :: ReadPrec CreateJob
readList :: ReadS [CreateJob]
$creadList :: ReadS [CreateJob]
readsPrec :: Int -> ReadS CreateJob
$creadsPrec :: Int -> ReadS CreateJob
Prelude.Read, Int -> CreateJob -> ShowS
[CreateJob] -> ShowS
CreateJob -> String
(Int -> CreateJob -> ShowS)
-> (CreateJob -> String)
-> ([CreateJob] -> ShowS)
-> Show CreateJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJob] -> ShowS
$cshowList :: [CreateJob] -> ShowS
show :: CreateJob -> String
$cshow :: CreateJob -> String
showsPrec :: Int -> CreateJob -> ShowS
$cshowsPrec :: Int -> CreateJob -> ShowS
Prelude.Show, (forall x. CreateJob -> Rep CreateJob x)
-> (forall x. Rep CreateJob x -> CreateJob) -> Generic CreateJob
forall x. Rep CreateJob x -> CreateJob
forall x. CreateJob -> Rep CreateJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateJob x -> CreateJob
$cfrom :: forall x. CreateJob -> Rep CreateJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateJob' 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:
--
-- 'jobExecutionsRolloutConfig', 'createJob_jobExecutionsRolloutConfig' - Allows you to create a staged rollout of the job.
--
-- 'documentSource', 'createJob_documentSource' - An S3 link to the job document. Required if you don\'t specify a value
-- for @document@.
--
-- If the job document resides in an S3 bucket, you must use a placeholder
-- link when specifying the document.
--
-- The placeholder link is of the following form:
--
-- @${aws:iot:s3-presigned-url:https:\/\/s3.amazonaws.com\/bucket\/key}@
--
-- where /bucket/ is your bucket name and /key/ is the object in the bucket
-- to which you are linking.
--
-- 'abortConfig', 'createJob_abortConfig' - Allows you to create criteria to abort a job.
--
-- 'namespaceId', 'createJob_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.
--
-- 'presignedUrlConfig', 'createJob_presignedUrlConfig' - Configuration information for pre-signed S3 URLs.
--
-- 'document', 'createJob_document' - The job document. Required if you don\'t specify a value for
-- @documentSource@.
--
-- 'jobTemplateArn', 'createJob_jobTemplateArn' - The ARN of the job template used to create the job.
--
-- 'description', 'createJob_description' - A short text description of the job.
--
-- 'targetSelection', 'createJob_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 thing
-- when the thing is added to a target group, even after the job was
-- completed by all things originally in the group.
--
-- 'timeoutConfig', 'createJob_timeoutConfig' - Specifies the amount of time each device has to finish its execution of
-- the job. The 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 time expires, it will be automatically set to
-- @TIMED_OUT@.
--
-- 'tags', 'createJob_tags' - Metadata which can be used to manage the job.
--
-- 'jobId', 'createJob_jobId' - A job identifier which must be unique for your Amazon Web Services
-- account. We recommend using a UUID. Alpha-numeric characters, \"-\" and
-- \"_\" are valid for use here.
--
-- 'targets', 'createJob_targets' - A list of things and thing groups to which the job should be sent.
newCreateJob ::
  -- | 'jobId'
  Prelude.Text ->
  -- | 'targets'
  Prelude.NonEmpty Prelude.Text ->
  CreateJob
newCreateJob :: Text -> NonEmpty Text -> CreateJob
newCreateJob Text
pJobId_ NonEmpty Text
pTargets_ =
  CreateJob' :: Maybe JobExecutionsRolloutConfig
-> Maybe Text
-> Maybe AbortConfig
-> Maybe Text
-> Maybe PresignedUrlConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe TargetSelection
-> Maybe TimeoutConfig
-> Maybe [Tag]
-> Text
-> NonEmpty Text
-> CreateJob
CreateJob'
    { $sel:jobExecutionsRolloutConfig:CreateJob' :: Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig =
        Maybe JobExecutionsRolloutConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:documentSource:CreateJob' :: Maybe Text
documentSource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:abortConfig:CreateJob' :: Maybe AbortConfig
abortConfig = Maybe AbortConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:namespaceId:CreateJob' :: Maybe Text
namespaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:presignedUrlConfig:CreateJob' :: Maybe PresignedUrlConfig
presignedUrlConfig = Maybe PresignedUrlConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:document:CreateJob' :: Maybe Text
document = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobTemplateArn:CreateJob' :: Maybe Text
jobTemplateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateJob' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetSelection:CreateJob' :: Maybe TargetSelection
targetSelection = Maybe TargetSelection
forall a. Maybe a
Prelude.Nothing,
      $sel:timeoutConfig:CreateJob' :: Maybe TimeoutConfig
timeoutConfig = Maybe TimeoutConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateJob' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:jobId:CreateJob' :: Text
jobId = Text
pJobId_,
      $sel:targets:CreateJob' :: NonEmpty Text
targets = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pTargets_
    }

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

-- | An S3 link to the job document. Required if you don\'t specify a value
-- for @document@.
--
-- If the job document resides in an S3 bucket, you must use a placeholder
-- link when specifying the document.
--
-- The placeholder link is of the following form:
--
-- @${aws:iot:s3-presigned-url:https:\/\/s3.amazonaws.com\/bucket\/key}@
--
-- where /bucket/ is your bucket name and /key/ is the object in the bucket
-- to which you are linking.
createJob_documentSource :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_documentSource :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_documentSource = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
documentSource :: Maybe Text
$sel:documentSource:CreateJob' :: CreateJob -> Maybe Text
documentSource} -> Maybe Text
documentSource) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:documentSource:CreateJob' :: Maybe Text
documentSource = Maybe Text
a} :: CreateJob)

-- | Allows you to create criteria to abort a job.
createJob_abortConfig :: Lens.Lens' CreateJob (Prelude.Maybe AbortConfig)
createJob_abortConfig :: (Maybe AbortConfig -> f (Maybe AbortConfig))
-> CreateJob -> f CreateJob
createJob_abortConfig = (CreateJob -> Maybe AbortConfig)
-> (CreateJob -> Maybe AbortConfig -> CreateJob)
-> Lens CreateJob CreateJob (Maybe AbortConfig) (Maybe AbortConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe AbortConfig
abortConfig :: Maybe AbortConfig
$sel:abortConfig:CreateJob' :: CreateJob -> Maybe AbortConfig
abortConfig} -> Maybe AbortConfig
abortConfig) (\s :: CreateJob
s@CreateJob' {} Maybe AbortConfig
a -> CreateJob
s {$sel:abortConfig:CreateJob' :: Maybe AbortConfig
abortConfig = Maybe AbortConfig
a} :: CreateJob)

-- | 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.
createJob_namespaceId :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_namespaceId :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_namespaceId = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
namespaceId :: Maybe Text
$sel:namespaceId:CreateJob' :: CreateJob -> Maybe Text
namespaceId} -> Maybe Text
namespaceId) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:namespaceId:CreateJob' :: Maybe Text
namespaceId = Maybe Text
a} :: CreateJob)

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

-- | The job document. Required if you don\'t specify a value for
-- @documentSource@.
createJob_document :: Lens.Lens' CreateJob (Prelude.Maybe Prelude.Text)
createJob_document :: (Maybe Text -> f (Maybe Text)) -> CreateJob -> f CreateJob
createJob_document = (CreateJob -> Maybe Text)
-> (CreateJob -> Maybe Text -> CreateJob)
-> Lens CreateJob CreateJob (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe Text
document :: Maybe Text
$sel:document:CreateJob' :: CreateJob -> Maybe Text
document} -> Maybe Text
document) (\s :: CreateJob
s@CreateJob' {} Maybe Text
a -> CreateJob
s {$sel:document:CreateJob' :: Maybe Text
document = Maybe Text
a} :: CreateJob)

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

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

-- | 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 thing
-- when the thing is added to a target group, even after the job was
-- completed by all things originally in the group.
createJob_targetSelection :: Lens.Lens' CreateJob (Prelude.Maybe TargetSelection)
createJob_targetSelection :: (Maybe TargetSelection -> f (Maybe TargetSelection))
-> CreateJob -> f CreateJob
createJob_targetSelection = (CreateJob -> Maybe TargetSelection)
-> (CreateJob -> Maybe TargetSelection -> CreateJob)
-> Lens
     CreateJob CreateJob (Maybe TargetSelection) (Maybe TargetSelection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe TargetSelection
targetSelection :: Maybe TargetSelection
$sel:targetSelection:CreateJob' :: CreateJob -> Maybe TargetSelection
targetSelection} -> Maybe TargetSelection
targetSelection) (\s :: CreateJob
s@CreateJob' {} Maybe TargetSelection
a -> CreateJob
s {$sel:targetSelection:CreateJob' :: Maybe TargetSelection
targetSelection = Maybe TargetSelection
a} :: CreateJob)

-- | Specifies the amount of time each device has to finish its execution of
-- the job. The 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 time expires, it will be automatically set to
-- @TIMED_OUT@.
createJob_timeoutConfig :: Lens.Lens' CreateJob (Prelude.Maybe TimeoutConfig)
createJob_timeoutConfig :: (Maybe TimeoutConfig -> f (Maybe TimeoutConfig))
-> CreateJob -> f CreateJob
createJob_timeoutConfig = (CreateJob -> Maybe TimeoutConfig)
-> (CreateJob -> Maybe TimeoutConfig -> CreateJob)
-> Lens
     CreateJob CreateJob (Maybe TimeoutConfig) (Maybe TimeoutConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe TimeoutConfig
timeoutConfig :: Maybe TimeoutConfig
$sel:timeoutConfig:CreateJob' :: CreateJob -> Maybe TimeoutConfig
timeoutConfig} -> Maybe TimeoutConfig
timeoutConfig) (\s :: CreateJob
s@CreateJob' {} Maybe TimeoutConfig
a -> CreateJob
s {$sel:timeoutConfig:CreateJob' :: Maybe TimeoutConfig
timeoutConfig = Maybe TimeoutConfig
a} :: CreateJob)

-- | Metadata which can be used to manage the job.
createJob_tags :: Lens.Lens' CreateJob (Prelude.Maybe [Tag])
createJob_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateJob -> f CreateJob
createJob_tags = (CreateJob -> Maybe [Tag])
-> (CreateJob -> Maybe [Tag] -> CreateJob)
-> Lens CreateJob CreateJob (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateJob' :: CreateJob -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateJob
s@CreateJob' {} Maybe [Tag]
a -> CreateJob
s {$sel:tags:CreateJob' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateJob) ((Maybe [Tag] -> f (Maybe [Tag])) -> CreateJob -> f CreateJob)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateJob
-> f CreateJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A job identifier which must be unique for your Amazon Web Services
-- account. We recommend using a UUID. Alpha-numeric characters, \"-\" and
-- \"_\" are valid for use here.
createJob_jobId :: Lens.Lens' CreateJob Prelude.Text
createJob_jobId :: (Text -> f Text) -> CreateJob -> f CreateJob
createJob_jobId = (CreateJob -> Text)
-> (CreateJob -> Text -> CreateJob)
-> Lens CreateJob CreateJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {Text
jobId :: Text
$sel:jobId:CreateJob' :: CreateJob -> Text
jobId} -> Text
jobId) (\s :: CreateJob
s@CreateJob' {} Text
a -> CreateJob
s {$sel:jobId:CreateJob' :: Text
jobId = Text
a} :: CreateJob)

-- | A list of things and thing groups to which the job should be sent.
createJob_targets :: Lens.Lens' CreateJob (Prelude.NonEmpty Prelude.Text)
createJob_targets :: (NonEmpty Text -> f (NonEmpty Text)) -> CreateJob -> f CreateJob
createJob_targets = (CreateJob -> NonEmpty Text)
-> (CreateJob -> NonEmpty Text -> CreateJob)
-> Lens CreateJob CreateJob (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJob' {NonEmpty Text
targets :: NonEmpty Text
$sel:targets:CreateJob' :: CreateJob -> NonEmpty Text
targets} -> NonEmpty Text
targets) (\s :: CreateJob
s@CreateJob' {} NonEmpty Text
a -> CreateJob
s {$sel:targets:CreateJob' :: NonEmpty Text
targets = NonEmpty Text
a} :: CreateJob) ((NonEmpty Text -> f (NonEmpty Text)) -> CreateJob -> f CreateJob)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> CreateJob
-> f CreateJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateJob where
  type AWSResponse CreateJob = CreateJobResponse
  request :: CreateJob -> Request CreateJob
request = Service -> CreateJob -> Request CreateJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateJob))
-> Logger
-> Service
-> Proxy CreateJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateJob)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> Int -> CreateJobResponse
CreateJobResponse'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Int -> CreateJobResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Text -> Int -> CreateJobResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"jobId")
            Either
  String (Maybe Text -> Maybe Text -> Int -> CreateJobResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"jobArn")
            Either String (Maybe Text -> Int -> CreateJobResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"description")
            Either String (Int -> CreateJobResponse)
-> Either String Int -> Either String CreateJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateJob

instance Prelude.NFData CreateJob

instance Core.ToHeaders CreateJob where
  toHeaders :: CreateJob -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON CreateJob where
  toJSON :: CreateJob -> Value
toJSON CreateJob' {Maybe [Tag]
Maybe Text
Maybe AbortConfig
Maybe PresignedUrlConfig
Maybe JobExecutionsRolloutConfig
Maybe TargetSelection
Maybe TimeoutConfig
NonEmpty Text
Text
targets :: NonEmpty Text
jobId :: Text
tags :: Maybe [Tag]
timeoutConfig :: Maybe TimeoutConfig
targetSelection :: Maybe TargetSelection
description :: Maybe Text
jobTemplateArn :: Maybe Text
document :: Maybe Text
presignedUrlConfig :: Maybe PresignedUrlConfig
namespaceId :: Maybe Text
abortConfig :: Maybe AbortConfig
documentSource :: Maybe Text
jobExecutionsRolloutConfig :: Maybe JobExecutionsRolloutConfig
$sel:targets:CreateJob' :: CreateJob -> NonEmpty Text
$sel:jobId:CreateJob' :: CreateJob -> Text
$sel:tags:CreateJob' :: CreateJob -> Maybe [Tag]
$sel:timeoutConfig:CreateJob' :: CreateJob -> Maybe TimeoutConfig
$sel:targetSelection:CreateJob' :: CreateJob -> Maybe TargetSelection
$sel:description:CreateJob' :: CreateJob -> Maybe Text
$sel:jobTemplateArn:CreateJob' :: CreateJob -> Maybe Text
$sel:document:CreateJob' :: CreateJob -> Maybe Text
$sel:presignedUrlConfig:CreateJob' :: CreateJob -> Maybe PresignedUrlConfig
$sel:namespaceId:CreateJob' :: CreateJob -> Maybe Text
$sel:abortConfig:CreateJob' :: CreateJob -> Maybe AbortConfig
$sel:documentSource:CreateJob' :: CreateJob -> Maybe Text
$sel:jobExecutionsRolloutConfig:CreateJob' :: CreateJob -> Maybe JobExecutionsRolloutConfig
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"jobExecutionsRolloutConfig" Text -> JobExecutionsRolloutConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (JobExecutionsRolloutConfig -> Pair)
-> Maybe JobExecutionsRolloutConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobExecutionsRolloutConfig
jobExecutionsRolloutConfig,
            (Text
"documentSource" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
documentSource,
            (Text
"abortConfig" Text -> AbortConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AbortConfig -> Pair) -> Maybe AbortConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AbortConfig
abortConfig,
            (Text
"namespaceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
namespaceId,
            (Text
"presignedUrlConfig" Text -> PresignedUrlConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PresignedUrlConfig -> Pair)
-> Maybe PresignedUrlConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PresignedUrlConfig
presignedUrlConfig,
            (Text
"document" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
document,
            (Text
"jobTemplateArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
jobTemplateArn,
            (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"targetSelection" Text -> TargetSelection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TargetSelection -> Pair) -> Maybe TargetSelection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TargetSelection
targetSelection,
            (Text
"timeoutConfig" Text -> TimeoutConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TimeoutConfig -> Pair) -> Maybe TimeoutConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TimeoutConfig
timeoutConfig,
            (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"targets" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
targets)
          ]
      )

instance Core.ToPath CreateJob where
  toPath :: CreateJob -> ByteString
toPath CreateJob' {Maybe [Tag]
Maybe Text
Maybe AbortConfig
Maybe PresignedUrlConfig
Maybe JobExecutionsRolloutConfig
Maybe TargetSelection
Maybe TimeoutConfig
NonEmpty Text
Text
targets :: NonEmpty Text
jobId :: Text
tags :: Maybe [Tag]
timeoutConfig :: Maybe TimeoutConfig
targetSelection :: Maybe TargetSelection
description :: Maybe Text
jobTemplateArn :: Maybe Text
document :: Maybe Text
presignedUrlConfig :: Maybe PresignedUrlConfig
namespaceId :: Maybe Text
abortConfig :: Maybe AbortConfig
documentSource :: Maybe Text
jobExecutionsRolloutConfig :: Maybe JobExecutionsRolloutConfig
$sel:targets:CreateJob' :: CreateJob -> NonEmpty Text
$sel:jobId:CreateJob' :: CreateJob -> Text
$sel:tags:CreateJob' :: CreateJob -> Maybe [Tag]
$sel:timeoutConfig:CreateJob' :: CreateJob -> Maybe TimeoutConfig
$sel:targetSelection:CreateJob' :: CreateJob -> Maybe TargetSelection
$sel:description:CreateJob' :: CreateJob -> Maybe Text
$sel:jobTemplateArn:CreateJob' :: CreateJob -> Maybe Text
$sel:document:CreateJob' :: CreateJob -> Maybe Text
$sel:presignedUrlConfig:CreateJob' :: CreateJob -> Maybe PresignedUrlConfig
$sel:namespaceId:CreateJob' :: CreateJob -> Maybe Text
$sel:abortConfig:CreateJob' :: CreateJob -> Maybe AbortConfig
$sel:documentSource:CreateJob' :: CreateJob -> Maybe Text
$sel:jobExecutionsRolloutConfig:CreateJob' :: CreateJob -> Maybe JobExecutionsRolloutConfig
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/jobs/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
jobId]

instance Core.ToQuery CreateJob where
  toQuery :: CreateJob -> QueryString
toQuery = QueryString -> CreateJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateJobResponse' smart constructor.
data CreateJobResponse = CreateJobResponse'
  { -- | The unique identifier you assigned to this job.
    CreateJobResponse -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | The job ARN.
    CreateJobResponse -> Maybe Text
jobArn :: Prelude.Maybe Prelude.Text,
    -- | The job description.
    CreateJobResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateJobResponse -> CreateJobResponse -> Bool
(CreateJobResponse -> CreateJobResponse -> Bool)
-> (CreateJobResponse -> CreateJobResponse -> Bool)
-> Eq CreateJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJobResponse -> CreateJobResponse -> Bool
$c/= :: CreateJobResponse -> CreateJobResponse -> Bool
== :: CreateJobResponse -> CreateJobResponse -> Bool
$c== :: CreateJobResponse -> CreateJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateJobResponse]
ReadPrec CreateJobResponse
Int -> ReadS CreateJobResponse
ReadS [CreateJobResponse]
(Int -> ReadS CreateJobResponse)
-> ReadS [CreateJobResponse]
-> ReadPrec CreateJobResponse
-> ReadPrec [CreateJobResponse]
-> Read CreateJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJobResponse]
$creadListPrec :: ReadPrec [CreateJobResponse]
readPrec :: ReadPrec CreateJobResponse
$creadPrec :: ReadPrec CreateJobResponse
readList :: ReadS [CreateJobResponse]
$creadList :: ReadS [CreateJobResponse]
readsPrec :: Int -> ReadS CreateJobResponse
$creadsPrec :: Int -> ReadS CreateJobResponse
Prelude.Read, Int -> CreateJobResponse -> ShowS
[CreateJobResponse] -> ShowS
CreateJobResponse -> String
(Int -> CreateJobResponse -> ShowS)
-> (CreateJobResponse -> String)
-> ([CreateJobResponse] -> ShowS)
-> Show CreateJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJobResponse] -> ShowS
$cshowList :: [CreateJobResponse] -> ShowS
show :: CreateJobResponse -> String
$cshow :: CreateJobResponse -> String
showsPrec :: Int -> CreateJobResponse -> ShowS
$cshowsPrec :: Int -> CreateJobResponse -> ShowS
Prelude.Show, (forall x. CreateJobResponse -> Rep CreateJobResponse x)
-> (forall x. Rep CreateJobResponse x -> CreateJobResponse)
-> Generic CreateJobResponse
forall x. Rep CreateJobResponse x -> CreateJobResponse
forall x. CreateJobResponse -> Rep CreateJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateJobResponse x -> CreateJobResponse
$cfrom :: forall x. CreateJobResponse -> Rep CreateJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateJobResponse' 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:
--
-- 'jobId', 'createJobResponse_jobId' - The unique identifier you assigned to this job.
--
-- 'jobArn', 'createJobResponse_jobArn' - The job ARN.
--
-- 'description', 'createJobResponse_description' - The job description.
--
-- 'httpStatus', 'createJobResponse_httpStatus' - The response's http status code.
newCreateJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateJobResponse
newCreateJobResponse :: Int -> CreateJobResponse
newCreateJobResponse Int
pHttpStatus_ =
  CreateJobResponse' :: Maybe Text -> Maybe Text -> Maybe Text -> Int -> CreateJobResponse
CreateJobResponse'
    { $sel:jobId:CreateJobResponse' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jobArn:CreateJobResponse' :: Maybe Text
jobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateJobResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateJobResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The job ARN.
createJobResponse_jobArn :: Lens.Lens' CreateJobResponse (Prelude.Maybe Prelude.Text)
createJobResponse_jobArn :: (Maybe Text -> f (Maybe Text))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_jobArn = (CreateJobResponse -> Maybe Text)
-> (CreateJobResponse -> Maybe Text -> CreateJobResponse)
-> Lens
     CreateJobResponse CreateJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe Text
jobArn :: Maybe Text
$sel:jobArn:CreateJobResponse' :: CreateJobResponse -> Maybe Text
jobArn} -> Maybe Text
jobArn) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe Text
a -> CreateJobResponse
s {$sel:jobArn:CreateJobResponse' :: Maybe Text
jobArn = Maybe Text
a} :: CreateJobResponse)

-- | The job description.
createJobResponse_description :: Lens.Lens' CreateJobResponse (Prelude.Maybe Prelude.Text)
createJobResponse_description :: (Maybe Text -> f (Maybe Text))
-> CreateJobResponse -> f CreateJobResponse
createJobResponse_description = (CreateJobResponse -> Maybe Text)
-> (CreateJobResponse -> Maybe Text -> CreateJobResponse)
-> Lens
     CreateJobResponse CreateJobResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Maybe Text
description :: Maybe Text
$sel:description:CreateJobResponse' :: CreateJobResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateJobResponse
s@CreateJobResponse' {} Maybe Text
a -> CreateJobResponse
s {$sel:description:CreateJobResponse' :: Maybe Text
description = Maybe Text
a} :: CreateJobResponse)

-- | The response's http status code.
createJobResponse_httpStatus :: Lens.Lens' CreateJobResponse Prelude.Int
createJobResponse_httpStatus :: (Int -> f Int) -> CreateJobResponse -> f CreateJobResponse
createJobResponse_httpStatus = (CreateJobResponse -> Int)
-> (CreateJobResponse -> Int -> CreateJobResponse)
-> Lens CreateJobResponse CreateJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateJobResponse' :: CreateJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateJobResponse
s@CreateJobResponse' {} Int
a -> CreateJobResponse
s {$sel:httpStatus:CreateJobResponse' :: Int
httpStatus = Int
a} :: CreateJobResponse)

instance Prelude.NFData CreateJobResponse