{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.JobTemplate
-- 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)
module Amazonka.MediaConvert.Types.JobTemplate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.AccelerationSettings
import Amazonka.MediaConvert.Types.HopDestination
import Amazonka.MediaConvert.Types.JobTemplateSettings
import Amazonka.MediaConvert.Types.StatusUpdateInterval
import Amazonka.MediaConvert.Types.Type
import qualified Amazonka.Prelude as Prelude

-- | A job template is a pre-made set of encoding instructions that you can
-- use to quickly create a job.
--
-- /See:/ 'newJobTemplate' smart constructor.
data JobTemplate = JobTemplate'
  { -- | Accelerated transcoding can significantly speed up jobs with long,
    -- visually complex content.
    JobTemplate -> Maybe AccelerationSettings
accelerationSettings :: Prelude.Maybe AccelerationSettings,
    -- | The timestamp in epoch seconds when the Job template was last updated.
    JobTemplate -> Maybe POSIX
lastUpdated :: Prelude.Maybe Core.POSIX,
    -- | Relative priority on the job.
    JobTemplate -> 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.
    JobTemplate -> Maybe StatusUpdateInterval
statusUpdateInterval :: Prelude.Maybe StatusUpdateInterval,
    -- | An identifier for this resource that is unique within all of AWS.
    JobTemplate -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The timestamp in epoch seconds for Job template creation.
    JobTemplate -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | An optional category you create to organize your job templates.
    JobTemplate -> Maybe Text
category :: Prelude.Maybe Prelude.Text,
    -- | Optional list of hop destinations.
    JobTemplate -> 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.
    JobTemplate -> Maybe Text
queue :: Prelude.Maybe Prelude.Text,
    -- | A job template can be of two types: system or custom. System or built-in
    -- job templates can\'t be modified or deleted by the user.
    JobTemplate -> Maybe Type
type' :: Prelude.Maybe Type,
    -- | An optional description you create for each job template.
    JobTemplate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | JobTemplateSettings contains all the transcode settings saved in the
    -- template that will be applied to jobs created from it.
    JobTemplate -> JobTemplateSettings
settings :: JobTemplateSettings,
    -- | A name you create for each job template. Each name must be unique within
    -- your account.
    JobTemplate -> Text
name :: Prelude.Text
  }
  deriving (JobTemplate -> JobTemplate -> Bool
(JobTemplate -> JobTemplate -> Bool)
-> (JobTemplate -> JobTemplate -> Bool) -> Eq JobTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobTemplate -> JobTemplate -> Bool
$c/= :: JobTemplate -> JobTemplate -> Bool
== :: JobTemplate -> JobTemplate -> Bool
$c== :: JobTemplate -> JobTemplate -> Bool
Prelude.Eq, ReadPrec [JobTemplate]
ReadPrec JobTemplate
Int -> ReadS JobTemplate
ReadS [JobTemplate]
(Int -> ReadS JobTemplate)
-> ReadS [JobTemplate]
-> ReadPrec JobTemplate
-> ReadPrec [JobTemplate]
-> Read JobTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobTemplate]
$creadListPrec :: ReadPrec [JobTemplate]
readPrec :: ReadPrec JobTemplate
$creadPrec :: ReadPrec JobTemplate
readList :: ReadS [JobTemplate]
$creadList :: ReadS [JobTemplate]
readsPrec :: Int -> ReadS JobTemplate
$creadsPrec :: Int -> ReadS JobTemplate
Prelude.Read, Int -> JobTemplate -> ShowS
[JobTemplate] -> ShowS
JobTemplate -> String
(Int -> JobTemplate -> ShowS)
-> (JobTemplate -> String)
-> ([JobTemplate] -> ShowS)
-> Show JobTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobTemplate] -> ShowS
$cshowList :: [JobTemplate] -> ShowS
show :: JobTemplate -> String
$cshow :: JobTemplate -> String
showsPrec :: Int -> JobTemplate -> ShowS
$cshowsPrec :: Int -> JobTemplate -> ShowS
Prelude.Show, (forall x. JobTemplate -> Rep JobTemplate x)
-> (forall x. Rep JobTemplate x -> JobTemplate)
-> Generic JobTemplate
forall x. Rep JobTemplate x -> JobTemplate
forall x. JobTemplate -> Rep JobTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobTemplate x -> JobTemplate
$cfrom :: forall x. JobTemplate -> Rep JobTemplate x
Prelude.Generic)

