{-# 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.Batch.SubmitJob
-- 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)
--
-- Submits an Batch job from a job definition. Parameters that are
-- specified during SubmitJob override parameters defined in the job
-- definition. vCPU and memory requirements that are specified in the
-- @ResourceRequirements@ objects in the job definition are the exception.
-- They can\'t be overridden this way using the @memory@ and @vcpus@
-- parameters. Rather, you must specify updates to job definition
-- parameters in a @ResourceRequirements@ object that\'s included in the
-- @containerOverrides@ parameter.
--
-- Jobs that run on Fargate resources can\'t be guaranteed to run for more
-- than 14 days. This is because, after 14 days, Fargate resources might
-- become unavailable and job might be terminated.
module Amazonka.Batch.SubmitJob
  ( -- * Creating a Request
    SubmitJob (..),
    newSubmitJob,

    -- * Request Lenses
    submitJob_nodeOverrides,
    submitJob_propagateTags,
    submitJob_containerOverrides,
    submitJob_retryStrategy,
    submitJob_dependsOn,
    submitJob_parameters,
    submitJob_arrayProperties,
    submitJob_timeout,
    submitJob_tags,
    submitJob_jobName,
    submitJob_jobQueue,
    submitJob_jobDefinition,

    -- * Destructuring the Response
    SubmitJobResponse (..),
    newSubmitJobResponse,

    -- * Response Lenses
    submitJobResponse_jobArn,
    submitJobResponse_httpStatus,
    submitJobResponse_jobName,
    submitJobResponse_jobId,
  )
where

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

