{-# 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.RegisterJobDefinition
-- 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)
--
-- Registers an Batch job definition.
module Amazonka.Batch.RegisterJobDefinition
  ( -- * Creating a Request
    RegisterJobDefinition (..),
    newRegisterJobDefinition,

    -- * Request Lenses
    registerJobDefinition_propagateTags,
    registerJobDefinition_retryStrategy,
    registerJobDefinition_platformCapabilities,
    registerJobDefinition_parameters,
    registerJobDefinition_timeout,
    registerJobDefinition_containerProperties,
    registerJobDefinition_nodeProperties,
    registerJobDefinition_tags,
    registerJobDefinition_jobDefinitionName,
    registerJobDefinition_type,

    -- * Destructuring the Response
    RegisterJobDefinitionResponse (..),
    newRegisterJobDefinitionResponse,

    -- * Response Lenses
    registerJobDefinitionResponse_httpStatus,
    registerJobDefinitionResponse_jobDefinitionName,
    registerJobDefinitionResponse_jobDefinitionArn,
    registerJobDefinitionResponse_revision,
  )
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 @RegisterJobDefinition@.
--
-- /See:/ 'newRegisterJobDefinition' smart constructor.
data RegisterJobDefinition = RegisterJobDefinition'
  { -- | 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
    -- are not 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.
    RegisterJobDefinition -> Maybe Bool
propagateTags :: Prelude.Maybe Prelude.Bool,
    -- | The retry strategy to use for failed jobs that are submitted with this
    -- job definition. Any retry strategy that\'s specified during a SubmitJob
    -- operation overrides the retry strategy defined here. If a job is
    -- terminated due to a timeout, it isn\'t retried.
    RegisterJobDefinition -> Maybe RetryStrategy
retryStrategy :: Prelude.Maybe RetryStrategy,
    -- | The platform capabilities required by the job definition. If no value is
    -- specified, it defaults to @EC2@. To run the job on Fargate resources,
    -- specify @FARGATE@.
    RegisterJobDefinition -> Maybe [PlatformCapability]
platformCapabilities :: Prelude.Maybe [PlatformCapability],
    -- | Default parameter substitution placeholders to set in the job
    -- definition. Parameters are specified as a key-value pair mapping.
    -- Parameters in a @SubmitJob@ request override any corresponding parameter
    -- defaults from the job definition.
    RegisterJobDefinition -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The timeout configuration for jobs that are submitted with this job
    -- definition, after which Batch terminates your jobs if they have not
    -- finished. If a job is terminated due to a timeout, it isn\'t retried.
    -- The minimum value for the timeout is 60 seconds. Any timeout
    -- configuration that\'s specified during a SubmitJob operation overrides
    -- the timeout configuration defined here. For more information, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/job_timeouts.html Job Timeouts>
    -- in the /Batch User Guide/.
    RegisterJobDefinition -> Maybe JobTimeout
timeout :: Prelude.Maybe JobTimeout,
    -- | An object with various properties specific to single-node
    -- container-based jobs. If the job definition\'s @type@ parameter is
    -- @container@, then you must specify either @containerProperties@ or
    -- @nodeProperties@.
    --
    -- If the job runs on Fargate resources, then you must not specify
    -- @nodeProperties@; use only @containerProperties@.
    RegisterJobDefinition -> Maybe ContainerProperties
containerProperties :: Prelude.Maybe ContainerProperties,
    -- | An object with various properties specific to multi-node parallel jobs.
    -- If you specify node properties for a job, it becomes a multi-node
    -- parallel job. For more information, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/multi-node-parallel-jobs.html Multi-node Parallel Jobs>
    -- in the /Batch User Guide/. If the job definition\'s @type@ parameter is
    -- @container@, then you must specify either @containerProperties@ or
    -- @nodeProperties@.
    --
    -- If the job runs on Fargate resources, then you must not specify
    -- @nodeProperties@; use @containerProperties@ instead.
    RegisterJobDefinition -> Maybe NodeProperties
nodeProperties :: Prelude.Maybe NodeProperties,
    -- | The tags that you apply to the job definition 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/batch/latest/userguide/using-tags.html Tagging Amazon Web Services Resources>
    -- in /Batch User Guide/.
    RegisterJobDefinition -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the job definition to register. Up to 128 letters (uppercase
    -- and lowercase), numbers, hyphens, and underscores are allowed.
    RegisterJobDefinition -> Text
jobDefinitionName :: Prelude.Text,
    -- | The type of job definition. For more information about multi-node
    -- parallel jobs, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/multi-node-job-def.html Creating a multi-node parallel job definition>
    -- in the /Batch User Guide/.
    --
    -- If the job is run on Fargate resources, then @multinode@ isn\'t
    -- supported.
    RegisterJobDefinition -> JobDefinitionType
type' :: JobDefinitionType
  }
  deriving (RegisterJobDefinition -> RegisterJobDefinition -> Bool
(RegisterJobDefinition -> RegisterJobDefinition -> Bool)
-> (RegisterJobDefinition -> RegisterJobDefinition -> Bool)
-> Eq RegisterJobDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterJobDefinition -> RegisterJobDefinition -> Bool
$c/= :: RegisterJobDefinition -> RegisterJobDefinition -> Bool
== :: RegisterJobDefinition -> RegisterJobDefinition -> Bool
$c== :: RegisterJobDefinition -> RegisterJobDefinition -> Bool
Prelude.Eq, ReadPrec [RegisterJobDefinition]
ReadPrec RegisterJobDefinition
Int -> ReadS RegisterJobDefinition
ReadS [RegisterJobDefinition]
(Int -> ReadS RegisterJobDefinition)
-> ReadS [RegisterJobDefinition]
-> ReadPrec RegisterJobDefinition
-> ReadPrec [RegisterJobDefinition]
-> Read RegisterJobDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterJobDefinition]
$creadListPrec :: ReadPrec [RegisterJobDefinition]
readPrec :: ReadPrec RegisterJobDefinition
$creadPrec :: ReadPrec RegisterJobDefinition
readList :: ReadS [RegisterJobDefinition]
$creadList :: ReadS [RegisterJobDefinition]
readsPrec :: Int -> ReadS RegisterJobDefinition
$creadsPrec :: Int -> ReadS RegisterJobDefinition
Prelude.Read, Int -> RegisterJobDefinition -> ShowS
[RegisterJobDefinition] -> ShowS
RegisterJobDefinition -> String
(Int -> RegisterJobDefinition -> ShowS)
-> (RegisterJobDefinition -> String)
-> ([RegisterJobDefinition] -> ShowS)
-> Show RegisterJobDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterJobDefinition] -> ShowS
$cshowList :: [RegisterJobDefinition] -> ShowS
show :: RegisterJobDefinition -> String
$cshow :: RegisterJobDefinition -> String
showsPrec :: Int -> RegisterJobDefinition -> ShowS
$cshowsPrec :: Int -> RegisterJobDefinition -> ShowS
Prelude.Show, (forall x. RegisterJobDefinition -> Rep RegisterJobDefinition x)
-> (forall x. Rep RegisterJobDefinition x -> RegisterJobDefinition)
-> Generic RegisterJobDefinition
forall x. Rep RegisterJobDefinition x -> RegisterJobDefinition
forall x. RegisterJobDefinition -> Rep RegisterJobDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterJobDefinition x -> RegisterJobDefinition
$cfrom :: forall x. RegisterJobDefinition -> Rep RegisterJobDefinition x
Prelude.Generic)

