{-# 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.MediaConvert.CreateJobTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Create a new job template. For information about job templates see the
-- User Guide at
-- http:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/what-is.html
module Amazonka.MediaConvert.CreateJobTemplate
  ( -- * Creating a Request
    CreateJobTemplate (..),
    newCreateJobTemplate,

    -- * Request Lenses
    createJobTemplate_accelerationSettings,
    createJobTemplate_category,
    createJobTemplate_description,
    createJobTemplate_hopDestinations,
    createJobTemplate_priority,
    createJobTemplate_queue,
    createJobTemplate_statusUpdateInterval,
    createJobTemplate_tags,
    createJobTemplate_settings,
    createJobTemplate_name,

    -- * Destructuring the Response
    CreateJobTemplateResponse (..),
    newCreateJobTemplateResponse,

    -- * Response Lenses
    createJobTemplateResponse_jobTemplate,
    createJobTemplateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateJobTemplate' smart constructor.
data CreateJobTemplate = CreateJobTemplate'
  { -- | Accelerated transcoding can significantly speed up jobs with long,
    -- visually complex content. Outputs that use this feature incur pro-tier
    -- pricing. For information about feature limitations, see the AWS
    -- Elemental MediaConvert User Guide.
    CreateJobTemplate -> Maybe AccelerationSettings
accelerationSettings :: Prelude.Maybe AccelerationSettings,
    -- | Optional. A category for the job template you are creating
    CreateJobTemplate -> Maybe Text
category :: Prelude.Maybe Prelude.Text,
    -- | Optional. A description of the job template you are creating.
    CreateJobTemplate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Optional. Use queue hopping to avoid overly long waits in the backlog of
    -- the queue that you submit your job to. Specify an alternate queue and
    -- the maximum time that your job will wait in the initial queue before
    -- hopping. For more information about this feature, see the AWS Elemental
    -- MediaConvert User Guide.
    CreateJobTemplate -> Maybe [HopDestination]
hopDestinations :: Prelude.Maybe [HopDestination],
    -- | Specify the relative priority for this job. In any given queue, the
    -- service begins processing the job with the highest value first. When
    -- more than one job has the same priority, the service begins processing
    -- the job that you submitted first. If you don\'t specify a priority, the
    -- service uses the default value 0.
    CreateJobTemplate -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
    -- | Optional. The queue that jobs created from this template are assigned
    -- to. If you don\'t specify this, jobs will go to the default queue.
    CreateJobTemplate -> Maybe Text
queue :: Prelude.Maybe Prelude.Text,
    -- | Specify how often MediaConvert sends STATUS_UPDATE events to Amazon
    -- CloudWatch Events. Set the interval, in seconds, between status updates.
    -- MediaConvert sends an update at this interval from the time the service
    -- begins processing your job to the time it completes the transcode or
    -- encounters an error.
    CreateJobTemplate -> Maybe StatusUpdateInterval
statusUpdateInterval :: Prelude.Maybe StatusUpdateInterval,
    -- | The tags that you want to add to the resource. You can tag resources
    -- with a key-value pair or with only a key.
    CreateJobTemplate -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | JobTemplateSettings contains all the transcode settings saved in the
    -- template that will be applied to jobs created from it.
    CreateJobTemplate -> JobTemplateSettings
settings :: JobTemplateSettings,
    -- | The name of the job template you are creating.
    CreateJobTemplate -> Text
name :: Prelude.Text
  }
  deriving (CreateJobTemplate -> CreateJobTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJobTemplate -> CreateJobTemplate -> Bool
$c/= :: CreateJobTemplate -> CreateJobTemplate -> Bool
== :: CreateJobTemplate -> CreateJobTemplate -> Bool
$c== :: CreateJobTemplate -> CreateJobTemplate -> Bool
Prelude.Eq, ReadPrec [CreateJobTemplate]
ReadPrec CreateJobTemplate
Int -> ReadS CreateJobTemplate
ReadS [CreateJobTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJobTemplate]
$creadListPrec :: ReadPrec [CreateJobTemplate]
readPrec :: ReadPrec CreateJobTemplate
$creadPrec :: ReadPrec CreateJobTemplate
readList :: ReadS [CreateJobTemplate]
$creadList :: ReadS [CreateJobTemplate]
readsPrec :: Int -> ReadS CreateJobTemplate
$creadsPrec :: Int -> ReadS CreateJobTemplate
Prelude.Read, Int -> CreateJobTemplate -> ShowS
[CreateJobTemplate] -> ShowS
CreateJobTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJobTemplate] -> ShowS
$cshowList :: [CreateJobTemplate] -> ShowS
show :: CreateJobTemplate -> String
$cshow :: CreateJobTemplate -> String
showsPrec :: Int -> CreateJobTemplate -> ShowS
$cshowsPrec :: Int -> CreateJobTemplate -> ShowS
Prelude.Show, forall x. Rep CreateJobTemplate x -> CreateJobTemplate
forall x. CreateJobTemplate -> Rep CreateJobTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateJobTemplate x -> CreateJobTemplate
$cfrom :: forall x. CreateJobTemplate -> Rep CreateJobTemplate x
Prelude.Generic)

-- |
-- Create a value of 'CreateJobTemplate' 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:
--
-- 'accelerationSettings', 'createJobTemplate_accelerationSettings' - Accelerated transcoding can significantly speed up jobs with long,
-- visually complex content. Outputs that use this feature incur pro-tier
-- pricing. For information about feature limitations, see the AWS
-- Elemental MediaConvert User Guide.
--
-- 'category', 'createJobTemplate_category' - Optional. A category for the job template you are creating
--
-- 'description', 'createJobTemplate_description' - Optional. A description of the job template you are creating.
--
-- 'hopDestinations', 'createJobTemplate_hopDestinations' - Optional. Use queue hopping to avoid overly long waits in the backlog of
-- the queue that you submit your job to. Specify an alternate queue and
-- the maximum time that your job will wait in the initial queue before
-- hopping. For more information about this feature, see the AWS Elemental
-- MediaConvert User Guide.
--
-- 'priority', 'createJobTemplate_priority' - Specify the relative priority for this job. In any given queue, the
-- service begins processing the job with the highest value first. When
-- more than one job has the same priority, the service begins processing
-- the job that you submitted first. If you don\'t specify a priority, the
-- service uses the default value 0.
--
-- 'queue', 'createJobTemplate_queue' - Optional. The queue that jobs created from this template are assigned
-- to. If you don\'t specify this, jobs will go to the default queue.
--
-- 'statusUpdateInterval', 'createJobTemplate_statusUpdateInterval' - Specify how often MediaConvert sends STATUS_UPDATE events to Amazon
-- CloudWatch Events. Set the interval, in seconds, between status updates.
-- MediaConvert sends an update at this interval from the time the service
-- begins processing your job to the time it completes the transcode or
-- encounters an error.
--
-- 'tags', 'createJobTemplate_tags' - The tags that you want to add to the resource. You can tag resources
-- with a key-value pair or with only a key.
--
-- 'settings', 'createJobTemplate_settings' - JobTemplateSettings contains all the transcode settings saved in the
-- template that will be applied to jobs created from it.
--
-- 'name', 'createJobTemplate_name' - The name of the job template you are creating.
newCreateJobTemplate ::
  -- | 'settings'
  JobTemplateSettings ->
  -- | 'name'
  Prelude.Text ->
  CreateJobTemplate
newCreateJobTemplate :: JobTemplateSettings -> Text -> CreateJobTemplate
newCreateJobTemplate JobTemplateSettings
pSettings_ Text
pName_ =
  CreateJobTemplate'
    { $sel:accelerationSettings:CreateJobTemplate' :: Maybe AccelerationSettings
accelerationSettings =
        forall a. Maybe a
Prelude.Nothing,
      $sel:category:CreateJobTemplate' :: Maybe Text
category = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateJobTemplate' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:hopDestinations:CreateJobTemplate' :: Maybe [HopDestination]
hopDestinations = forall a. Maybe a
Prelude.Nothing,
      $sel:priority:CreateJobTemplate' :: Maybe Int
priority = forall a. Maybe a
Prelude.Nothing,
      $sel:queue:CreateJobTemplate' :: Maybe Text
queue = forall a. Maybe a
Prelude.Nothing,
      $sel:statusUpdateInterval:CreateJobTemplate' :: Maybe StatusUpdateInterval
statusUpdateInterval = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateJobTemplate' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:settings:CreateJobTemplate' :: JobTemplateSettings
settings = JobTemplateSettings
pSettings_,
      $sel:name:CreateJobTemplate' :: Text
name = Text
pName_
    }

-- | Accelerated transcoding can significantly speed up jobs with long,
-- visually complex content. Outputs that use this feature incur pro-tier
-- pricing. For information about feature limitations, see the AWS
-- Elemental MediaConvert User Guide.
createJobTemplate_accelerationSettings :: Lens.Lens' CreateJobTemplate (Prelude.Maybe AccelerationSettings)
createJobTemplate_accelerationSettings :: Lens' CreateJobTemplate (Maybe AccelerationSettings)
createJobTemplate_accelerationSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe AccelerationSettings
accelerationSettings :: Maybe AccelerationSettings
$sel:accelerationSettings:CreateJobTemplate' :: CreateJobTemplate -> Maybe AccelerationSettings
accelerationSettings} -> Maybe AccelerationSettings
accelerationSettings) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe AccelerationSettings
a -> CreateJobTemplate
s {$sel:accelerationSettings:CreateJobTemplate' :: Maybe AccelerationSettings
accelerationSettings = Maybe AccelerationSettings
a} :: CreateJobTemplate)