-- | Contains the parameters for @SubmitJob@.
--
-- /See:/ 'newSubmitJob' smart constructor.
data SubmitJob = SubmitJob'
  { -- | A list of node overrides in JSON format that specify the node range to
    -- target and the container overrides for that node range.
    --
    -- This parameter isn\'t applicable to jobs that are running on Fargate
    -- resources; use @containerOverrides@ instead.
    SubmitJob -> Maybe NodeOverrides
nodeOverrides :: Prelude.Maybe NodeOverrides,
    -- | 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.
    -- When specified, this overrides the tag propagation setting in the job
    -- definition.
    SubmitJob -> Maybe Bool
propagateTags :: Prelude.Maybe Prelude.Bool,
    -- | A list of container overrides in the JSON format that specify the name
    -- of a container in the specified job definition and the overrides it
    -- should receive. You can override the default command for a container,
    -- which is specified in the job definition or the Docker image, with a
    -- @command@ override. You can also override existing environment variables
    -- on a container or add new environment variables to it with an
    -- @environment@ override.
    SubmitJob -> Maybe ContainerOverrides
containerOverrides :: Prelude.Maybe ContainerOverrides,
    -- | The retry strategy to use for failed jobs from this SubmitJob operation.
    -- When a retry strategy is specified here, it overrides the retry strategy
    -- defined in the job definition.
    SubmitJob -> Maybe RetryStrategy
retryStrategy :: Prelude.Maybe RetryStrategy,
    -- | A list of dependencies for the job. A job can depend upon a maximum of
    -- 20 jobs. You can specify a @SEQUENTIAL@ type dependency without
    -- specifying a job ID for array jobs so that each child array job
    -- completes sequentially, starting at index 0. You can also specify an
    -- @N_TO_N@ type dependency with a job ID for array jobs. In that case,
    -- each index child of this job must wait for the corresponding index child
    -- of each dependency to complete before it can begin.
    SubmitJob -> Maybe [JobDependency]
dependsOn :: Prelude.Maybe [JobDependency],
    -- | Additional parameters passed to the job that replace parameter
    -- substitution placeholders that are set in the job definition. Parameters
    -- are specified as a key and value pair mapping. Parameters in a
    -- @SubmitJob@ request override any corresponding parameter defaults from
    -- the job definition.
    SubmitJob -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The array properties for the submitted job, such as the size of the
    -- array. The array size can be between 2 and 10,000. If you specify array
    -- properties for a job, it becomes an array job. For more information, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/array_jobs.html Array Jobs>
    -- in the /Batch User Guide/.
    SubmitJob -> Maybe ArrayProperties
arrayProperties :: Prelude.Maybe ArrayProperties,
    -- | The timeout configuration for this SubmitJob operation. You can specify
    -- a timeout duration after which Batch terminates your jobs if they
    -- haven\'t finished. If a job is terminated due to a timeout, it isn\'t
    -- retried. The minimum value for the timeout is 60 seconds. This
    -- configuration overrides any timeout configuration specified in the job
    -- definition. For array jobs, child jobs have the same timeout
    -- configuration as the parent job. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html Job Timeouts>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    SubmitJob -> Maybe JobTimeout
timeout :: Prelude.Maybe JobTimeout,
    -- | The tags that you apply to the job request to help you categorize and
    -- organize your resources. Each tag consists of a key and an optional
    -- value. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
    -- in /Amazon Web Services General Reference/.
    SubmitJob -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the job. The first character must be alphanumeric, and up to
    -- 128 letters (uppercase and lowercase), numbers, hyphens, and underscores
    -- are allowed.
    SubmitJob -> Text
jobName :: Prelude.Text,
    -- | The job queue where the job is submitted. You can specify either the
    -- name or the Amazon Resource Name (ARN) of the queue.
    SubmitJob -> Text
jobQueue :: Prelude.Text,
    -- | The job definition used by this job. This value can be one of @name@,
    -- @name:revision@, or the Amazon Resource Name (ARN) for the job
    -- definition. If @name@ is specified without a revision then the latest
    -- active revision is used.
    SubmitJob -> Text
jobDefinition :: Prelude.Text
  }
  deriving (SubmitJob -> SubmitJob -> Bool
(SubmitJob -> SubmitJob -> Bool)
-> (SubmitJob -> SubmitJob -> Bool) -> Eq SubmitJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubmitJob -> SubmitJob -> Bool
$c/= :: SubmitJob -> SubmitJob -> Bool
== :: SubmitJob -> SubmitJob -> Bool
$c== :: SubmitJob -> SubmitJob -> Bool
Prelude.Eq, ReadPrec [SubmitJob]
ReadPrec SubmitJob
Int -> ReadS SubmitJob
ReadS [SubmitJob]
(Int -> ReadS SubmitJob)
-> ReadS [SubmitJob]
-> ReadPrec SubmitJob
-> ReadPrec [SubmitJob]
-> Read SubmitJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubmitJob]
$creadListPrec :: ReadPrec [SubmitJob]
readPrec :: ReadPrec SubmitJob
$creadPrec :: ReadPrec SubmitJob
readList :: ReadS [SubmitJob]
$creadList :: ReadS [SubmitJob]
readsPrec :: Int -> ReadS SubmitJob
$creadsPrec :: Int -> ReadS SubmitJob
Prelude.Read, Int -> SubmitJob -> ShowS
[SubmitJob] -> ShowS
SubmitJob -> String
(Int -> SubmitJob -> ShowS)
-> (SubmitJob -> String)
-> ([SubmitJob] -> ShowS)
-> Show SubmitJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubmitJob] -> ShowS
$cshowList :: [SubmitJob] -> ShowS
show :: SubmitJob -> String
$cshow :: SubmitJob -> String
showsPrec :: Int -> SubmitJob -> ShowS
$cshowsPrec :: Int -> SubmitJob -> ShowS
Prelude.Show, (forall x. SubmitJob -> Rep SubmitJob x)
-> (forall x. Rep SubmitJob x -> SubmitJob) -> Generic SubmitJob
forall x. Rep SubmitJob x -> SubmitJob
forall x. SubmitJob -> Rep SubmitJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubmitJob x -> SubmitJob
$cfrom :: forall x. SubmitJob -> Rep SubmitJob x
Prelude.Generic)