-- |
-- Create a value of 'JobTemplate' 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', 'jobTemplate_accelerationSettings' - Accelerated transcoding can significantly speed up jobs with long,
-- visually complex content.
--
-- 'lastUpdated', 'jobTemplate_lastUpdated' - The timestamp in epoch seconds when the Job template was last updated.
--
-- 'priority', 'jobTemplate_priority' - Relative priority on the job.
--
-- 'statusUpdateInterval', 'jobTemplate_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.
--
-- 'arn', 'jobTemplate_arn' - An identifier for this resource that is unique within all of AWS.
--
-- 'createdAt', 'jobTemplate_createdAt' - The timestamp in epoch seconds for Job template creation.
--
-- 'category', 'jobTemplate_category' - An optional category you create to organize your job templates.
--
-- 'hopDestinations', 'jobTemplate_hopDestinations' - Optional list of hop destinations.
--
-- 'queue', 'jobTemplate_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.
--
-- 'type'', 'jobTemplate_type' - A job template can be of two types: system or custom. System or built-in
-- job templates can\'t be modified or deleted by the user.
--
-- 'description', 'jobTemplate_description' - An optional description you create for each job template.
--
-- 'settings', 'jobTemplate_settings' - JobTemplateSettings contains all the transcode settings saved in the
-- template that will be applied to jobs created from it.
--
-- 'name', 'jobTemplate_name' - A name you create for each job template. Each name must be unique within
-- your account.
newJobTemplate ::
  -- | 'settings'
  JobTemplateSettings ->
  -- | 'name'
  Prelude.Text ->
  JobTemplate
newJobTemplate :: JobTemplateSettings -> Text -> JobTemplate
newJobTemplate JobTemplateSettings
pSettings_ Text
pName_ =
  JobTemplate' :: Maybe AccelerationSettings
-> Maybe POSIX
-> Maybe Int
-> Maybe StatusUpdateInterval
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [HopDestination]
-> Maybe Text
-> Maybe Type
-> Maybe Text
-> JobTemplateSettings
-> Text
-> JobTemplate
JobTemplate'
    { $sel:accelerationSettings:JobTemplate' :: Maybe AccelerationSettings
accelerationSettings =
        Maybe AccelerationSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdated:JobTemplate' :: Maybe POSIX
lastUpdated = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:priority:JobTemplate' :: Maybe Int
priority = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:statusUpdateInterval:JobTemplate' :: Maybe StatusUpdateInterval
statusUpdateInterval = Maybe StatusUpdateInterval
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:JobTemplate' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:JobTemplate' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:category:JobTemplate' :: Maybe Text
category = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hopDestinations:JobTemplate' :: Maybe [HopDestination]
hopDestinations = Maybe [HopDestination]
forall a. Maybe a
Prelude.Nothing,
      $sel:queue:JobTemplate' :: Maybe Text
queue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':JobTemplate' :: Maybe Type
type' = Maybe Type
forall a. Maybe a
Prelude.Nothing,
      $sel:description:JobTemplate' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:settings:JobTemplate' :: JobTemplateSettings
settings = JobTemplateSettings
pSettings_,
      $sel:name:JobTemplate' :: Text
name = Text
pName_
    }