-- | Optional. A category for the job template you are creating
createJobTemplate_category :: Lens.Lens' CreateJobTemplate (Prelude.Maybe Prelude.Text)
createJobTemplate_category :: Lens' CreateJobTemplate (Maybe Text)
createJobTemplate_category = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe Text
category :: Maybe Text
$sel:category:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
category} -> Maybe Text
category) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe Text
a -> CreateJobTemplate
s {$sel:category:CreateJobTemplate' :: Maybe Text
category = Maybe Text
a} :: CreateJobTemplate)

-- | Optional. A description of the job template you are creating.
createJobTemplate_description :: Lens.Lens' CreateJobTemplate (Prelude.Maybe Prelude.Text)
createJobTemplate_description :: Lens' CreateJobTemplate (Maybe Text)
createJobTemplate_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe Text
description :: Maybe Text
$sel:description:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe Text
a -> CreateJobTemplate
s {$sel:description:CreateJobTemplate' :: Maybe Text
description = Maybe Text
a} :: CreateJobTemplate)

-- | Optional. Use queue hopping to avoid overly long waits in the backlog of
-- the queue that you submit your job to. Specify an alternate queue and
-- the maximum time that your job will wait in the initial queue before
-- hopping. For more information about this feature, see the AWS Elemental
-- MediaConvert User Guide.
createJobTemplate_hopDestinations :: Lens.Lens' CreateJobTemplate (Prelude.Maybe [HopDestination])
createJobTemplate_hopDestinations :: Lens' CreateJobTemplate (Maybe [HopDestination])
createJobTemplate_hopDestinations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe [HopDestination]
hopDestinations :: Maybe [HopDestination]
$sel:hopDestinations:CreateJobTemplate' :: CreateJobTemplate -> Maybe [HopDestination]
hopDestinations} -> Maybe [HopDestination]
hopDestinations) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe [HopDestination]
a -> CreateJobTemplate
s {$sel:hopDestinations:CreateJobTemplate' :: Maybe [HopDestination]
hopDestinations = Maybe [HopDestination]
a} :: CreateJobTemplate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specify the relative priority for this job. In any given queue, the
-- service begins processing the job with the highest value first. When
-- more than one job has the same priority, the service begins processing
-- the job that you submitted first. If you don\'t specify a priority, the
-- service uses the default value 0.
createJobTemplate_priority :: Lens.Lens' CreateJobTemplate (Prelude.Maybe Prelude.Int)
createJobTemplate_priority :: Lens' CreateJobTemplate (Maybe Int)
createJobTemplate_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe Int
priority :: Maybe Int
$sel:priority:CreateJobTemplate' :: CreateJobTemplate -> Maybe Int
priority} -> Maybe Int
priority) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe Int
a -> CreateJobTemplate
s {$sel:priority:CreateJobTemplate' :: Maybe Int
priority = Maybe Int
a} :: CreateJobTemplate)