-- |
-- Create a value of 'SubmitJob' 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:
--
-- 'nodeOverrides', 'submitJob_nodeOverrides' - A list of node overrides in JSON format that specify the node range to
-- target and the container overrides for that node range.
--
-- This parameter isn\'t applicable to jobs that are running on Fargate
-- resources; use @containerOverrides@ instead.
--
-- 'propagateTags', 'submitJob_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.
-- When specified, this overrides the tag propagation setting in the job
-- definition.
--
-- 'containerOverrides', 'submitJob_containerOverrides' - A list of container overrides in the JSON format that specify the name
-- of a container in the specified job definition and the overrides it
-- should receive. You can override the default command for a container,
-- which is specified in the job definition or the Docker image, with a
-- @command@ override. You can also override existing environment variables
-- on a container or add new environment variables to it with an
-- @environment@ override.
--
-- 'retryStrategy', 'submitJob_retryStrategy' - The retry strategy to use for failed jobs from this SubmitJob operation.
-- When a retry strategy is specified here, it overrides the retry strategy
-- defined in the job definition.
--
-- 'dependsOn', 'submitJob_dependsOn' - A list of dependencies for the job. A job can depend upon a maximum of
-- 20 jobs. You can specify a @SEQUENTIAL@ type dependency without
-- specifying a job ID for array jobs so that each child array job
-- completes sequentially, starting at index 0. You can also specify an
-- @N_TO_N@ type dependency with a job ID for array jobs. In that case,
-- each index child of this job must wait for the corresponding index child
-- of each dependency to complete before it can begin.
--
-- 'parameters', 'submitJob_parameters' - Additional parameters passed to the job that replace parameter
-- substitution placeholders that are set in the job definition. Parameters
-- are specified as a key and value pair mapping. Parameters in a
-- @SubmitJob@ request override any corresponding parameter defaults from
-- the job definition.
--
-- 'arrayProperties', 'submitJob_arrayProperties' - The array properties for the submitted job, such as the size of the
-- array. The array size can be between 2 and 10,000. If you specify array
-- properties for a job, it becomes an array job. For more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/array_jobs.html Array Jobs>
-- in the /Batch User Guide/.
--
-- 'timeout', 'submitJob_timeout' - The timeout configuration for this SubmitJob operation. You can specify
-- a timeout duration after which Batch terminates your jobs if they
-- haven\'t finished. If a job is terminated due to a timeout, it isn\'t
-- retried. The minimum value for the timeout is 60 seconds. This
-- configuration overrides any timeout configuration specified in the job
-- definition. For array jobs, child jobs have the same timeout
-- configuration as the parent job. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html Job Timeouts>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'tags', 'submitJob_tags' - The tags that you apply to the job request to help you categorize and
-- organize your resources. Each tag consists of a key and an optional
-- value. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
-- in /Amazon Web Services General Reference/.
--
-- 'jobName', 'submitJob_jobName' - The name of the job. The first character must be alphanumeric, and up to
-- 128 letters (uppercase and lowercase), numbers, hyphens, and underscores
-- are allowed.
--
-- 'jobQueue', 'submitJob_jobQueue' - The job queue where the job is submitted. You can specify either the
-- name or the Amazon Resource Name (ARN) of the queue.
--
-- 'jobDefinition', 'submitJob_jobDefinition' - The job definition used by this job. This value can be one of @name@,
-- @name:revision@, or the Amazon Resource Name (ARN) for the job
-- definition. If @name@ is specified without a revision then the latest
-- active revision is used.
newSubmitJob ::
  -- | 'jobName'
  Prelude.Text ->
  -- | 'jobQueue'
  Prelude.Text ->
  -- | 'jobDefinition'
  Prelude.Text ->
  SubmitJob
newSubmitJob :: Text -> Text -> Text -> SubmitJob
newSubmitJob Text
pJobName_ Text
pJobQueue_ Text
pJobDefinition_ =
  SubmitJob' :: Maybe NodeOverrides
-> Maybe Bool
-> Maybe ContainerOverrides
-> Maybe RetryStrategy
-> Maybe [JobDependency]
-> Maybe (HashMap Text Text)
-> Maybe ArrayProperties
-> Maybe JobTimeout
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> SubmitJob
SubmitJob'
    { $sel:nodeOverrides:SubmitJob' :: Maybe NodeOverrides
nodeOverrides = Maybe NodeOverrides
forall a. Maybe a
Prelude.Nothing,
      $sel:propagateTags:SubmitJob' :: Maybe Bool
propagateTags = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:containerOverrides:SubmitJob' :: Maybe ContainerOverrides
containerOverrides = Maybe ContainerOverrides
forall a. Maybe a
Prelude.Nothing,
      $sel:retryStrategy:SubmitJob' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
forall a. Maybe a
Prelude.Nothing,
      $sel:dependsOn:SubmitJob' :: Maybe [JobDependency]
dependsOn = Maybe [JobDependency]
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:SubmitJob' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:arrayProperties:SubmitJob' :: Maybe ArrayProperties
arrayProperties = Maybe ArrayProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:SubmitJob' :: Maybe JobTimeout
timeout = Maybe JobTimeout
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:SubmitJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:jobName:SubmitJob' :: Text
jobName = Text
pJobName_,
      $sel:jobQueue:SubmitJob' :: Text
jobQueue = Text
pJobQueue_,
      $sel:jobDefinition:SubmitJob' :: Text
jobDefinition = Text
pJobDefinition_
    }

