{-# 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.UpdateJobTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modify one of your existing job templates.
module Amazonka.MediaConvert.UpdateJobTemplate
  ( -- * Creating a Request
    UpdateJobTemplate (..),
    newUpdateJobTemplate,

    -- * Request Lenses
    updateJobTemplate_accelerationSettings,
    updateJobTemplate_category,
    updateJobTemplate_description,
    updateJobTemplate_hopDestinations,
    updateJobTemplate_priority,
    updateJobTemplate_queue,
    updateJobTemplate_settings,
    updateJobTemplate_statusUpdateInterval,
    updateJobTemplate_name,

    -- * Destructuring the Response
    UpdateJobTemplateResponse (..),
    newUpdateJobTemplateResponse,

    -- * Response Lenses
    updateJobTemplateResponse_jobTemplate,
    updateJobTemplateResponse_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:/ 'newUpdateJobTemplate' smart constructor.
data UpdateJobTemplate = UpdateJobTemplate'
  { -- | 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.
    UpdateJobTemplate -> Maybe AccelerationSettings
accelerationSettings :: Prelude.Maybe AccelerationSettings,
    -- | The new category for the job template, if you are changing it.
    UpdateJobTemplate -> Maybe Text
category :: Prelude.Maybe Prelude.Text,
    -- | The new description for the job template, if you are changing it.
    UpdateJobTemplate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Optional list of hop destinations.
    UpdateJobTemplate -> 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.
    UpdateJobTemplate -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
    -- | The new queue for the job template, if you are changing it.
    UpdateJobTemplate -> Maybe Text
queue :: Prelude.Maybe Prelude.Text,
    -- | JobTemplateSettings contains all the transcode settings saved in the
    -- template that will be applied to jobs created from it.
    UpdateJobTemplate -> Maybe JobTemplateSettings
settings :: Prelude.Maybe JobTemplateSettings,
    -- | 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.
    UpdateJobTemplate -> Maybe StatusUpdateInterval
statusUpdateInterval :: Prelude.Maybe StatusUpdateInterval,
    -- | The name of the job template you are modifying
    UpdateJobTemplate -> Text
name :: Prelude.Text
  }
  deriving (UpdateJobTemplate -> UpdateJobTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateJobTemplate -> UpdateJobTemplate -> Bool
$c/= :: UpdateJobTemplate -> UpdateJobTemplate -> Bool
== :: UpdateJobTemplate -> UpdateJobTemplate -> Bool
$c== :: UpdateJobTemplate -> UpdateJobTemplate -> Bool
Prelude.Eq, ReadPrec [UpdateJobTemplate]
ReadPrec UpdateJobTemplate
Int -> ReadS UpdateJobTemplate
ReadS [UpdateJobTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateJobTemplate]
$creadListPrec :: ReadPrec [UpdateJobTemplate]
readPrec :: ReadPrec UpdateJobTemplate
$creadPrec :: ReadPrec UpdateJobTemplate
readList :: ReadS [UpdateJobTemplate]
$creadList :: ReadS [UpdateJobTemplate]
readsPrec :: Int -> ReadS UpdateJobTemplate
$creadsPrec :: Int -> ReadS UpdateJobTemplate
Prelude.Read, Int -> UpdateJobTemplate -> ShowS
[UpdateJobTemplate] -> ShowS
UpdateJobTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateJobTemplate] -> ShowS
$cshowList :: [UpdateJobTemplate] -> ShowS
show :: UpdateJobTemplate -> String
$cshow :: UpdateJobTemplate -> String
showsPrec :: Int -> UpdateJobTemplate -> ShowS
$cshowsPrec :: Int -> UpdateJobTemplate -> ShowS
Prelude.Show, forall x. Rep UpdateJobTemplate x -> UpdateJobTemplate
forall x. UpdateJobTemplate -> Rep UpdateJobTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateJobTemplate x -> UpdateJobTemplate
$cfrom :: forall x. UpdateJobTemplate -> Rep UpdateJobTemplate x
Prelude.Generic)

-- |
-- Create a value of 'UpdateJobTemplate' 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', 'updateJobTemplate_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', 'updateJobTemplate_category' - The new category for the job template, if you are changing it.
--
-- 'description', 'updateJobTemplate_description' - The new description for the job template, if you are changing it.
--
-- 'hopDestinations', 'updateJobTemplate_hopDestinations' - Optional list of hop destinations.
--
-- 'priority', 'updateJobTemplate_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', 'updateJobTemplate_queue' - The new queue for the job template, if you are changing it.
--
-- 'settings', 'updateJobTemplate_settings' - JobTemplateSettings contains all the transcode settings saved in the
-- template that will be applied to jobs created from it.
--
-- 'statusUpdateInterval', 'updateJobTemplate_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.
--
-- 'name', 'updateJobTemplate_name' - The name of the job template you are modifying
newUpdateJobTemplate ::
  -- | 'name'
  Prelude.Text ->
  UpdateJobTemplate
newUpdateJobTemplate :: Text -> UpdateJobTemplate
newUpdateJobTemplate Text
pName_ =
  UpdateJobTemplate'
    { $sel:accelerationSettings:UpdateJobTemplate' :: Maybe AccelerationSettings
accelerationSettings =
        forall a. Maybe a
Prelude.Nothing,
      $sel:category:UpdateJobTemplate' :: Maybe Text
category = forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateJobTemplate' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:hopDestinations:UpdateJobTemplate' :: Maybe [HopDestination]
hopDestinations = forall a. Maybe a
Prelude.Nothing,
      $sel:priority:UpdateJobTemplate' :: Maybe Int
priority = forall a. Maybe a
Prelude.Nothing,
      $sel:queue:UpdateJobTemplate' :: Maybe Text
queue = forall a. Maybe a
Prelude.Nothing,
      $sel:settings:UpdateJobTemplate' :: Maybe JobTemplateSettings
settings = forall a. Maybe a
Prelude.Nothing,
      $sel:statusUpdateInterval:UpdateJobTemplate' :: Maybe StatusUpdateInterval
statusUpdateInterval = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateJobTemplate' :: 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.
updateJobTemplate_accelerationSettings :: Lens.Lens' UpdateJobTemplate (Prelude.Maybe AccelerationSettings)
updateJobTemplate_accelerationSettings :: Lens' UpdateJobTemplate (Maybe AccelerationSettings)
updateJobTemplate_accelerationSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobTemplate' {Maybe AccelerationSettings
accelerationSettings :: Maybe AccelerationSettings
$sel:accelerationSettings:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe AccelerationSettings
accelerationSettings} -> Maybe AccelerationSettings
accelerationSettings) (\s :: UpdateJobTemplate
s@UpdateJobTemplate' {} Maybe AccelerationSettings
a -> UpdateJobTemplate
s {$sel:accelerationSettings:UpdateJobTemplate' :: Maybe AccelerationSettings
accelerationSettings = Maybe AccelerationSettings
a} :: UpdateJobTemplate)

