{-# 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-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)
--
-- 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_priority,
    createJobTemplate_statusUpdateInterval,
    createJobTemplate_category,
    createJobTemplate_hopDestinations,
    createJobTemplate_queue,
    createJobTemplate_description,
    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.Lens as Lens
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,
    -- | 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,
    -- | 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,
    -- | Optional. A category for the job template you are creating
    CreateJobTemplate -> Maybe Text
category :: 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],
    -- | 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,
    -- | Optional. A description of the job template you are creating.
    CreateJobTemplate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | 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
(CreateJobTemplate -> CreateJobTemplate -> Bool)
-> (CreateJobTemplate -> CreateJobTemplate -> Bool)
-> Eq CreateJobTemplate
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]
(Int -> ReadS CreateJobTemplate)
-> ReadS [CreateJobTemplate]
-> ReadPrec CreateJobTemplate
-> ReadPrec [CreateJobTemplate]
-> Read 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
(Int -> CreateJobTemplate -> ShowS)
-> (CreateJobTemplate -> String)
-> ([CreateJobTemplate] -> ShowS)
-> Show CreateJobTemplate
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. CreateJobTemplate -> Rep CreateJobTemplate x)
-> (forall x. Rep CreateJobTemplate x -> CreateJobTemplate)
-> Generic CreateJobTemplate
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.
--
-- '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.
--
-- '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.
--
-- 'category', 'createJobTemplate_category' - Optional. A category for 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.
--
-- '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.
--
-- 'description', 'createJobTemplate_description' - Optional. A description of the job template you are creating.
--
-- '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' :: Maybe AccelerationSettings
-> Maybe Int
-> Maybe StatusUpdateInterval
-> Maybe Text
-> Maybe [HopDestination]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> JobTemplateSettings
-> Text
-> CreateJobTemplate
CreateJobTemplate'
    { $sel:accelerationSettings:CreateJobTemplate' :: Maybe AccelerationSettings
accelerationSettings =
        Maybe AccelerationSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:priority:CreateJobTemplate' :: Maybe Int
priority = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:statusUpdateInterval:CreateJobTemplate' :: Maybe StatusUpdateInterval
statusUpdateInterval = Maybe StatusUpdateInterval
forall a. Maybe a
Prelude.Nothing,
      $sel:category:CreateJobTemplate' :: Maybe Text
category = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hopDestinations:CreateJobTemplate' :: Maybe [HopDestination]
hopDestinations = Maybe [HopDestination]
forall a. Maybe a
Prelude.Nothing,
      $sel:queue:CreateJobTemplate' :: Maybe Text
queue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateJobTemplate' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateJobTemplate' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
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 :: (Maybe AccelerationSettings -> f (Maybe AccelerationSettings))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_accelerationSettings = (CreateJobTemplate -> Maybe AccelerationSettings)
-> (CreateJobTemplate
    -> Maybe AccelerationSettings -> CreateJobTemplate)
-> Lens
     CreateJobTemplate
     CreateJobTemplate
     (Maybe AccelerationSettings)
     (Maybe 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)

-- | 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 :: (Maybe Int -> f (Maybe Int))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_priority = (CreateJobTemplate -> Maybe Int)
-> (CreateJobTemplate -> Maybe Int -> CreateJobTemplate)
-> Lens CreateJobTemplate CreateJobTemplate (Maybe Int) (Maybe Int)
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)

-- | 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 :: (Maybe StatusUpdateInterval -> f (Maybe StatusUpdateInterval))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_statusUpdateInterval = (CreateJobTemplate -> Maybe StatusUpdateInterval)
-> (CreateJobTemplate
    -> Maybe StatusUpdateInterval -> CreateJobTemplate)
-> Lens
     CreateJobTemplate
     CreateJobTemplate
     (Maybe StatusUpdateInterval)
     (Maybe 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)

-- | Optional. A category for the job template you are creating
createJobTemplate_category :: Lens.Lens' CreateJobTemplate (Prelude.Maybe Prelude.Text)
createJobTemplate_category :: (Maybe Text -> f (Maybe Text))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_category = (CreateJobTemplate -> Maybe Text)
-> (CreateJobTemplate -> Maybe Text -> CreateJobTemplate)
-> Lens
     CreateJobTemplate CreateJobTemplate (Maybe Text) (Maybe Text)
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. 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 :: (Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_hopDestinations = (CreateJobTemplate -> Maybe [HopDestination])
-> (CreateJobTemplate
    -> Maybe [HopDestination] -> CreateJobTemplate)
-> Lens
     CreateJobTemplate
     CreateJobTemplate
     (Maybe [HopDestination])
     (Maybe [HopDestination])
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) ((Maybe [HopDestination] -> f (Maybe [HopDestination]))
 -> CreateJobTemplate -> f CreateJobTemplate)