-- |
-- Create a value of 'RegisterJobDefinition' 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:
--
-- 'propagateTags', 'registerJobDefinition_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
-- are not 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.
--
-- 'retryStrategy', 'registerJobDefinition_retryStrategy' - The retry strategy to use for failed jobs that are submitted with this
-- job definition. Any retry strategy that\'s specified during a SubmitJob
-- operation overrides the retry strategy defined here. If a job is
-- terminated due to a timeout, it isn\'t retried.
--
-- 'platformCapabilities', 'registerJobDefinition_platformCapabilities' - The platform capabilities required by the job definition. If no value is
-- specified, it defaults to @EC2@. To run the job on Fargate resources,
-- specify @FARGATE@.
--
-- 'parameters', 'registerJobDefinition_parameters' - Default parameter substitution placeholders to set in the job
-- definition. Parameters are specified as a key-value pair mapping.
-- Parameters in a @SubmitJob@ request override any corresponding parameter
-- defaults from the job definition.
--
-- 'timeout', 'registerJobDefinition_timeout' - The timeout configuration for jobs that are submitted with this job
-- definition, after which Batch terminates your jobs if they have not
-- finished. If a job is terminated due to a timeout, it isn\'t retried.
-- The minimum value for the timeout is 60 seconds. Any timeout
-- configuration that\'s specified during a SubmitJob operation overrides
-- the timeout configuration defined here. For more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/job_timeouts.html Job Timeouts>
-- in the /Batch User Guide/.
--
-- 'containerProperties', 'registerJobDefinition_containerProperties' - An object with various properties specific to single-node
-- container-based jobs. If the job definition\'s @type@ parameter is
-- @container@, then you must specify either @containerProperties@ or
-- @nodeProperties@.
--
-- If the job runs on Fargate resources, then you must not specify
-- @nodeProperties@; use only @containerProperties@.
--
-- 'nodeProperties', 'registerJobDefinition_nodeProperties' - An object with various properties specific to multi-node parallel jobs.
-- If you specify node properties for a job, it becomes a multi-node
-- parallel job. For more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/multi-node-parallel-jobs.html Multi-node Parallel Jobs>
-- in the /Batch User Guide/. If the job definition\'s @type@ parameter is
-- @container@, then you must specify either @containerProperties@ or
-- @nodeProperties@.
--
-- If the job runs on Fargate resources, then you must not specify
-- @nodeProperties@; use @containerProperties@ instead.
--
-- 'tags', 'registerJobDefinition_tags' - The tags that you apply to the job definition 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/batch/latest/userguide/using-tags.html Tagging Amazon Web Services Resources>
-- in /Batch User Guide/.
--
-- 'jobDefinitionName', 'registerJobDefinition_jobDefinitionName' - The name of the job definition to register. Up to 128 letters (uppercase
-- and lowercase), numbers, hyphens, and underscores are allowed.
--
-- 'type'', 'registerJobDefinition_type' - The type of job definition. For more information about multi-node
-- parallel jobs, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/multi-node-job-def.html Creating a multi-node parallel job definition>
-- in the /Batch User Guide/.
--
-- If the job is run on Fargate resources, then @multinode@ isn\'t
-- supported.
newRegisterJobDefinition ::
  -- | 'jobDefinitionName'
  Prelude.Text ->
  -- | 'type''
  JobDefinitionType ->
  RegisterJobDefinition