-- | Accelerated transcoding can significantly speed up jobs with long,
-- visually complex content.
jobTemplate_accelerationSettings :: Lens.Lens' JobTemplate (Prelude.Maybe AccelerationSettings)
jobTemplate_accelerationSettings :: (Maybe AccelerationSettings -> f (Maybe AccelerationSettings))
-> JobTemplate -> f JobTemplate
jobTemplate_accelerationSettings = (JobTemplate -> Maybe AccelerationSettings)
-> (JobTemplate -> Maybe AccelerationSettings -> JobTemplate)
-> Lens
     JobTemplate
     JobTemplate
     (Maybe AccelerationSettings)
     (Maybe AccelerationSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe AccelerationSettings
accelerationSettings :: Maybe AccelerationSettings
$sel:accelerationSettings:JobTemplate' :: JobTemplate -> Maybe AccelerationSettings
accelerationSettings} -> Maybe AccelerationSettings
accelerationSettings) (\s :: JobTemplate
s@JobTemplate' {} Maybe AccelerationSettings
a -> JobTemplate
s {$sel:accelerationSettings:JobTemplate' :: Maybe AccelerationSettings
accelerationSettings = Maybe AccelerationSettings
a} :: JobTemplate)

-- | The timestamp in epoch seconds when the Job template was last updated.
jobTemplate_lastUpdated :: Lens.Lens' JobTemplate (Prelude.Maybe Prelude.UTCTime)
jobTemplate_lastUpdated :: (Maybe UTCTime -> f (Maybe UTCTime))
-> JobTemplate -> f JobTemplate
jobTemplate_lastUpdated = (JobTemplate -> Maybe POSIX)
-> (JobTemplate -> Maybe POSIX -> JobTemplate)
-> Lens JobTemplate JobTemplate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe POSIX
lastUpdated :: Maybe POSIX
$sel:lastUpdated:JobTemplate' :: JobTemplate -> Maybe POSIX
lastUpdated} -> Maybe POSIX
lastUpdated) (\s :: JobTemplate
s@JobTemplate' {} Maybe POSIX
a -> JobTemplate
s {$sel:lastUpdated:JobTemplate' :: Maybe POSIX
lastUpdated = Maybe POSIX
a} :: JobTemplate) ((Maybe POSIX -> f (Maybe POSIX)) -> JobTemplate -> f JobTemplate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JobTemplate
-> f JobTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Relative priority on the job.
jobTemplate_priority :: Lens.Lens' JobTemplate (Prelude.Maybe Prelude.Int)
jobTemplate_priority :: (Maybe Int -> f (Maybe Int)) -> JobTemplate -> f JobTemplate
jobTemplate_priority = (JobTemplate -> Maybe Int)
-> (JobTemplate -> Maybe Int -> JobTemplate)
-> Lens JobTemplate JobTemplate (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe Int
priority :: Maybe Int
$sel:priority:JobTemplate' :: JobTemplate -> Maybe Int
priority} -> Maybe Int
priority) (\s :: JobTemplate
s@JobTemplate' {} Maybe Int
a -> JobTemplate
s {$sel:priority:JobTemplate' :: Maybe Int
priority = Maybe Int
a} :: JobTemplate)

-- | 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.
jobTemplate_statusUpdateInterval :: Lens.Lens' JobTemplate (Prelude.Maybe StatusUpdateInterval)
jobTemplate_statusUpdateInterval :: (Maybe StatusUpdateInterval -> f (Maybe StatusUpdateInterval))
-> JobTemplate -> f JobTemplate
jobTemplate_statusUpdateInterval = (JobTemplate -> Maybe StatusUpdateInterval)
-> (JobTemplate -> Maybe StatusUpdateInterval -> JobTemplate)
-> Lens
     JobTemplate
     JobTemplate
     (Maybe StatusUpdateInterval)
     (Maybe StatusUpdateInterval)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe StatusUpdateInterval
statusUpdateInterval :: Maybe StatusUpdateInterval
$sel:statusUpdateInterval:JobTemplate' :: JobTemplate -> Maybe StatusUpdateInterval
statusUpdateInterval} -> Maybe StatusUpdateInterval
statusUpdateInterval) (\s :: JobTemplate
s@JobTemplate' {} Maybe StatusUpdateInterval
a -> JobTemplate
s {$sel:statusUpdateInterval:JobTemplate' :: Maybe StatusUpdateInterval
statusUpdateInterval = Maybe StatusUpdateInterval
a} :: JobTemplate)