-- | The new category for the job template, if you are changing it.
updateJobTemplate_category :: Lens.Lens' UpdateJobTemplate (Prelude.Maybe Prelude.Text)
updateJobTemplate_category :: Lens' UpdateJobTemplate (Maybe Text)
updateJobTemplate_category = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobTemplate' {Maybe Text
category :: Maybe Text
$sel:category:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
category} -> Maybe Text
category) (\s :: UpdateJobTemplate
s@UpdateJobTemplate' {} Maybe Text
a -> UpdateJobTemplate
s {$sel:category:UpdateJobTemplate' :: Maybe Text
category = Maybe Text
a} :: UpdateJobTemplate)

-- | The new description for the job template, if you are changing it.
updateJobTemplate_description :: Lens.Lens' UpdateJobTemplate (Prelude.Maybe Prelude.Text)
updateJobTemplate_description :: Lens' UpdateJobTemplate (Maybe Text)
updateJobTemplate_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobTemplate' {Maybe Text
description :: Maybe Text
$sel:description:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateJobTemplate
s@UpdateJobTemplate' {} Maybe Text
a -> UpdateJobTemplate
s {$sel:description:UpdateJobTemplate' :: Maybe Text
description = Maybe Text
a} :: UpdateJobTemplate)

-- | Optional list of hop destinations.
updateJobTemplate_hopDestinations :: Lens.Lens' UpdateJobTemplate (Prelude.Maybe [HopDestination])
updateJobTemplate_hopDestinations :: Lens' UpdateJobTemplate (Maybe [HopDestination])
updateJobTemplate_hopDestinations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobTemplate' {Maybe [HopDestination]
hopDestinations :: Maybe [HopDestination]
$sel:hopDestinations:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe [HopDestination]
hopDestinations} -> Maybe [HopDestination]
hopDestinations) (\s :: UpdateJobTemplate
s@UpdateJobTemplate' {} Maybe [HopDestination]
a -> UpdateJobTemplate
s {$sel:hopDestinations:UpdateJobTemplate' :: Maybe [HopDestination]
hopDestinations = Maybe [HopDestination]
a} :: UpdateJobTemplate) 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.
updateJobTemplate_priority :: Lens.Lens' UpdateJobTemplate (Prelude.Maybe Prelude.Int)
updateJobTemplate_priority :: Lens' UpdateJobTemplate (Maybe Int)
updateJobTemplate_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobTemplate' {Maybe Int
priority :: Maybe Int
$sel:priority:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Int
priority} -> Maybe Int
priority) (\s :: UpdateJobTemplate
s@UpdateJobTemplate' {} Maybe Int
a -> UpdateJobTemplate
s {$sel:priority:UpdateJobTemplate' :: Maybe Int
priority = Maybe Int
a} :: UpdateJobTemplate)