-- | A list of node overrides in JSON format that specify the node range to
-- target and the container overrides for that node range.
--
-- This parameter isn\'t applicable to jobs that are running on Fargate
-- resources; use @containerOverrides@ instead.
submitJob_nodeOverrides :: Lens.Lens' SubmitJob (Prelude.Maybe NodeOverrides)
submitJob_nodeOverrides :: (Maybe NodeOverrides -> f (Maybe NodeOverrides))
-> SubmitJob -> f SubmitJob
submitJob_nodeOverrides = (SubmitJob -> Maybe NodeOverrides)
-> (SubmitJob -> Maybe NodeOverrides -> SubmitJob)
-> Lens
     SubmitJob SubmitJob (Maybe NodeOverrides) (Maybe NodeOverrides)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe NodeOverrides
nodeOverrides :: Maybe NodeOverrides
$sel:nodeOverrides:SubmitJob' :: SubmitJob -> Maybe NodeOverrides
nodeOverrides} -> Maybe NodeOverrides
nodeOverrides) (\s :: SubmitJob
s@SubmitJob' {} Maybe NodeOverrides
a -> SubmitJob
s {$sel:nodeOverrides:SubmitJob' :: Maybe NodeOverrides
nodeOverrides = Maybe NodeOverrides
a} :: SubmitJob)

-- | 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.
-- When specified, this overrides the tag propagation setting in the job
-- definition.
submitJob_propagateTags :: Lens.Lens' SubmitJob (Prelude.Maybe Prelude.Bool)
submitJob_propagateTags :: (Maybe Bool -> f (Maybe Bool)) -> SubmitJob -> f SubmitJob
submitJob_propagateTags = (SubmitJob -> Maybe Bool)
-> (SubmitJob -> Maybe Bool -> SubmitJob)
-> Lens SubmitJob SubmitJob (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe Bool
propagateTags :: Maybe Bool
$sel:propagateTags:SubmitJob' :: SubmitJob -> Maybe Bool
propagateTags} -> Maybe Bool
propagateTags) (\s :: SubmitJob
s@SubmitJob' {} Maybe Bool
a -> SubmitJob
s {$sel:propagateTags:SubmitJob' :: Maybe Bool
propagateTags = Maybe Bool
a} :: SubmitJob)

-- | A list of container overrides in the JSON format that specify the name
-- of a container in the specified job definition and the overrides it
-- should receive. You can override the default command for a container,
-- which is specified in the job definition or the Docker image, with a
-- @command@ override. You can also override existing environment variables
-- on a container or add new environment variables to it with an
-- @environment@ override.
submitJob_containerOverrides :: Lens.Lens' SubmitJob (Prelude.Maybe ContainerOverrides)
submitJob_containerOverrides :: (Maybe ContainerOverrides -> f (Maybe ContainerOverrides))
-> SubmitJob -> f SubmitJob
submitJob_containerOverrides = (SubmitJob -> Maybe ContainerOverrides)
-> (SubmitJob -> Maybe ContainerOverrides -> SubmitJob)
-> Lens
     SubmitJob
     SubmitJob
     (Maybe ContainerOverrides)
     (Maybe ContainerOverrides)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe ContainerOverrides
containerOverrides :: Maybe ContainerOverrides
$sel:containerOverrides:SubmitJob' :: SubmitJob -> Maybe ContainerOverrides
containerOverrides} -> Maybe ContainerOverrides
containerOverrides) (\s :: SubmitJob
s@SubmitJob' {} Maybe ContainerOverrides
a -> SubmitJob
s {$sel:containerOverrides:SubmitJob' :: Maybe ContainerOverrides
containerOverrides = Maybe ContainerOverrides
a} :: SubmitJob)