newRegisterJobDefinition :: Text -> JobDefinitionType -> RegisterJobDefinition
newRegisterJobDefinition Text
pJobDefinitionName_ JobDefinitionType
pType_ =
  RegisterJobDefinition' :: Maybe Bool
-> Maybe RetryStrategy
-> Maybe [PlatformCapability]
-> Maybe (HashMap Text Text)
-> Maybe JobTimeout
-> Maybe ContainerProperties
-> Maybe NodeProperties
-> Maybe (HashMap Text Text)
-> Text
-> JobDefinitionType
-> RegisterJobDefinition
RegisterJobDefinition'
    { $sel:propagateTags:RegisterJobDefinition' :: Maybe Bool
propagateTags =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:retryStrategy:RegisterJobDefinition' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
forall a. Maybe a
Prelude.Nothing,
      $sel:platformCapabilities:RegisterJobDefinition' :: Maybe [PlatformCapability]
platformCapabilities = Maybe [PlatformCapability]
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:RegisterJobDefinition' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:RegisterJobDefinition' :: Maybe JobTimeout
timeout = Maybe JobTimeout
forall a. Maybe a
Prelude.Nothing,
      $sel:containerProperties:RegisterJobDefinition' :: Maybe ContainerProperties
containerProperties = Maybe ContainerProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:nodeProperties:RegisterJobDefinition' :: Maybe NodeProperties
nodeProperties = Maybe NodeProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:RegisterJobDefinition' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:jobDefinitionName:RegisterJobDefinition' :: Text
jobDefinitionName = Text
pJobDefinitionName_,
      $sel:type':RegisterJobDefinition' :: JobDefinitionType
type' = JobDefinitionType
pType_
    }