-- | Optional. The queue that jobs created from this template are assigned
-- to. If you don\'t specify this, jobs will go to the default queue.
createJobTemplate_queue :: Lens.Lens' CreateJobTemplate (Prelude.Maybe Prelude.Text)
createJobTemplate_queue :: Lens' CreateJobTemplate (Maybe Text)
createJobTemplate_queue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe Text
queue :: Maybe Text
$sel:queue:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
queue} -> Maybe Text
queue) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe Text
a -> CreateJobTemplate
s {$sel:queue:CreateJobTemplate' :: Maybe Text
queue = Maybe Text
a} :: CreateJobTemplate)

-- | Specify how often MediaConvert sends STATUS_UPDATE events to Amazon
-- CloudWatch Events. Set the interval, in seconds, between status updates.
-- MediaConvert sends an update at this interval from the time the service
-- begins processing your job to the time it completes the transcode or
-- encounters an error.
createJobTemplate_statusUpdateInterval :: Lens.Lens' CreateJobTemplate (Prelude.Maybe StatusUpdateInterval)
createJobTemplate_statusUpdateInterval :: Lens' CreateJobTemplate (Maybe StatusUpdateInterval)
createJobTemplate_statusUpdateInterval = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe StatusUpdateInterval
statusUpdateInterval :: Maybe StatusUpdateInterval
$sel:statusUpdateInterval:CreateJobTemplate' :: CreateJobTemplate -> Maybe StatusUpdateInterval
statusUpdateInterval} -> Maybe StatusUpdateInterval
statusUpdateInterval) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe StatusUpdateInterval
a -> CreateJobTemplate
s {$sel:statusUpdateInterval:CreateJobTemplate' :: Maybe StatusUpdateInterval
statusUpdateInterval = Maybe StatusUpdateInterval
a} :: CreateJobTemplate)