-- | The new queue for the job template, if you are changing it.
updateJobTemplate_queue :: Lens.Lens' UpdateJobTemplate (Prelude.Maybe Prelude.Text)
updateJobTemplate_queue :: Lens' UpdateJobTemplate (Maybe Text)
updateJobTemplate_queue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateJobTemplate' {Maybe Text
queue :: Maybe Text
$sel:queue:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
queue} -> Maybe Text
queue) (\s :: UpdateJobTemplate
s@UpdateJobTemplate' {} Maybe Text
a -> UpdateJobTemplate
s {$sel:queue:UpdateJobTemplate' :: Maybe Text
queue = Maybe Text
a} :: UpdateJobTemplate)

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

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

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

instance Core.AWSRequest UpdateJobTemplate where
  type
    AWSResponse UpdateJobTemplate =
      UpdateJobTemplateResponse
  request :: (Service -> Service)
-> UpdateJobTemplate -> Request UpdateJobTemplate
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateJobTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateJobTemplate)))
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 -> UpdateJobTemplateResponse
UpdateJobTemplateResponse'
            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 UpdateJobTemplate where
  hashWithSalt :: Int -> UpdateJobTemplate -> Int
hashWithSalt Int
_salt UpdateJobTemplate' {Maybe Int
Maybe [HopDestination]
Maybe Text
Maybe AccelerationSettings
Maybe StatusUpdateInterval
Maybe JobTemplateSettings
Text
name :: Text
statusUpdateInterval :: Maybe StatusUpdateInterval
settings :: Maybe JobTemplateSettings
queue :: Maybe Text
priority :: Maybe Int
hopDestinations :: Maybe [HopDestination]
description :: Maybe Text
category :: Maybe Text
accelerationSettings :: Maybe AccelerationSettings
$sel:name:UpdateJobTemplate' :: UpdateJobTemplate -> Text
$sel:statusUpdateInterval:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe StatusUpdateInterval
$sel:settings:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe JobTemplateSettings
$sel:queue:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:priority:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Int
$sel:hopDestinations:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe [HopDestination]
$sel:description:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:category:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:accelerationSettings:UpdateJobTemplate' :: UpdateJobTemplate -> 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 JobTemplateSettings
settings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StatusUpdateInterval
statusUpdateInterval
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData UpdateJobTemplate where
  rnf :: UpdateJobTemplate -> ()