-- | 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
-- are not 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.
registerJobDefinition_propagateTags :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe Prelude.Bool)
registerJobDefinition_propagateTags :: (Maybe Bool -> f (Maybe Bool))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_propagateTags = (RegisterJobDefinition -> Maybe Bool)
-> (RegisterJobDefinition -> Maybe Bool -> RegisterJobDefinition)
-> Lens
     RegisterJobDefinition
     RegisterJobDefinition
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe Bool
propagateTags :: Maybe Bool
$sel:propagateTags:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe Bool
propagateTags} -> Maybe Bool
propagateTags) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe Bool
a -> RegisterJobDefinition
s {$sel:propagateTags:RegisterJobDefinition' :: Maybe Bool
propagateTags = Maybe Bool
a} :: RegisterJobDefinition)

-- | The retry strategy to use for failed jobs that are submitted with this
-- job definition. Any retry strategy that\'s specified during a SubmitJob
-- operation overrides the retry strategy defined here. If a job is
-- terminated due to a timeout, it isn\'t retried.
registerJobDefinition_retryStrategy :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe RetryStrategy)
registerJobDefinition_retryStrategy :: (Maybe RetryStrategy -> f (Maybe RetryStrategy))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_retryStrategy = (RegisterJobDefinition -> Maybe RetryStrategy)
-> (RegisterJobDefinition
    -> Maybe RetryStrategy -> RegisterJobDefinition)
-> Lens
     RegisterJobDefinition
     RegisterJobDefinition
     (Maybe RetryStrategy)
     (Maybe RetryStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe RetryStrategy
retryStrategy :: Maybe RetryStrategy
$sel:retryStrategy:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe RetryStrategy
retryStrategy} -> Maybe RetryStrategy
retryStrategy) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe RetryStrategy
a -> RegisterJobDefinition
s {$sel:retryStrategy:RegisterJobDefinition' :: Maybe RetryStrategy
retryStrategy = Maybe RetryStrategy
a} :: RegisterJobDefinition)

-- | The platform capabilities required by the job definition. If no value is
-- specified, it defaults to @EC2@. To run the job on Fargate resources,
-- specify @FARGATE@.
registerJobDefinition_platformCapabilities :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe [PlatformCapability])
registerJobDefinition_platformCapabilities :: (Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_platformCapabilities = (RegisterJobDefinition -> Maybe [PlatformCapability])
-> (RegisterJobDefinition
    -> Maybe [PlatformCapability] -> RegisterJobDefinition)
-> Lens
     RegisterJobDefinition
     RegisterJobDefinition
     (Maybe [PlatformCapability])
     (Maybe [PlatformCapability])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe [PlatformCapability]
platformCapabilities :: Maybe [PlatformCapability]
$sel:platformCapabilities:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe [PlatformCapability]
platformCapabilities} -> Maybe [PlatformCapability]
platformCapabilities) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe [PlatformCapability]
a -> RegisterJobDefinition
s {$sel:platformCapabilities:RegisterJobDefinition' :: Maybe [PlatformCapability]
platformCapabilities = Maybe [PlatformCapability]
a} :: RegisterJobDefinition) ((Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
 -> RegisterJobDefinition -> f RegisterJobDefinition)
-> ((Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
    -> Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> (Maybe [PlatformCapability] -> f (Maybe [PlatformCapability]))
-> RegisterJobDefinition
-> f RegisterJobDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlatformCapability]
  [PlatformCapability]
  [PlatformCapability]
  [PlatformCapability]
-> Iso
     (Maybe [PlatformCapability])
     (Maybe [PlatformCapability])
     (Maybe [PlatformCapability])
     (Maybe [PlatformCapability])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [PlatformCapability]
  [PlatformCapability]
  [PlatformCapability]
  [PlatformCapability]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Default parameter substitution placeholders to set in the job
-- definition. Parameters are specified as a key-value pair mapping.
-- Parameters in a @SubmitJob@ request override any corresponding parameter
-- defaults from the job definition.
registerJobDefinition_parameters :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
registerJobDefinition_parameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_parameters = (RegisterJobDefinition -> Maybe (HashMap Text Text))
-> (RegisterJobDefinition
    -> Maybe (HashMap Text Text) -> RegisterJobDefinition)
-> Lens
     RegisterJobDefinition
     RegisterJobDefinition
     (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 (\RegisterJobDefinition' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe (HashMap Text Text)
a -> RegisterJobDefinition
s {$sel:parameters:RegisterJobDefinition' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: RegisterJobDefinition) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> RegisterJobDefinition -> f RegisterJobDefinition)
-> ((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)))
-> RegisterJobDefinition
-> f RegisterJobDefinition
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 timeout configuration for jobs that are submitted with this job
-- definition, after which Batch terminates your jobs if they have not
-- finished. If a job is terminated due to a timeout, it isn\'t retried.
-- The minimum value for the timeout is 60 seconds. Any timeout
-- configuration that\'s specified during a SubmitJob operation overrides
-- the timeout configuration defined here. For more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/job_timeouts.html Job Timeouts>
-- in the /Batch User Guide/.
registerJobDefinition_timeout :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe JobTimeout)
registerJobDefinition_timeout :: (Maybe JobTimeout -> f (Maybe JobTimeout))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_timeout = (RegisterJobDefinition -> Maybe JobTimeout)
-> (RegisterJobDefinition
    -> Maybe JobTimeout -> RegisterJobDefinition)
-> Lens
     RegisterJobDefinition
     RegisterJobDefinition
     (Maybe JobTimeout)
     (Maybe JobTimeout)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe JobTimeout
timeout :: Maybe JobTimeout
$sel:timeout:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe JobTimeout
timeout} -> Maybe JobTimeout
timeout) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe JobTimeout
a -> RegisterJobDefinition
s {$sel:timeout:RegisterJobDefinition' :: Maybe JobTimeout
timeout = Maybe JobTimeout
a} :: RegisterJobDefinition)