-- | The retry strategy to use for failed jobs from this SubmitJob operation.
-- When a retry strategy is specified here, it overrides the retry strategy
-- defined in the job definition.
submitJob_retryStrategy :: Lens.Lens' SubmitJob (Prelude.Maybe RetryStrategy)
submitJob_retryStrategy :: (Maybe RetryStrategy -> f (Maybe RetryStrategy))
-> SubmitJob -> f SubmitJob
submitJob_retryStrategy = (SubmitJob -> Maybe RetryStrategy)
-> (SubmitJob -> Maybe RetryStrategy -> SubmitJob)
-> Lens
     SubmitJob SubmitJob (Maybe RetryStrategy) (Maybe RetryStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe RetryStrategy
retryStrategy :: Maybe RetryStrategy
$sel:retryStrategy:SubmitJob' :: SubmitJob -> Maybe RetryStrategy
retryStrategy} -> Maybe RetryStrategy
retryStrategy) (\s :: SubmitJob
s@SubmitJob' {} Maybe RetryStrategy
a -> SubmitJob
s {$sel:retryStrategy:SubmitJob' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
a} :: SubmitJob)

-- | A list of dependencies for the job. A job can depend upon a maximum of
-- 20 jobs. You can specify a @SEQUENTIAL@ type dependency without
-- specifying a job ID for array jobs so that each child array job
-- completes sequentially, starting at index 0. You can also specify an
-- @N_TO_N@ type dependency with a job ID for array jobs. In that case,
-- each index child of this job must wait for the corresponding index child
-- of each dependency to complete before it can begin.
submitJob_dependsOn :: Lens.Lens' SubmitJob (Prelude.Maybe [JobDependency])
submitJob_dependsOn :: (Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> SubmitJob -> f SubmitJob
submitJob_dependsOn = (SubmitJob -> Maybe [JobDependency])
-> (SubmitJob -> Maybe [JobDependency] -> SubmitJob)
-> Lens
     SubmitJob SubmitJob (Maybe [JobDependency]) (Maybe [JobDependency])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe [JobDependency]
dependsOn :: Maybe [JobDependency]
$sel:dependsOn:SubmitJob' :: SubmitJob -> Maybe [JobDependency]
dependsOn} -> Maybe [JobDependency]
dependsOn) (\s :: SubmitJob
s@SubmitJob' {} Maybe [JobDependency]
a -> SubmitJob
s {$sel:dependsOn:SubmitJob' :: Maybe [JobDependency]
dependsOn = Maybe [JobDependency]
a} :: SubmitJob) ((Maybe [JobDependency] -> f (Maybe [JobDependency]))
 -> SubmitJob -> f SubmitJob)