rnf UpdateJobTemplate' {Maybe Int
Maybe [HopDestination]
Maybe Text
Maybe AccelerationSettings
Maybe StatusUpdateInterval
Maybe JobTemplateSettings
Text
name :: Text
statusUpdateInterval :: Maybe StatusUpdateInterval
settings :: Maybe JobTemplateSettings
queue :: Maybe Text
priority :: Maybe Int
hopDestinations :: Maybe [HopDestination]
description :: Maybe Text
category :: Maybe Text
accelerationSettings :: Maybe AccelerationSettings
$sel:name:UpdateJobTemplate' :: UpdateJobTemplate -> Text
$sel:statusUpdateInterval:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe StatusUpdateInterval
$sel:settings:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe JobTemplateSettings
$sel:queue:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:priority:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Int
$sel:hopDestinations:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe [HopDestination]
$sel:description:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:category:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:accelerationSettings:UpdateJobTemplate' :: UpdateJobTemplate -> 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 JobTemplateSettings
settings
      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 Text
name

instance Data.ToHeaders UpdateJobTemplate where
  toHeaders :: UpdateJobTemplate -> 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 UpdateJobTemplate where
  toJSON :: UpdateJobTemplate -> Value
toJSON UpdateJobTemplate' {Maybe Int
Maybe [HopDestination]
Maybe Text
Maybe AccelerationSettings
Maybe StatusUpdateInterval
Maybe JobTemplateSettings
Text
name :: Text
statusUpdateInterval :: Maybe StatusUpdateInterval
settings :: Maybe JobTemplateSettings
queue :: Maybe Text
priority :: Maybe Int
hopDestinations :: Maybe [HopDestination]
description :: Maybe Text
category :: Maybe Text
accelerationSettings :: Maybe AccelerationSettings
$sel:name:UpdateJobTemplate' :: UpdateJobTemplate -> Text
$sel:statusUpdateInterval:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe StatusUpdateInterval
$sel:settings:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe JobTemplateSettings
$sel:queue:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:priority:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Int
$sel:hopDestinations:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe [HopDestination]
$sel:description:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:category:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:accelerationSettings:UpdateJobTemplate' :: UpdateJobTemplate -> 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
"settings" 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 JobTemplateSettings
settings,
            (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
          ]
      )

instance Data.ToPath UpdateJobTemplate where
  toPath :: UpdateJobTemplate -> ByteString
toPath UpdateJobTemplate' {Maybe Int
Maybe [HopDestination]
Maybe Text
Maybe AccelerationSettings
Maybe StatusUpdateInterval
Maybe JobTemplateSettings
Text
name :: Text
statusUpdateInterval :: Maybe StatusUpdateInterval
settings :: Maybe JobTemplateSettings
queue :: Maybe Text
priority :: Maybe Int
hopDestinations :: Maybe [HopDestination]
description :: Maybe Text
category :: Maybe Text
accelerationSettings :: Maybe AccelerationSettings
$sel:name:UpdateJobTemplate' :: UpdateJobTemplate -> Text
$sel:statusUpdateInterval:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe StatusUpdateInterval
$sel:settings:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe JobTemplateSettings
$sel:queue:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:priority:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Int
$sel:hopDestinations:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe [HopDestination]
$sel:description:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:category:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe Text
$sel:accelerationSettings:UpdateJobTemplate' :: UpdateJobTemplate -> Maybe AccelerationSettings
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2017-08-29/jobTemplates/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
name]

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

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

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

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

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

instance Prelude.NFData UpdateJobTemplateResponse where
  rnf :: UpdateJobTemplateResponse -> ()
rnf UpdateJobTemplateResponse' {Int
Maybe JobTemplate
httpStatus :: Int
jobTemplate :: Maybe JobTemplate
$sel:httpStatus:UpdateJobTemplateResponse' :: UpdateJobTemplateResponse -> Int
$sel:jobTemplate:UpdateJobTemplateResponse' :: UpdateJobTemplateResponse -> 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