-- | An object with various properties specific to single-node
-- container-based jobs. If the job definition\'s @type@ parameter is
-- @container@, then you must specify either @containerProperties@ or
-- @nodeProperties@.
--
-- If the job runs on Fargate resources, then you must not specify
-- @nodeProperties@; use only @containerProperties@.
registerJobDefinition_containerProperties :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe ContainerProperties)
registerJobDefinition_containerProperties :: (Maybe ContainerProperties -> f (Maybe ContainerProperties))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_containerProperties = (RegisterJobDefinition -> Maybe ContainerProperties)
-> (RegisterJobDefinition
    -> Maybe ContainerProperties -> RegisterJobDefinition)
-> Lens
     RegisterJobDefinition
     RegisterJobDefinition
     (Maybe ContainerProperties)
     (Maybe ContainerProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe ContainerProperties
containerProperties :: Maybe ContainerProperties
$sel:containerProperties:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe ContainerProperties
containerProperties} -> Maybe ContainerProperties
containerProperties) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe ContainerProperties
a -> RegisterJobDefinition
s {$sel:containerProperties:RegisterJobDefinition' :: Maybe ContainerProperties
containerProperties = Maybe ContainerProperties
a} :: RegisterJobDefinition)

-- | An object with various properties specific to multi-node parallel jobs.
-- If you specify node properties for a job, it becomes a multi-node
-- parallel job. For more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/multi-node-parallel-jobs.html Multi-node Parallel Jobs>
-- in the /Batch User Guide/. If the job definition\'s @type@ parameter is
-- @container@, then you must specify either @containerProperties@ or
-- @nodeProperties@.
--
-- If the job runs on Fargate resources, then you must not specify
-- @nodeProperties@; use @containerProperties@ instead.
registerJobDefinition_nodeProperties :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe NodeProperties)
registerJobDefinition_nodeProperties :: (Maybe NodeProperties -> f (Maybe NodeProperties))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_nodeProperties = (RegisterJobDefinition -> Maybe NodeProperties)
-> (RegisterJobDefinition
    -> Maybe NodeProperties -> RegisterJobDefinition)
-> Lens
     RegisterJobDefinition
     RegisterJobDefinition
     (Maybe NodeProperties)
     (Maybe NodeProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Maybe NodeProperties
nodeProperties :: Maybe NodeProperties
$sel:nodeProperties:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe NodeProperties
nodeProperties} -> Maybe NodeProperties
nodeProperties) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe NodeProperties
a -> RegisterJobDefinition
s {$sel:nodeProperties:RegisterJobDefinition' :: Maybe NodeProperties
nodeProperties = Maybe NodeProperties
a} :: RegisterJobDefinition)