-- | An identifier for this resource that is unique within all of AWS.
jobTemplate_arn :: Lens.Lens' JobTemplate (Prelude.Maybe Prelude.Text)
jobTemplate_arn :: (Maybe Text -> f (Maybe Text)) -> JobTemplate -> f JobTemplate
jobTemplate_arn = (JobTemplate -> Maybe Text)
-> (JobTemplate -> Maybe Text -> JobTemplate)
-> Lens JobTemplate JobTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe Text
arn :: Maybe Text
$sel:arn:JobTemplate' :: JobTemplate -> Maybe Text
arn} -> Maybe Text
arn) (\s :: JobTemplate
s@JobTemplate' {} Maybe Text
a -> JobTemplate
s {$sel:arn:JobTemplate' :: Maybe Text
arn = Maybe Text
a} :: JobTemplate)

-- | The timestamp in epoch seconds for Job template creation.
jobTemplate_createdAt :: Lens.Lens' JobTemplate (Prelude.Maybe Prelude.UTCTime)
jobTemplate_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> JobTemplate -> f JobTemplate
jobTemplate_createdAt = (JobTemplate -> Maybe POSIX)
-> (JobTemplate -> Maybe POSIX -> JobTemplate)
-> Lens JobTemplate JobTemplate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:JobTemplate' :: JobTemplate -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: JobTemplate
s@JobTemplate' {} Maybe POSIX
a -> JobTemplate
s {$sel:createdAt:JobTemplate' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: JobTemplate) ((Maybe POSIX -> f (Maybe POSIX)) -> JobTemplate -> f JobTemplate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> JobTemplate
-> f JobTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | An optional category you create to organize your job templates.
jobTemplate_category :: Lens.Lens' JobTemplate (Prelude.Maybe Prelude.Text)
jobTemplate_category :: (Maybe Text -> f (Maybe Text)) -> JobTemplate -> f JobTemplate
jobTemplate_category = (JobTemplate -> Maybe Text)
-> (JobTemplate -> Maybe Text -> JobTemplate)
-> Lens JobTemplate JobTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe Text
category :: Maybe Text
$sel:category:JobTemplate' :: JobTemplate -> Maybe Text
category} -> Maybe Text
category) (\s :: JobTemplate
s@JobTemplate' {} Maybe Text
a -> JobTemplate
s {$sel:category:JobTemplate' :: Maybe Text
category = Maybe Text
a} :: JobTemplate)

-- | Optional list of hop destinations.
jobTemplate_hopDestinations :: Lens.Lens' JobTemplate (Prelude.Maybe [HopDestination])
jobTemplate_hopDestinations :: (Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> JobTemplate -> f JobTemplate
jobTemplate_hopDestinations = (JobTemplate -> Maybe [HopDestination])
-> (JobTemplate -> Maybe [HopDestination] -> JobTemplate)
-> Lens
     JobTemplate
     JobTemplate
     (Maybe [HopDestination])
     (Maybe [HopDestination])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe [HopDestination]
hopDestinations :: Maybe [HopDestination]
$sel:hopDestinations:JobTemplate' :: JobTemplate -> Maybe [HopDestination]
hopDestinations} -> Maybe [HopDestination]
hopDestinations) (\s :: JobTemplate
s@JobTemplate' {} Maybe [HopDestination]
a -> JobTemplate
s {$sel:hopDestinations:JobTemplate' :: Maybe [HopDestination]
hopDestinations = Maybe [HopDestination]
a} :: JobTemplate) ((Maybe [HopDestination] -> f (Maybe [HopDestination]))
 -> JobTemplate -> f JobTemplate)
-> ((Maybe [HopDestination] -> f (Maybe [HopDestination]))
    -> Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> (Maybe [HopDestination] -> f (Maybe [HopDestination]))
-> JobTemplate
-> f JobTemplate
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.
jobTemplate_queue :: Lens.Lens' JobTemplate (Prelude.Maybe Prelude.Text)
jobTemplate_queue :: (Maybe Text -> f (Maybe Text)) -> JobTemplate -> f JobTemplate
jobTemplate_queue = (JobTemplate -> Maybe Text)
-> (JobTemplate -> Maybe Text -> JobTemplate)
-> Lens JobTemplate JobTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe Text
queue :: Maybe Text
$sel:queue:JobTemplate' :: JobTemplate -> Maybe Text
queue} -> Maybe Text
queue) (\s :: JobTemplate
s@JobTemplate' {} Maybe Text
a -> JobTemplate
s {$sel:queue:JobTemplate' :: Maybe Text
queue = Maybe Text
a} :: JobTemplate)