-> ((Maybe [JobDependency] -> f (Maybe [JobDependency]))
    -> Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> (Maybe [JobDependency] -> f (Maybe [JobDependency]))
-> SubmitJob
-> f SubmitJob
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

-- | Additional parameters passed to the job that replace parameter
-- substitution placeholders that are set in the job definition. Parameters
-- are specified as a key and value pair mapping. Parameters in a
-- @SubmitJob@ request override any corresponding parameter defaults from
-- the job definition.
submitJob_parameters :: Lens.Lens' SubmitJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
submitJob_parameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SubmitJob -> f SubmitJob
submitJob_parameters = (SubmitJob -> Maybe (HashMap Text Text))
-> (SubmitJob -> Maybe (HashMap Text Text) -> SubmitJob)
-> Lens
     SubmitJob
     SubmitJob
     (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 (\SubmitJob' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:SubmitJob' :: SubmitJob -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: SubmitJob
s@SubmitJob' {} Maybe (HashMap Text Text)
a -> SubmitJob
s {$sel:parameters:SubmitJob' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: SubmitJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> SubmitJob -> f SubmitJob)
-> ((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)))
-> SubmitJob
-> f SubmitJob
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 array properties for the submitted job, such as the size of the
-- array. The array size can be between 2 and 10,000. If you specify array
-- properties for a job, it becomes an array job. For more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/array_jobs.html Array Jobs>
-- in the /Batch User Guide/.
submitJob_arrayProperties :: Lens.Lens' SubmitJob (Prelude.Maybe ArrayProperties)
submitJob_arrayProperties :: (Maybe ArrayProperties -> f (Maybe ArrayProperties))
-> SubmitJob -> f SubmitJob
submitJob_arrayProperties = (SubmitJob -> Maybe ArrayProperties)
-> (SubmitJob -> Maybe ArrayProperties -> SubmitJob)
-> Lens
     SubmitJob SubmitJob (Maybe ArrayProperties) (Maybe ArrayProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe ArrayProperties
arrayProperties :: Maybe ArrayProperties
$sel:arrayProperties:SubmitJob' :: SubmitJob -> Maybe ArrayProperties
arrayProperties} -> Maybe ArrayProperties
arrayProperties) (\s :: SubmitJob
s@SubmitJob' {} Maybe ArrayProperties
a -> SubmitJob
s {$sel:arrayProperties:SubmitJob' :: Maybe ArrayProperties
arrayProperties = Maybe ArrayProperties
a} :: SubmitJob)

-- | The timeout configuration for this SubmitJob operation. You can specify
-- a timeout duration after which Batch terminates your jobs if they
-- haven\'t finished. If a job is terminated due to a timeout, it isn\'t
-- retried. The minimum value for the timeout is 60 seconds. This
-- configuration overrides any timeout configuration specified in the job
-- definition. For array jobs, child jobs have the same timeout
-- configuration as the parent job. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/job_timeouts.html Job Timeouts>
-- in the /Amazon Elastic Container Service Developer Guide/.
submitJob_timeout :: Lens.Lens' SubmitJob (Prelude.Maybe JobTimeout)
submitJob_timeout :: (Maybe JobTimeout -> f (Maybe JobTimeout))
-> SubmitJob -> f SubmitJob
submitJob_timeout = (SubmitJob -> Maybe JobTimeout)
-> (SubmitJob -> Maybe JobTimeout -> SubmitJob)
-> Lens SubmitJob SubmitJob (Maybe JobTimeout) (Maybe JobTimeout)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Maybe JobTimeout
timeout :: Maybe JobTimeout
$sel:timeout:SubmitJob' :: SubmitJob -> Maybe JobTimeout
timeout} -> Maybe JobTimeout
timeout) (\s :: SubmitJob
s@SubmitJob' {} Maybe JobTimeout
a -> SubmitJob
s {$sel:timeout:SubmitJob' :: Maybe JobTimeout
timeout = Maybe JobTimeout
a} :: SubmitJob)

-- | The tags that you apply to the job request to help you categorize and
-- organize your resources. Each tag consists of a key and an optional
-- value. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
-- in /Amazon Web Services General Reference/.
submitJob_tags :: Lens.Lens' SubmitJob (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
submitJob_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SubmitJob -> f SubmitJob
submitJob_tags = (SubmitJob -> Maybe (HashMap Text Text))
-> (SubmitJob -> Maybe (HashMap Text Text) -> SubmitJob)
-> Lens
     SubmitJob
     SubmitJob
     (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 (\SubmitJob' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:SubmitJob' :: SubmitJob -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: SubmitJob
s@SubmitJob' {} Maybe (HashMap Text Text)
a -> SubmitJob
s {$sel:tags:SubmitJob' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: SubmitJob) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> SubmitJob -> f SubmitJob)
-> ((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)))
-> SubmitJob
-> f SubmitJob
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. The first character must be alphanumeric, and up to
-- 128 letters (uppercase and lowercase), numbers, hyphens, and underscores
-- are allowed.
submitJob_jobName :: Lens.Lens' SubmitJob Prelude.Text
submitJob_jobName :: (Text -> f Text) -> SubmitJob -> f SubmitJob
submitJob_jobName = (SubmitJob -> Text)
-> (SubmitJob -> Text -> SubmitJob)
-> Lens SubmitJob SubmitJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Text
jobName :: Text
$sel:jobName:SubmitJob' :: SubmitJob -> Text
jobName} -> Text
jobName) (\s :: SubmitJob
s@SubmitJob' {} Text
a -> SubmitJob
s {$sel:jobName:SubmitJob' :: Text
jobName = Text
a} :: SubmitJob)