-- | The tags that you apply to the job definition 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/batch/latest/userguide/using-tags.html Tagging Amazon Web Services Resources>
-- in /Batch User Guide/.
registerJobDefinition_tags :: Lens.Lens' RegisterJobDefinition (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
registerJobDefinition_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_tags = (RegisterJobDefinition -> Maybe (HashMap Text Text))
-> (RegisterJobDefinition
    -> Maybe (HashMap Text Text) -> RegisterJobDefinition)
-> Lens
     RegisterJobDefinition
     RegisterJobDefinition
     (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 (\RegisterJobDefinition' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Maybe (HashMap Text Text)
a -> RegisterJobDefinition
s {$sel:tags:RegisterJobDefinition' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: RegisterJobDefinition) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> RegisterJobDefinition -> f RegisterJobDefinition)
-> ((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)))
-> RegisterJobDefinition
-> f RegisterJobDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the job definition to register. Up to 128 letters (uppercase
-- and lowercase), numbers, hyphens, and underscores are allowed.
registerJobDefinition_jobDefinitionName :: Lens.Lens' RegisterJobDefinition Prelude.Text
registerJobDefinition_jobDefinitionName :: (Text -> f Text)
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_jobDefinitionName = (RegisterJobDefinition -> Text)
-> (RegisterJobDefinition -> Text -> RegisterJobDefinition)
-> Lens RegisterJobDefinition RegisterJobDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {Text
jobDefinitionName :: Text
$sel:jobDefinitionName:RegisterJobDefinition' :: RegisterJobDefinition -> Text
jobDefinitionName} -> Text
jobDefinitionName) (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} Text
a -> RegisterJobDefinition
s {$sel:jobDefinitionName:RegisterJobDefinition' :: Text
jobDefinitionName = Text
a} :: RegisterJobDefinition)

-- | The type of job definition. For more information about multi-node
-- parallel jobs, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/multi-node-job-def.html Creating a multi-node parallel job definition>
-- in the /Batch User Guide/.
--
-- If the job is run on Fargate resources, then @multinode@ isn\'t
-- supported.
registerJobDefinition_type :: Lens.Lens' RegisterJobDefinition JobDefinitionType
registerJobDefinition_type :: (JobDefinitionType -> f JobDefinitionType)
-> RegisterJobDefinition -> f RegisterJobDefinition
registerJobDefinition_type = (RegisterJobDefinition -> JobDefinitionType)
-> (RegisterJobDefinition
    -> JobDefinitionType -> RegisterJobDefinition)
-> Lens
     RegisterJobDefinition
     RegisterJobDefinition
     JobDefinitionType
     JobDefinitionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinition' {JobDefinitionType
type' :: JobDefinitionType
$sel:type':RegisterJobDefinition' :: RegisterJobDefinition -> JobDefinitionType
type'} -> JobDefinitionType
type') (\s :: RegisterJobDefinition
s@RegisterJobDefinition' {} JobDefinitionType
a -> RegisterJobDefinition
s {$sel:type':RegisterJobDefinition' :: JobDefinitionType
type' = JobDefinitionType
a} :: RegisterJobDefinition)

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

instance Prelude.Hashable RegisterJobDefinition

instance Prelude.NFData RegisterJobDefinition

instance Core.ToHeaders RegisterJobDefinition where
  toHeaders :: RegisterJobDefinition -> ResponseHeaders
toHeaders =
    ResponseHeaders -> RegisterJobDefinition -> 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 RegisterJobDefinition where
  toJSON :: RegisterJobDefinition -> Value