-> ((Maybe [HopDestination] -> f (Maybe [HopDestination]))
    -> Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> (Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> CreateJobTemplate
-> f CreateJobTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [HopDestination] [HopDestination] [HopDestination] [HopDestination]
-> Iso
     (Maybe [HopDestination])
     (Maybe [HopDestination])
     (Maybe [HopDestination])
     (Maybe [HopDestination])
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
  [HopDestination] [HopDestination] [HopDestination] [HopDestination]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_queue = (CreateJobTemplate -> Maybe Text)
-> (CreateJobTemplate -> Maybe Text -> CreateJobTemplate)
-> Lens
     CreateJobTemplate CreateJobTemplate (Maybe Text) (Maybe Text)
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)

-- | Optional. A description of the job template you are creating.
createJobTemplate_description :: Lens.Lens' CreateJobTemplate (Prelude.Maybe Prelude.Text)
createJobTemplate_description :: (Maybe Text -> f (Maybe Text))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_description = (CreateJobTemplate -> Maybe Text)
-> (CreateJobTemplate -> Maybe Text -> CreateJobTemplate)
-> Lens
     CreateJobTemplate CreateJobTemplate (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_tags = (CreateJobTemplate -> Maybe (HashMap Text Text))
-> (CreateJobTemplate
    -> Maybe (HashMap Text Text) -> CreateJobTemplate)
-> Lens
     CreateJobTemplate
     CreateJobTemplate
     (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 (\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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateJobTemplate -> f CreateJobTemplate)
-> ((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)))
-> CreateJobTemplate
-> f CreateJobTemplate
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

-- | 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 :: (JobTemplateSettings -> f JobTemplateSettings)
-> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_settings = (CreateJobTemplate -> JobTemplateSettings)
-> (CreateJobTemplate -> JobTemplateSettings -> CreateJobTemplate)
-> Lens
     CreateJobTemplate
     CreateJobTemplate
     JobTemplateSettings
     JobTemplateSettings
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 :: (Text -> f Text) -> CreateJobTemplate -> f CreateJobTemplate
createJobTemplate_name = (CreateJobTemplate -> Text)
-> (CreateJobTemplate -> Text -> CreateJobTemplate)
-> Lens CreateJobTemplate CreateJobTemplate Text Text
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 :: CreateJobTemplate -> Request CreateJobTemplate
request = Service -> CreateJobTemplate -> Request CreateJobTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateJobTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateJobTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateJobTemplate))
-> Logger
-> Service
-> Proxy CreateJobTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateJobTemplate)))
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 JobTemplate -> Int -> CreateJobTemplateResponse
CreateJobTemplateResponse'
            (Maybe JobTemplate -> Int -> CreateJobTemplateResponse)
-> Either String (Maybe JobTemplate)
-> Either String (Int -> CreateJobTemplateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe JobTemplate)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"jobTemplate")
            Either String (Int -> CreateJobTemplateResponse)
-> Either String Int -> Either String CreateJobTemplateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateJobTemplate

instance Prelude.NFData CreateJobTemplate

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

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

instance Core.ToQuery CreateJobTemplate where
  toQuery :: CreateJobTemplate -> QueryString
toQuery = QueryString -> CreateJobTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool)
-> (CreateJobTemplateResponse -> CreateJobTemplateResponse -> Bool)
-> Eq CreateJobTemplateResponse
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]
(Int -> ReadS CreateJobTemplateResponse)
-> ReadS [CreateJobTemplateResponse]
-> ReadPrec CreateJobTemplateResponse
-> ReadPrec [CreateJobTemplateResponse]
-> Read 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
(Int -> CreateJobTemplateResponse -> ShowS)
-> (CreateJobTemplateResponse -> String)
-> ([CreateJobTemplateResponse] -> ShowS)
-> Show CreateJobTemplateResponse
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.
 CreateJobTemplateResponse -> Rep CreateJobTemplateResponse x)
-> (forall x.
    Rep CreateJobTemplateResponse x -> CreateJobTemplateResponse)
-> Generic CreateJobTemplateResponse
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' :: Maybe JobTemplate -> Int -> CreateJobTemplateResponse
CreateJobTemplateResponse'
    { $sel:jobTemplate:CreateJobTemplateResponse' :: Maybe JobTemplate
jobTemplate =
        Maybe 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 :: (Maybe JobTemplate -> f (Maybe JobTemplate))
-> CreateJobTemplateResponse -> f CreateJobTemplateResponse
createJobTemplateResponse_jobTemplate = (CreateJobTemplateResponse -> Maybe JobTemplate)
-> (CreateJobTemplateResponse
    -> Maybe JobTemplate -> CreateJobTemplateResponse)
-> Lens
     CreateJobTemplateResponse
     CreateJobTemplateResponse
     (Maybe JobTemplate)
     (Maybe 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 :: (Int -> f Int)
-> CreateJobTemplateResponse -> f CreateJobTemplateResponse
createJobTemplateResponse_httpStatus = (CreateJobTemplateResponse -> Int)
-> (CreateJobTemplateResponse -> Int -> CreateJobTemplateResponse)
-> Lens CreateJobTemplateResponse CreateJobTemplateResponse Int Int
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