-- | The job queue where the job is submitted. You can specify either the
-- name or the Amazon Resource Name (ARN) of the queue.
submitJob_jobQueue :: Lens.Lens' SubmitJob Prelude.Text
submitJob_jobQueue :: (Text -> f Text) -> SubmitJob -> f SubmitJob
submitJob_jobQueue = (SubmitJob -> Text)
-> (SubmitJob -> Text -> SubmitJob)
-> Lens SubmitJob SubmitJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Text
jobQueue :: Text
$sel:jobQueue:SubmitJob' :: SubmitJob -> Text
jobQueue} -> Text
jobQueue) (\s :: SubmitJob
s@SubmitJob' {} Text
a -> SubmitJob
s {$sel:jobQueue:SubmitJob' :: Text
jobQueue = Text
a} :: SubmitJob)

-- | The job definition used by this job. This value can be one of @name@,
-- @name:revision@, or the Amazon Resource Name (ARN) for the job
-- definition. If @name@ is specified without a revision then the latest
-- active revision is used.
submitJob_jobDefinition :: Lens.Lens' SubmitJob Prelude.Text
submitJob_jobDefinition :: (Text -> f Text) -> SubmitJob -> f SubmitJob
submitJob_jobDefinition = (SubmitJob -> Text)
-> (SubmitJob -> Text -> SubmitJob)
-> Lens SubmitJob SubmitJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJob' {Text
jobDefinition :: Text
$sel:jobDefinition:SubmitJob' :: SubmitJob -> Text
jobDefinition} -> Text
jobDefinition) (\s :: SubmitJob
s@SubmitJob' {} Text
a -> SubmitJob
s {$sel:jobDefinition:SubmitJob' :: Text
jobDefinition = Text
a} :: SubmitJob)

instance Core.AWSRequest SubmitJob where
  type AWSResponse SubmitJob = SubmitJobResponse
  request :: SubmitJob -> Request SubmitJob
request = Service -> SubmitJob -> Request SubmitJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SubmitJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SubmitJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse SubmitJob))
-> Logger
-> Service
-> Proxy SubmitJob
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SubmitJob)))
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 -> Int -> Text -> Text -> SubmitJobResponse
SubmitJobResponse'
            (Maybe Text -> Int -> Text -> Text -> SubmitJobResponse)
-> Either String (Maybe Text)
-> Either String (Int -> Text -> Text -> SubmitJobResponse)
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
"jobArn")
            Either String (Int -> Text -> Text -> SubmitJobResponse)
-> Either String Int
-> Either String (Text -> Text -> SubmitJobResponse)
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))
            Either String (Text -> Text -> SubmitJobResponse)
-> Either String Text -> Either String (Text -> SubmitJobResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"jobName")
            Either String (Text -> SubmitJobResponse)
-> Either String Text -> Either String SubmitJobResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"jobId")
      )

instance Prelude.Hashable SubmitJob

instance Prelude.NFData SubmitJob

instance Core.ToHeaders SubmitJob where
  toHeaders :: SubmitJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SubmitJob -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON SubmitJob where
  toJSON :: SubmitJob -> Value