-- | A job template can be of two types: system or custom. System or built-in
-- job templates can\'t be modified or deleted by the user.
jobTemplate_type :: Lens.Lens' JobTemplate (Prelude.Maybe Type)
jobTemplate_type :: (Maybe Type -> f (Maybe Type)) -> JobTemplate -> f JobTemplate
jobTemplate_type = (JobTemplate -> Maybe Type)
-> (JobTemplate -> Maybe Type -> JobTemplate)
-> Lens JobTemplate JobTemplate (Maybe Type) (Maybe Type)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe Type
type' :: Maybe Type
$sel:type':JobTemplate' :: JobTemplate -> Maybe Type
type'} -> Maybe Type
type') (\s :: JobTemplate
s@JobTemplate' {} Maybe Type
a -> JobTemplate
s {$sel:type':JobTemplate' :: Maybe Type
type' = Maybe Type
a} :: JobTemplate)

-- | An optional description you create for each job template.
jobTemplate_description :: Lens.Lens' JobTemplate (Prelude.Maybe Prelude.Text)
jobTemplate_description :: (Maybe Text -> f (Maybe Text)) -> JobTemplate -> f JobTemplate
jobTemplate_description = (JobTemplate -> Maybe Text)
-> (JobTemplate -> Maybe Text -> JobTemplate)
-> Lens JobTemplate JobTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Maybe Text
description :: Maybe Text
$sel:description:JobTemplate' :: JobTemplate -> Maybe Text
description} -> Maybe Text
description) (\s :: JobTemplate
s@JobTemplate' {} Maybe Text
a -> JobTemplate
s {$sel:description:JobTemplate' :: Maybe Text
description = Maybe Text
a} :: JobTemplate)

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

-- | A name you create for each job template. Each name must be unique within
-- your account.
jobTemplate_name :: Lens.Lens' JobTemplate Prelude.Text
jobTemplate_name :: (Text -> f Text) -> JobTemplate -> f JobTemplate
jobTemplate_name = (JobTemplate -> Text)
-> (JobTemplate -> Text -> JobTemplate)
-> Lens JobTemplate JobTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobTemplate' {Text
name :: Text
$sel:name:JobTemplate' :: JobTemplate -> Text
name} -> Text
name) (\s :: JobTemplate
s@JobTemplate' {} Text
a -> JobTemplate
s {$sel:name:JobTemplate' :: Text
name = Text
a} :: JobTemplate)

instance Core.FromJSON JobTemplate where
  parseJSON :: Value -> Parser JobTemplate
parseJSON =
    String