toJSON RegisterJobDefinition' {Maybe Bool
Maybe [PlatformCapability]
Maybe (HashMap Text Text)
Maybe JobTimeout
Maybe RetryStrategy
Maybe ContainerProperties
Maybe NodeProperties
Text
JobDefinitionType
type' :: JobDefinitionType
jobDefinitionName :: Text
tags :: Maybe (HashMap Text Text)
nodeProperties :: Maybe NodeProperties
containerProperties :: Maybe ContainerProperties
timeout :: Maybe JobTimeout
parameters :: Maybe (HashMap Text Text)
platformCapabilities :: Maybe [PlatformCapability]
retryStrategy :: Maybe RetryStrategy
propagateTags :: Maybe Bool
$sel:type':RegisterJobDefinition' :: RegisterJobDefinition -> JobDefinitionType
$sel:jobDefinitionName:RegisterJobDefinition' :: RegisterJobDefinition -> Text
$sel:tags:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe (HashMap Text Text)
$sel:nodeProperties:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe NodeProperties
$sel:containerProperties:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe ContainerProperties
$sel:timeout:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe JobTimeout
$sel:parameters:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe (HashMap Text Text)
$sel:platformCapabilities:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe [PlatformCapability]
$sel:retryStrategy:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe RetryStrategy
$sel:propagateTags:RegisterJobDefinition' :: RegisterJobDefinition -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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
"platformCapabilities" Text -> [PlatformCapability] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([PlatformCapability] -> Pair)
-> Maybe [PlatformCapability] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlatformCapability]
platformCapabilities,
            (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
"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
"containerProperties" Text -> ContainerProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ContainerProperties -> Pair)
-> Maybe ContainerProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContainerProperties
containerProperties,
            (Text
"nodeProperties" Text -> NodeProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (NodeProperties -> Pair) -> Maybe NodeProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NodeProperties
nodeProperties,
            (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
"jobDefinitionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobDefinitionName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> JobDefinitionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= JobDefinitionType
type')
          ]
      )

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

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

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

-- |
-- Create a value of 'RegisterJobDefinitionResponse' 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:
--
-- 'httpStatus', 'registerJobDefinitionResponse_httpStatus' - The response's http status code.
--
-- 'jobDefinitionName', 'registerJobDefinitionResponse_jobDefinitionName' - The name of the job definition.
--
-- 'jobDefinitionArn', 'registerJobDefinitionResponse_jobDefinitionArn' - The Amazon Resource Name (ARN) of the job definition.
--
-- 'revision', 'registerJobDefinitionResponse_revision' - The revision of the job definition.
newRegisterJobDefinitionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'jobDefinitionName'
  Prelude.Text ->
  -- | 'jobDefinitionArn'
  Prelude.Text ->
  -- | 'revision'
  Prelude.Int ->
  RegisterJobDefinitionResponse
newRegisterJobDefinitionResponse :: Int -> Text -> Text -> Int -> RegisterJobDefinitionResponse
newRegisterJobDefinitionResponse
  Int
pHttpStatus_
  Text
pJobDefinitionName_
  Text
pJobDefinitionArn_
  Int
pRevision_ =
    RegisterJobDefinitionResponse' :: Int -> Text -> Text -> Int -> RegisterJobDefinitionResponse
RegisterJobDefinitionResponse'
      { $sel:httpStatus:RegisterJobDefinitionResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:jobDefinitionName:RegisterJobDefinitionResponse' :: Text
jobDefinitionName = Text
pJobDefinitionName_,
        $sel:jobDefinitionArn:RegisterJobDefinitionResponse' :: Text
jobDefinitionArn = Text
pJobDefinitionArn_,
        $sel:revision:RegisterJobDefinitionResponse' :: Int
revision = Int
pRevision_
      }

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

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

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

-- | The revision of the job definition.
registerJobDefinitionResponse_revision :: Lens.Lens' RegisterJobDefinitionResponse Prelude.Int
registerJobDefinitionResponse_revision :: (Int -> f Int)
-> RegisterJobDefinitionResponse -> f RegisterJobDefinitionResponse
registerJobDefinitionResponse_revision = (RegisterJobDefinitionResponse -> Int)
-> (RegisterJobDefinitionResponse
    -> Int -> RegisterJobDefinitionResponse)
-> Lens
     RegisterJobDefinitionResponse RegisterJobDefinitionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterJobDefinitionResponse' {Int
revision :: Int
$sel:revision:RegisterJobDefinitionResponse' :: RegisterJobDefinitionResponse -> Int
revision} -> Int
revision) (\s :: RegisterJobDefinitionResponse
s@RegisterJobDefinitionResponse' {} Int
a -> RegisterJobDefinitionResponse
s {$sel:revision:RegisterJobDefinitionResponse' :: Int
revision = Int
a} :: RegisterJobDefinitionResponse)

instance Prelude.NFData RegisterJobDefinitionResponse