-- | The tags that you want to add to the resource. You can tag resources
-- with a key-value pair or with only a key.
createJobTemplate_tags :: Lens.Lens' CreateJobTemplate (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createJobTemplate_tags :: Lens' CreateJobTemplate (Maybe (HashMap Text Text))
createJobTemplate_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateJobTemplate' :: CreateJobTemplate -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Maybe (HashMap Text Text)
a -> CreateJobTemplate
s {$sel:tags:CreateJobTemplate' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateJobTemplate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | JobTemplateSettings contains all the transcode settings saved in the
-- template that will be applied to jobs created from it.
createJobTemplate_settings :: Lens.Lens' CreateJobTemplate JobTemplateSettings
createJobTemplate_settings :: Lens' CreateJobTemplate JobTemplateSettings
createJobTemplate_settings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {JobTemplateSettings
settings :: JobTemplateSettings
$sel:settings:CreateJobTemplate' :: CreateJobTemplate -> JobTemplateSettings
settings} -> JobTemplateSettings
settings) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} JobTemplateSettings
a -> CreateJobTemplate
s {$sel:settings:CreateJobTemplate' :: JobTemplateSettings
settings = JobTemplateSettings
a} :: CreateJobTemplate)

-- | The name of the job template you are creating.
createJobTemplate_name :: Lens.Lens' CreateJobTemplate Prelude.Text
createJobTemplate_name :: Lens' CreateJobTemplate Text
createJobTemplate_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplate' {Text
name :: Text
$sel:name:CreateJobTemplate' :: CreateJobTemplate -> Text
name} -> Text
name) (\s :: CreateJobTemplate
s@CreateJobTemplate' {} Text
a -> CreateJobTemplate
s {$sel:name:CreateJobTemplate' :: Text
name = Text
a} :: CreateJobTemplate)

instance Core.AWSRequest CreateJobTemplate where
  type
    AWSResponse CreateJobTemplate =
      CreateJobTemplateResponse
  request :: (Service -> Service)
-> CreateJobTemplate -> Request CreateJobTemplate
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateJobTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateJobTemplate)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe JobTemplate -> Int -> CreateJobTemplateResponse
CreateJobTemplateResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"jobTemplate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateJobTemplate where
  hashWithSalt :: Int -> CreateJobTemplate -> Int