-> (Object -> Parser JobTemplate) -> Value -> Parser JobTemplate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"JobTemplate"
      ( \Object
x ->
          Maybe AccelerationSettings
-> Maybe POSIX
-> Maybe Int
-> Maybe StatusUpdateInterval
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [HopDestination]
-> Maybe Text
-> Maybe Type
-> Maybe Text
-> JobTemplateSettings
-> Text
-> JobTemplate
JobTemplate'
            (Maybe AccelerationSettings
 -> Maybe POSIX
 -> Maybe Int
 -> Maybe StatusUpdateInterval
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe [HopDestination]
 -> Maybe Text
 -> Maybe Type
 -> Maybe Text
 -> JobTemplateSettings
 -> Text
 -> JobTemplate)
-> Parser (Maybe AccelerationSettings)
-> Parser
     (Maybe POSIX
      -> Maybe Int
      -> Maybe StatusUpdateInterval
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [HopDestination]
      -> Maybe Text
      -> Maybe Type
      -> Maybe Text
      -> JobTemplateSettings
      -> Text
      -> JobTemplate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AccelerationSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"accelerationSettings")
            Parser
  (Maybe POSIX
   -> Maybe Int
   -> Maybe StatusUpdateInterval
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [HopDestination]
   -> Maybe Text
   -> Maybe Type
   -> Maybe Text
   -> JobTemplateSettings
   -> Text
   -> JobTemplate)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Int
      -> Maybe StatusUpdateInterval
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [HopDestination]
      -> Maybe Text
      -> Maybe Type
      -> Maybe Text
      -> JobTemplateSettings
      -> Text
      -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdated")
            Parser
  (Maybe Int
   -> Maybe StatusUpdateInterval
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [HopDestination]
   -> Maybe Text
   -> Maybe Type
   -> Maybe Text
   -> JobTemplateSettings
   -> Text
   -> JobTemplate)
-> Parser (Maybe Int)
-> Parser
     (Maybe StatusUpdateInterval
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [HopDestination]
      -> Maybe Text
      -> Maybe Type
      -> Maybe Text
      -> JobTemplateSettings
      -> Text
      -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"priority")
            Parser
  (Maybe StatusUpdateInterval
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [HopDestination]
   -> Maybe Text
   -> Maybe Type
   -> Maybe Text
   -> JobTemplateSettings
   -> Text
   -> JobTemplate)
-> Parser (Maybe StatusUpdateInterval)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [HopDestination]
      -> Maybe Text
      -> Maybe Type
      -> Maybe Text
      -> JobTemplateSettings
      -> Text
      -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StatusUpdateInterval)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statusUpdateInterval")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [HopDestination]
   -> Maybe Text
   -> Maybe Type
   -> Maybe Text
   -> JobTemplateSettings
   -> Text
   -> JobTemplate)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe [HopDestination]
      -> Maybe Text
      -> Maybe Type
      -> Maybe Text
      -> JobTemplateSettings
      -> Text
      -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe [HopDestination]
   -> Maybe Text
   -> Maybe Type
   -> Maybe Text
   -> JobTemplateSettings
   -> Text
   -> JobTemplate)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe [HopDestination]
      -> Maybe Text
      -> Maybe Type
      -> Maybe Text
      -> JobTemplateSettings
      -> Text
      -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
            Parser
  (Maybe Text
   -> Maybe [HopDestination]
   -> Maybe Text
   -> Maybe Type
   -> Maybe Text
   -> JobTemplateSettings
   -> Text
   -> JobTemplate)
-> Parser (Maybe Text)
-> Parser
     (Maybe [HopDestination]
      -> Maybe Text
      -> Maybe Type
      -> Maybe Text
      -> JobTemplateSettings
      -> Text
      -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"category")
            Parser
  (Maybe [HopDestination]
   -> Maybe Text
   -> Maybe Type
   -> Maybe Text
   -> JobTemplateSettings
   -> Text
   -> JobTemplate)
-> Parser (Maybe [HopDestination])
-> Parser
     (Maybe Text
      -> Maybe Type
      -> Maybe Text
      -> JobTemplateSettings
      -> Text
      -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [HopDestination]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hopDestinations"
                            Parser (Maybe (Maybe [HopDestination]))
-> Maybe [HopDestination] -> Parser (Maybe [HopDestination])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [HopDestination]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Type
   -> Maybe Text
   -> JobTemplateSettings
   -> Text
   -> JobTemplate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Type
      -> Maybe Text -> JobTemplateSettings -> Text -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"queue")
            Parser
  (Maybe Type
   -> Maybe Text -> JobTemplateSettings -> Text -> JobTemplate)
-> Parser (Maybe Type)
-> Parser
     (Maybe Text -> JobTemplateSettings -> Text -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Type)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
            Parser (Maybe Text -> JobTemplateSettings -> Text -> JobTemplate)
-> Parser (Maybe Text)
-> Parser (JobTemplateSettings -> Text -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
            Parser (JobTemplateSettings -> Text -> JobTemplate)
-> Parser JobTemplateSettings -> Parser (Text -> JobTemplate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser JobTemplateSettings
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"settings")
            Parser (Text -> JobTemplate) -> Parser Text -> Parser JobTemplate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
      )

instance Prelude.Hashable JobTemplate

instance Prelude.NFData JobTemplate