toJSON SubmitJob' {Maybe Bool
Maybe [JobDependency]
Maybe (HashMap Text Text)
Maybe ArrayProperties
Maybe JobTimeout
Maybe ContainerOverrides
Maybe NodeOverrides
Maybe RetryStrategy
Text
jobDefinition :: Text
jobQueue :: Text
jobName :: Text
tags :: Maybe (HashMap Text Text)
timeout :: Maybe JobTimeout
arrayProperties :: Maybe ArrayProperties
parameters :: Maybe (HashMap Text Text)
dependsOn :: Maybe [JobDependency]
retryStrategy :: Maybe RetryStrategy
containerOverrides :: Maybe ContainerOverrides
propagateTags :: Maybe Bool
nodeOverrides :: Maybe NodeOverrides
$sel:jobDefinition:SubmitJob' :: SubmitJob -> Text
$sel:jobQueue:SubmitJob' :: SubmitJob -> Text
$sel:jobName:SubmitJob' :: SubmitJob -> Text
$sel:tags:SubmitJob' :: SubmitJob -> Maybe (HashMap Text Text)
$sel:timeout:SubmitJob' :: SubmitJob -> Maybe JobTimeout
$sel:arrayProperties:SubmitJob' :: SubmitJob -> Maybe ArrayProperties
$sel:parameters:SubmitJob' :: SubmitJob -> Maybe (HashMap Text Text)
$sel:dependsOn:SubmitJob' :: SubmitJob -> Maybe [JobDependency]
$sel:retryStrategy:SubmitJob' :: SubmitJob -> Maybe RetryStrategy
$sel:containerOverrides:SubmitJob' :: SubmitJob -> Maybe ContainerOverrides
$sel:propagateTags:SubmitJob' :: SubmitJob -> Maybe Bool
$sel:nodeOverrides:SubmitJob' :: SubmitJob -> Maybe NodeOverrides
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"nodeOverrides" Text -> NodeOverrides -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NodeOverrides -> Pair) -> Maybe NodeOverrides -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NodeOverrides
nodeOverrides,
            (Text
"propagateTags" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
propagateTags,
            (Text
"containerOverrides" Text -> ContainerOverrides -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ContainerOverrides -> Pair)
-> Maybe ContainerOverrides -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContainerOverrides
containerOverrides,
            (Text
"retryStrategy" Text -> RetryStrategy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RetryStrategy -> Pair) -> Maybe RetryStrategy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RetryStrategy
retryStrategy,
            (Text
"dependsOn" Text -> [JobDependency] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([JobDependency] -> Pair) -> Maybe [JobDependency] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [JobDependency]
dependsOn,
            (Text
"parameters" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
parameters,
            (Text
"arrayProperties" Text -> ArrayProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ArrayProperties -> Pair) -> Maybe ArrayProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ArrayProperties
arrayProperties,
            (Text
"timeout" Text -> JobTimeout -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (JobTimeout -> Pair) -> Maybe JobTimeout -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JobTimeout
timeout,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"jobName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"jobQueue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobQueue),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"jobDefinition" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobDefinition)
          ]
      )

instance Core.ToPath SubmitJob where
  toPath :: SubmitJob -> ByteString
toPath = ByteString -> SubmitJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/submitjob"

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

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

-- |
-- Create a value of 'SubmitJobResponse' 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:
--
-- 'jobArn', 'submitJobResponse_jobArn' - The Amazon Resource Name (ARN) for the job.
--
-- 'httpStatus', 'submitJobResponse_httpStatus' - The response's http status code.
--
-- 'jobName', 'submitJobResponse_jobName' - The name of the job.
--
-- 'jobId', 'submitJobResponse_jobId' - The unique identifier for the job.
newSubmitJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'jobName'
  Prelude.Text ->
  -- | 'jobId'
  Prelude.Text ->
  SubmitJobResponse
newSubmitJobResponse :: Int -> Text -> Text -> SubmitJobResponse
newSubmitJobResponse Int
pHttpStatus_ Text
pJobName_ Text
pJobId_ =
  SubmitJobResponse' :: Maybe Text -> Int -> Text -> Text -> SubmitJobResponse
SubmitJobResponse'
    { $sel:jobArn:SubmitJobResponse' :: Maybe Text
jobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SubmitJobResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:jobName:SubmitJobResponse' :: Text
jobName = Text
pJobName_,
      $sel:jobId:SubmitJobResponse' :: Text
jobId = Text
pJobId_
    }

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

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

-- | The name of the job.
submitJobResponse_jobName :: Lens.Lens' SubmitJobResponse Prelude.Text
submitJobResponse_jobName :: (Text -> f Text) -> SubmitJobResponse -> f SubmitJobResponse
submitJobResponse_jobName = (SubmitJobResponse -> Text)
-> (SubmitJobResponse -> Text -> SubmitJobResponse)
-> Lens SubmitJobResponse SubmitJobResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitJobResponse' {Text
jobName :: Text
$sel:jobName:SubmitJobResponse' :: SubmitJobResponse -> Text
jobName} -> Text
jobName) (\s :: SubmitJobResponse
s@SubmitJobResponse' {} Text
a -> SubmitJobResponse
s {$sel:jobName:SubmitJobResponse' :: Text
jobName = Text
a} :: SubmitJobResponse)

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

instance Prelude.NFData SubmitJobResponse