hashWithSalt Int
_salt CreateJobTemplate' {Maybe Int
Maybe [HopDestination]
Maybe Text
Maybe (HashMap Text Text)
Maybe AccelerationSettings
Maybe StatusUpdateInterval
Text
JobTemplateSettings
name :: Text
settings :: JobTemplateSettings
tags :: Maybe (HashMap Text Text)
statusUpdateInterval :: Maybe StatusUpdateInterval
queue :: Maybe Text
priority :: Maybe Int
hopDestinations :: Maybe [HopDestination]
description :: Maybe Text
category :: Maybe Text
accelerationSettings :: Maybe AccelerationSettings
$sel:name:CreateJobTemplate' :: CreateJobTemplate -> Text
$sel:settings:CreateJobTemplate' :: CreateJobTemplate -> JobTemplateSettings
$sel:tags:CreateJobTemplate' :: CreateJobTemplate -> Maybe (HashMap Text Text)
$sel:statusUpdateInterval:CreateJobTemplate' :: CreateJobTemplate -> Maybe StatusUpdateInterval
$sel:queue:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:priority:CreateJobTemplate' :: CreateJobTemplate -> Maybe Int
$sel:hopDestinations:CreateJobTemplate' :: CreateJobTemplate -> Maybe [HopDestination]
$sel:description:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:category:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:accelerationSettings:CreateJobTemplate' :: CreateJobTemplate -> Maybe AccelerationSettings
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AccelerationSettings
accelerationSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
category
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [HopDestination]
hopDestinations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
priority
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
queue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StatusUpdateInterval
statusUpdateInterval
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` JobTemplateSettings
settings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData CreateJobTemplate where
  rnf :: CreateJobTemplate -> ()
rnf CreateJobTemplate' {Maybe Int
Maybe [HopDestination]
Maybe Text
Maybe (HashMap Text Text)
Maybe AccelerationSettings
Maybe StatusUpdateInterval
Text
JobTemplateSettings
name :: Text
settings :: JobTemplateSettings
tags :: Maybe (HashMap Text Text)
statusUpdateInterval :: Maybe StatusUpdateInterval
queue :: Maybe Text
priority :: Maybe Int
hopDestinations :: Maybe [HopDestination]
description :: Maybe Text
category :: Maybe Text
accelerationSettings :: Maybe AccelerationSettings
$sel:name:CreateJobTemplate' :: CreateJobTemplate -> Text
$sel:settings:CreateJobTemplate' :: CreateJobTemplate -> JobTemplateSettings
$sel:tags:CreateJobTemplate' :: CreateJobTemplate -> Maybe (HashMap Text Text)
$sel:statusUpdateInterval:CreateJobTemplate' :: CreateJobTemplate -> Maybe StatusUpdateInterval
$sel:queue:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:priority:CreateJobTemplate' :: CreateJobTemplate -> Maybe Int
$sel:hopDestinations:CreateJobTemplate' :: CreateJobTemplate -> Maybe [HopDestination]
$sel:description:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:category:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:accelerationSettings:CreateJobTemplate' :: CreateJobTemplate -> Maybe AccelerationSettings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AccelerationSettings
accelerationSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
category
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [HopDestination]
hopDestinations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
priority
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
queue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StatusUpdateInterval
statusUpdateInterval
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf JobTemplateSettings
settings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

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

instance Data.ToJSON CreateJobTemplate where
  toJSON :: CreateJobTemplate -> Value
toJSON CreateJobTemplate' {Maybe Int
Maybe [HopDestination]
Maybe Text
Maybe (HashMap Text Text)
Maybe AccelerationSettings
Maybe StatusUpdateInterval
Text
JobTemplateSettings
name :: Text
settings :: JobTemplateSettings
tags :: Maybe (HashMap Text Text)
statusUpdateInterval :: Maybe StatusUpdateInterval
queue :: Maybe Text
priority :: Maybe Int
hopDestinations :: Maybe [HopDestination]
description :: Maybe Text
category :: Maybe Text
accelerationSettings :: Maybe AccelerationSettings
$sel:name:CreateJobTemplate' :: CreateJobTemplate -> Text
$sel:settings:CreateJobTemplate' :: CreateJobTemplate -> JobTemplateSettings
$sel:tags:CreateJobTemplate' :: CreateJobTemplate -> Maybe (HashMap Text Text)
$sel:statusUpdateInterval:CreateJobTemplate' :: CreateJobTemplate -> Maybe StatusUpdateInterval
$sel:queue:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:priority:CreateJobTemplate' :: CreateJobTemplate -> Maybe Int
$sel:hopDestinations:CreateJobTemplate' :: CreateJobTemplate -> Maybe [HopDestination]
$sel:description:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:category:CreateJobTemplate' :: CreateJobTemplate -> Maybe Text
$sel:accelerationSettings:CreateJobTemplate' :: CreateJobTemplate -> Maybe AccelerationSettings
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"accelerationSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccelerationSettings
accelerationSettings,
            (Key
"category" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
category,
            (Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"hopDestinations" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [HopDestination]
hopDestinations,
            (Key
"priority" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
priority,
            (Key
"queue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
queue,
            (Key
"statusUpdateInterval" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StatusUpdateInterval
statusUpdateInterval,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"settings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= JobTemplateSettings
settings),
            forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath CreateJobTemplate where
  toPath :: CreateJobTemplate -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/2017-08-29/jobTemplates"

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

-- | /See:/ 'newCreateJobTemplateResponse' smart constructor.
data CreateJobTemplateResponse = CreateJobTemplateResponse'
  { -- | A job template is a pre-made set of encoding instructions that you can
    -- use to quickly create a job.
    CreateJobTemplateResponse -> Maybe JobTemplate
jobTemplate :: Prelude.Maybe JobTemplate,
    -- | The response's http status code.
    CreateJobTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool
$c/= :: CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool
== :: CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool
$c== :: CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool
Prelude.Eq, ReadPrec [CreateJobTemplateResponse]
ReadPrec CreateJobTemplateResponse
Int -> ReadS CreateJobTemplateResponse
ReadS [CreateJobTemplateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateJobTemplateResponse]
$creadListPrec :: ReadPrec [CreateJobTemplateResponse]
readPrec :: ReadPrec CreateJobTemplateResponse
$creadPrec :: ReadPrec CreateJobTemplateResponse
readList :: ReadS [CreateJobTemplateResponse]
$creadList :: ReadS [CreateJobTemplateResponse]
readsPrec :: Int -> ReadS CreateJobTemplateResponse
$creadsPrec :: Int -> ReadS CreateJobTemplateResponse
Prelude.Read, Int -> CreateJobTemplateResponse -> ShowS
[CreateJobTemplateResponse] -> ShowS
CreateJobTemplateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateJobTemplateResponse] -> ShowS
$cshowList :: [CreateJobTemplateResponse] -> ShowS
show :: CreateJobTemplateResponse -> String
$cshow :: CreateJobTemplateResponse -> String
showsPrec :: Int -> CreateJobTemplateResponse -> ShowS
$cshowsPrec :: Int -> CreateJobTemplateResponse -> ShowS
Prelude.Show, forall x.
Rep CreateJobTemplateResponse x -> CreateJobTemplateResponse
forall x.
CreateJobTemplateResponse -> Rep CreateJobTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateJobTemplateResponse x -> CreateJobTemplateResponse
$cfrom :: forall x.
CreateJobTemplateResponse -> Rep CreateJobTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateJobTemplateResponse' 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:
--
-- 'jobTemplate', 'createJobTemplateResponse_jobTemplate' - A job template is a pre-made set of encoding instructions that you can
-- use to quickly create a job.
--
-- 'httpStatus', 'createJobTemplateResponse_httpStatus' - The response's http status code.
newCreateJobTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateJobTemplateResponse
newCreateJobTemplateResponse :: Int -> CreateJobTemplateResponse
newCreateJobTemplateResponse Int
pHttpStatus_ =
  CreateJobTemplateResponse'
    { $sel:jobTemplate:CreateJobTemplateResponse' :: Maybe JobTemplate
jobTemplate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateJobTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A job template is a pre-made set of encoding instructions that you can
-- use to quickly create a job.
createJobTemplateResponse_jobTemplate :: Lens.Lens' CreateJobTemplateResponse (Prelude.Maybe JobTemplate)
createJobTemplateResponse_jobTemplate :: Lens' CreateJobTemplateResponse (Maybe JobTemplate)
createJobTemplateResponse_jobTemplate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateJobTemplateResponse' {Maybe JobTemplate
jobTemplate :: Maybe JobTemplate
$sel:jobTemplate:CreateJobTemplateResponse' :: CreateJobTemplateResponse -> Maybe JobTemplate
jobTemplate} -> Maybe JobTemplate
jobTemplate) (\s :: CreateJobTemplateResponse
s@CreateJobTemplateResponse' {} Maybe JobTemplate
a -> CreateJobTemplateResponse
s {$sel:jobTemplate:CreateJobTemplateResponse' :: Maybe JobTemplate
jobTemplate = Maybe JobTemplate
a} :: CreateJobTemplateResponse)

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

instance Prelude.NFData CreateJobTemplateResponse where
  rnf :: CreateJobTemplateResponse -> ()
rnf CreateJobTemplateResponse' {Int
Maybe JobTemplate
httpStatus :: Int
jobTemplate :: Maybe JobTemplate
$sel:httpStatus:CreateJobTemplateResponse' :: CreateJobTemplateResponse -> Int
$sel:jobTemplate:CreateJobTemplateResponse' :: CreateJobTemplateResponse -> Maybe JobTemplate
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe JobTemplate
jobTemplate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus