{-# 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.ElasticTranscoder.Types.Job
-- 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.ElasticTranscoder.Types.Job where

import qualified Amazonka.Core as Core
import Amazonka.ElasticTranscoder.Types.JobInput
import Amazonka.ElasticTranscoder.Types.JobOutput
import Amazonka.ElasticTranscoder.Types.Playlist
import Amazonka.ElasticTranscoder.Types.Timing
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A section of the response body that provides information about the job
-- that is created.
--
-- /See:/ 'newJob' smart constructor.
data Job = Job'
  { -- | The status of the job: @Submitted@, @Progressing@, @Complete@,
    -- @Canceled@, or @Error@.
    Job -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The @Id@ of the pipeline that you want Elastic Transcoder to use for
    -- transcoding. The pipeline determines several settings, including the
    -- Amazon S3 bucket from which Elastic Transcoder gets the files to
    -- transcode and the bucket into which Elastic Transcoder puts the
    -- transcoded files.
    Job -> Maybe Text
pipelineId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the job.
    Job -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Information about the files that you\'re transcoding. If you specified
    -- multiple files for this job, Elastic Transcoder stitches the files
    -- together to make one output.
    Job -> Maybe [JobInput]
inputs :: Prelude.Maybe [JobInput],
    -- | A section of the request or response body that provides information
    -- about the file that is being transcoded.
    Job -> Maybe JobInput
input :: Prelude.Maybe JobInput,
    -- | User-defined metadata that you want to associate with an Elastic
    -- Transcoder job. You specify metadata in @key\/value@ pairs, and you can
    -- add up to 10 @key\/value@ pairs per job. Elastic Transcoder does not
    -- guarantee that @key\/value@ pairs are returned in the same order in
    -- which you specify them.
    --
    -- Metadata @keys@ and @values@ must use characters from the following
    -- list:
    --
    -- -   @0-9@
    --
    -- -   @A-Z@ and @a-z@
    --
    -- -   @Space@
    --
    -- -   The following symbols: @_.:\/=+-%\@@
    Job -> Maybe (HashMap Text Text)
userMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Information about the output files. We recommend that you use the
    -- @Outputs@ syntax for all jobs, even when you want Elastic Transcoder to
    -- transcode a file into only one format. Do not use both the @Outputs@ and
    -- @Output@ syntaxes in the same request. You can create a maximum of 30
    -- outputs per job.
    --
    -- If you specify more than one output for a job, Elastic Transcoder
    -- creates the files for each output in the order in which you specify them
    -- in the job.
    Job -> Maybe [JobOutput]
outputs :: Prelude.Maybe [JobOutput],
    -- | If you specified one output for a job, information about that output. If
    -- you specified multiple outputs for a job, the Output object lists
    -- information about the first output. This duplicates the information that
    -- is listed for the first output in the Outputs object.
    --
    -- Outputs recommended instead.
    --
    -- A section of the request or response body that provides information
    -- about the transcoded (target) file.
    Job -> Maybe JobOutput
output :: Prelude.Maybe JobOutput,
    -- | The identifier that Elastic Transcoder assigned to the job. You use this
    -- value to get settings for the job or to delete the job.
    Job -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Outputs in Fragmented MP4 or MPEG-TS format only.
    --
    -- If you specify a preset in @PresetId@ for which the value of @Container@
    -- is fmp4 (Fragmented MP4) or ts (MPEG-TS), @Playlists@ contains
    -- information about the master playlists that you want Elastic Transcoder
    -- to create.
    --
    -- The maximum number of master playlists in a job is 30.
    Job -> Maybe [Playlist]
playlists :: Prelude.Maybe [Playlist],
    -- | The value, if any, that you want Elastic Transcoder to prepend to the
    -- names of all files that this job creates, including output files,
    -- thumbnails, and playlists. We recommend that you add a \/ or some other
    -- delimiter to the end of the @OutputKeyPrefix@.
    Job -> Maybe Text
outputKeyPrefix :: Prelude.Maybe Prelude.Text,
    -- | Details about the timing of a job.
    Job -> Maybe Timing
timing :: Prelude.Maybe Timing
  }
  deriving (Job -> Job -> Bool
(Job -> Job -> Bool) -> (Job -> Job -> Bool) -> Eq Job
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Job -> Job -> Bool
$c/= :: Job -> Job -> Bool
== :: Job -> Job -> Bool
$c== :: Job -> Job -> Bool
Prelude.Eq, ReadPrec [Job]
ReadPrec Job
Int -> ReadS Job
ReadS [Job]
(Int -> ReadS Job)
-> ReadS [Job] -> ReadPrec Job -> ReadPrec [Job] -> Read Job
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Job]
$creadListPrec :: ReadPrec [Job]
readPrec :: ReadPrec Job
$creadPrec :: ReadPrec Job
readList :: ReadS [Job]
$creadList :: ReadS [Job]
readsPrec :: Int -> ReadS Job
$creadsPrec :: Int -> ReadS Job
Prelude.Read, Int -> Job -> ShowS
[Job] -> ShowS
Job -> String
(Int -> Job -> ShowS)
-> (Job -> String) -> ([Job] -> ShowS) -> Show Job
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Job] -> ShowS
$cshowList :: [Job] -> ShowS
show :: Job -> String
$cshow :: Job -> String
showsPrec :: Int -> Job -> ShowS
$cshowsPrec :: Int -> Job -> ShowS
Prelude.Show, (forall x. Job -> Rep Job x)
-> (forall x. Rep Job x -> Job) -> Generic Job
forall x. Rep Job x -> Job
forall x. Job -> Rep Job x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Job x -> Job
$cfrom :: forall x. Job -> Rep Job x
Prelude.Generic)

-- |
-- Create a value of 'Job' 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:
--
-- 'status', 'job_status' - The status of the job: @Submitted@, @Progressing@, @Complete@,
-- @Canceled@, or @Error@.
--
-- 'pipelineId', 'job_pipelineId' - The @Id@ of the pipeline that you want Elastic Transcoder to use for
-- transcoding. The pipeline determines several settings, including the
-- Amazon S3 bucket from which Elastic Transcoder gets the files to
-- transcode and the bucket into which Elastic Transcoder puts the
-- transcoded files.
--
-- 'arn', 'job_arn' - The Amazon Resource Name (ARN) for the job.
--
-- 'inputs', 'job_inputs' - Information about the files that you\'re transcoding. If you specified
-- multiple files for this job, Elastic Transcoder stitches the files
-- together to make one output.
--
-- 'input', 'job_input' - A section of the request or response body that provides information
-- about the file that is being transcoded.
--
-- 'userMetadata', 'job_userMetadata' - User-defined metadata that you want to associate with an Elastic
-- Transcoder job. You specify metadata in @key\/value@ pairs, and you can
-- add up to 10 @key\/value@ pairs per job. Elastic Transcoder does not
-- guarantee that @key\/value@ pairs are returned in the same order in
-- which you specify them.
--
-- Metadata @keys@ and @values@ must use characters from the following
-- list:
--
-- -   @0-9@
--
-- -   @A-Z@ and @a-z@
--
-- -   @Space@
--
-- -   The following symbols: @_.:\/=+-%\@@
--
-- 'outputs', 'job_outputs' - Information about the output files. We recommend that you use the
-- @Outputs@ syntax for all jobs, even when you want Elastic Transcoder to
-- transcode a file into only one format. Do not use both the @Outputs@ and
-- @Output@ syntaxes in the same request. You can create a maximum of 30
-- outputs per job.
--
-- If you specify more than one output for a job, Elastic Transcoder
-- creates the files for each output in the order in which you specify them
-- in the job.
--
-- 'output', 'job_output' - If you specified one output for a job, information about that output. If
-- you specified multiple outputs for a job, the Output object lists
-- information about the first output. This duplicates the information that
-- is listed for the first output in the Outputs object.
--
-- Outputs recommended instead.
--
-- A section of the request or response body that provides information
-- about the transcoded (target) file.
--
-- 'id', 'job_id' - The identifier that Elastic Transcoder assigned to the job. You use this
-- value to get settings for the job or to delete the job.
--
-- 'playlists', 'job_playlists' - Outputs in Fragmented MP4 or MPEG-TS format only.
--
-- If you specify a preset in @PresetId@ for which the value of @Container@
-- is fmp4 (Fragmented MP4) or ts (MPEG-TS), @Playlists@ contains
-- information about the master playlists that you want Elastic Transcoder
-- to create.
--
-- The maximum number of master playlists in a job is 30.
--
-- 'outputKeyPrefix', 'job_outputKeyPrefix' - The value, if any, that you want Elastic Transcoder to prepend to the
-- names of all files that this job creates, including output files,
-- thumbnails, and playlists. We recommend that you add a \/ or some other
-- delimiter to the end of the @OutputKeyPrefix@.
--
-- 'timing', 'job_timing' - Details about the timing of a job.
newJob ::
  Job
newJob :: Job
newJob =
  Job' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [JobInput]
-> Maybe JobInput
-> Maybe (HashMap Text Text)
-> Maybe [JobOutput]
-> Maybe JobOutput
-> Maybe Text
-> Maybe [Playlist]
-> Maybe Text
-> Maybe Timing
-> Job
Job'
    { $sel:status:Job' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pipelineId:Job' :: Maybe Text
pipelineId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Job' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:inputs:Job' :: Maybe [JobInput]
inputs = Maybe [JobInput]
forall a. Maybe a
Prelude.Nothing,
      $sel:input:Job' :: Maybe JobInput
input = Maybe JobInput
forall a. Maybe a
Prelude.Nothing,
      $sel:userMetadata:Job' :: Maybe (HashMap Text Text)
userMetadata = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:outputs:Job' :: Maybe [JobOutput]
outputs = Maybe [JobOutput]
forall a. Maybe a
Prelude.Nothing,
      $sel:output:Job' :: Maybe JobOutput
output = Maybe JobOutput
forall a. Maybe a
Prelude.Nothing,
      $sel:id:Job' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:playlists:Job' :: Maybe [Playlist]
playlists = Maybe [Playlist]
forall a. Maybe a
Prelude.Nothing,
      $sel:outputKeyPrefix:Job' :: Maybe Text
outputKeyPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:timing:Job' :: Maybe Timing
timing = Maybe Timing
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the job: @Submitted@, @Progressing@, @Complete@,
-- @Canceled@, or @Error@.
job_status :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_status :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_status = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
status :: Maybe Text
$sel:status:Job' :: Job -> Maybe Text
status} -> Maybe Text
status) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:status:Job' :: Maybe Text
status = Maybe Text
a} :: Job)

-- | The @Id@ of the pipeline that you want Elastic Transcoder to use for
-- transcoding. The pipeline determines several settings, including the
-- Amazon S3 bucket from which Elastic Transcoder gets the files to
-- transcode and the bucket into which Elastic Transcoder puts the
-- transcoded files.
job_pipelineId :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_pipelineId :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_pipelineId = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
pipelineId :: Maybe Text
$sel:pipelineId:Job' :: Job -> Maybe Text
pipelineId} -> Maybe Text
pipelineId) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:pipelineId:Job' :: Maybe Text
pipelineId = Maybe Text
a} :: Job)

-- | The Amazon Resource Name (ARN) for the job.
job_arn :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_arn :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_arn = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
arn :: Maybe Text
$sel:arn:Job' :: Job -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:arn:Job' :: Maybe Text
arn = Maybe Text
a} :: Job)

-- | Information about the files that you\'re transcoding. If you specified
-- multiple files for this job, Elastic Transcoder stitches the files
-- together to make one output.
job_inputs :: Lens.Lens' Job (Prelude.Maybe [JobInput])
job_inputs :: (Maybe [JobInput] -> f (Maybe [JobInput])) -> Job -> f Job
job_inputs = (Job -> Maybe [JobInput])
-> (Job -> Maybe [JobInput] -> Job)
-> Lens Job Job (Maybe [JobInput]) (Maybe [JobInput])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe [JobInput]
inputs :: Maybe [JobInput]
$sel:inputs:Job' :: Job -> Maybe [JobInput]
inputs} -> Maybe [JobInput]
inputs) (\s :: Job
s@Job' {} Maybe [JobInput]
a -> Job
s {$sel:inputs:Job' :: Maybe [JobInput]
inputs = Maybe [JobInput]
a} :: Job) ((Maybe [JobInput] -> f (Maybe [JobInput])) -> Job -> f Job)
-> ((Maybe [JobInput] -> f (Maybe [JobInput]))
    -> Maybe [JobInput] -> f (Maybe [JobInput]))
-> (Maybe [JobInput] -> f (Maybe [JobInput]))
-> Job
-> f Job
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [JobInput] [JobInput] [JobInput] [JobInput]
-> Iso
     (Maybe [JobInput])
     (Maybe [JobInput])
     (Maybe [JobInput])
     (Maybe [JobInput])
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 [JobInput] [JobInput] [JobInput] [JobInput]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A section of the request or response body that provides information
-- about the file that is being transcoded.
job_input :: Lens.Lens' Job (Prelude.Maybe JobInput)
job_input :: (Maybe JobInput -> f (Maybe JobInput)) -> Job -> f Job
job_input = (Job -> Maybe JobInput)
-> (Job -> Maybe JobInput -> Job)
-> Lens Job Job (Maybe JobInput) (Maybe JobInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe JobInput
input :: Maybe JobInput
$sel:input:Job' :: Job -> Maybe JobInput
input} -> Maybe JobInput
input) (\s :: Job
s@Job' {} Maybe JobInput
a -> Job
s {$sel:input:Job' :: Maybe JobInput
input = Maybe JobInput
a} :: Job)

-- | User-defined metadata that you want to associate with an Elastic
-- Transcoder job. You specify metadata in @key\/value@ pairs, and you can
-- add up to 10 @key\/value@ pairs per job. Elastic Transcoder does not
-- guarantee that @key\/value@ pairs are returned in the same order in
-- which you specify them.
--
-- Metadata @keys@ and @values@ must use characters from the following
-- list:
--
-- -   @0-9@
--
-- -   @A-Z@ and @a-z@
--
-- -   @Space@
--
-- -   The following symbols: @_.:\/=+-%\@@
job_userMetadata :: Lens.Lens' Job (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
job_userMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Job -> f Job
job_userMetadata = (Job -> Maybe (HashMap Text Text))
-> (Job -> Maybe (HashMap Text Text) -> Job)
-> Lens
     Job Job (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 (\Job' {Maybe (HashMap Text Text)
userMetadata :: Maybe (HashMap Text Text)
$sel:userMetadata:Job' :: Job -> Maybe (HashMap Text Text)
userMetadata} -> Maybe (HashMap Text Text)
userMetadata) (\s :: Job
s@Job' {} Maybe (HashMap Text Text)
a -> Job
s {$sel:userMetadata:Job' :: Maybe (HashMap Text Text)
userMetadata = Maybe (HashMap Text Text)
a} :: Job) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> Job -> f Job)
-> ((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)))
-> Job
-> f Job
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

-- | Information about the output files. We recommend that you use the
-- @Outputs@ syntax for all jobs, even when you want Elastic Transcoder to
-- transcode a file into only one format. Do not use both the @Outputs@ and
-- @Output@ syntaxes in the same request. You can create a maximum of 30
-- outputs per job.
--
-- If you specify more than one output for a job, Elastic Transcoder
-- creates the files for each output in the order in which you specify them
-- in the job.
job_outputs :: Lens.Lens' Job (Prelude.Maybe [JobOutput])
job_outputs :: (Maybe [JobOutput] -> f (Maybe [JobOutput])) -> Job -> f Job
job_outputs = (Job -> Maybe [JobOutput])
-> (Job -> Maybe [JobOutput] -> Job)
-> Lens Job Job (Maybe [JobOutput]) (Maybe [JobOutput])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe [JobOutput]
outputs :: Maybe [JobOutput]
$sel:outputs:Job' :: Job -> Maybe [JobOutput]
outputs} -> Maybe [JobOutput]
outputs) (\s :: Job
s@Job' {} Maybe [JobOutput]
a -> Job
s {$sel:outputs:Job' :: Maybe [JobOutput]
outputs = Maybe [JobOutput]
a} :: Job) ((Maybe [JobOutput] -> f (Maybe [JobOutput])) -> Job -> f Job)
-> ((Maybe [JobOutput] -> f (Maybe [JobOutput]))
    -> Maybe [JobOutput] -> f (Maybe [JobOutput]))
-> (Maybe [JobOutput] -> f (Maybe [JobOutput]))
-> Job
-> f Job
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [JobOutput] [JobOutput] [JobOutput] [JobOutput]
-> Iso
     (Maybe [JobOutput])
     (Maybe [JobOutput])
     (Maybe [JobOutput])
     (Maybe [JobOutput])
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 [JobOutput] [JobOutput] [JobOutput] [JobOutput]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If you specified one output for a job, information about that output. If
-- you specified multiple outputs for a job, the Output object lists
-- information about the first output. This duplicates the information that
-- is listed for the first output in the Outputs object.
--
-- Outputs recommended instead.
--
-- A section of the request or response body that provides information
-- about the transcoded (target) file.
job_output :: Lens.Lens' Job (Prelude.Maybe JobOutput)
job_output :: (Maybe JobOutput -> f (Maybe JobOutput)) -> Job -> f Job
job_output = (Job -> Maybe JobOutput)
-> (Job -> Maybe JobOutput -> Job)
-> Lens Job Job (Maybe JobOutput) (Maybe JobOutput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe JobOutput
output :: Maybe JobOutput
$sel:output:Job' :: Job -> Maybe JobOutput
output} -> Maybe JobOutput
output) (\s :: Job
s@Job' {} Maybe JobOutput
a -> Job
s {$sel:output:Job' :: Maybe JobOutput
output = Maybe JobOutput
a} :: Job)

-- | The identifier that Elastic Transcoder assigned to the job. You use this
-- value to get settings for the job or to delete the job.
job_id :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_id :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_id = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
id :: Maybe Text
$sel:id:Job' :: Job -> Maybe Text
id} -> Maybe Text
id) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:id:Job' :: Maybe Text
id = Maybe Text
a} :: Job)

-- | Outputs in Fragmented MP4 or MPEG-TS format only.
--
-- If you specify a preset in @PresetId@ for which the value of @Container@
-- is fmp4 (Fragmented MP4) or ts (MPEG-TS), @Playlists@ contains
-- information about the master playlists that you want Elastic Transcoder
-- to create.
--
-- The maximum number of master playlists in a job is 30.
job_playlists :: Lens.Lens' Job (Prelude.Maybe [Playlist])
job_playlists :: (Maybe [Playlist] -> f (Maybe [Playlist])) -> Job -> f Job
job_playlists = (Job -> Maybe [Playlist])
-> (Job -> Maybe [Playlist] -> Job)
-> Lens Job Job (Maybe [Playlist]) (Maybe [Playlist])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe [Playlist]
playlists :: Maybe [Playlist]
$sel:playlists:Job' :: Job -> Maybe [Playlist]
playlists} -> Maybe [Playlist]
playlists) (\s :: Job
s@Job' {} Maybe [Playlist]
a -> Job
s {$sel:playlists:Job' :: Maybe [Playlist]
playlists = Maybe [Playlist]
a} :: Job) ((Maybe [Playlist] -> f (Maybe [Playlist])) -> Job -> f Job)
-> ((Maybe [Playlist] -> f (Maybe [Playlist]))
    -> Maybe [Playlist] -> f (Maybe [Playlist]))
-> (Maybe [Playlist] -> f (Maybe [Playlist]))
-> Job
-> f Job
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Playlist] [Playlist] [Playlist] [Playlist]
-> Iso
     (Maybe [Playlist])
     (Maybe [Playlist])
     (Maybe [Playlist])
     (Maybe [Playlist])
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 [Playlist] [Playlist] [Playlist] [Playlist]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The value, if any, that you want Elastic Transcoder to prepend to the
-- names of all files that this job creates, including output files,
-- thumbnails, and playlists. We recommend that you add a \/ or some other
-- delimiter to the end of the @OutputKeyPrefix@.
job_outputKeyPrefix :: Lens.Lens' Job (Prelude.Maybe Prelude.Text)
job_outputKeyPrefix :: (Maybe Text -> f (Maybe Text)) -> Job -> f Job
job_outputKeyPrefix = (Job -> Maybe Text)
-> (Job -> Maybe Text -> Job)
-> Lens Job Job (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Text
outputKeyPrefix :: Maybe Text
$sel:outputKeyPrefix:Job' :: Job -> Maybe Text
outputKeyPrefix} -> Maybe Text
outputKeyPrefix) (\s :: Job
s@Job' {} Maybe Text
a -> Job
s {$sel:outputKeyPrefix:Job' :: Maybe Text
outputKeyPrefix = Maybe Text
a} :: Job)

-- | Details about the timing of a job.
job_timing :: Lens.Lens' Job (Prelude.Maybe Timing)
job_timing :: (Maybe Timing -> f (Maybe Timing)) -> Job -> f Job
job_timing = (Job -> Maybe Timing)
-> (Job -> Maybe Timing -> Job)
-> Lens Job Job (Maybe Timing) (Maybe Timing)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Job' {Maybe Timing
timing :: Maybe Timing
$sel:timing:Job' :: Job -> Maybe Timing
timing} -> Maybe Timing
timing) (\s :: Job
s@Job' {} Maybe Timing
a -> Job
s {$sel:timing:Job' :: Maybe Timing
timing = Maybe Timing
a} :: Job)

instance Core.FromJSON Job where
  parseJSON :: Value -> Parser Job
parseJSON =
    String -> (Object -> Parser Job) -> Value -> Parser Job
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Job"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [JobInput]
-> Maybe JobInput
-> Maybe (HashMap Text Text)
-> Maybe [JobOutput]
-> Maybe JobOutput
-> Maybe Text
-> Maybe [Playlist]
-> Maybe Text
-> Maybe Timing
-> Job
Job'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [JobInput]
 -> Maybe JobInput
 -> Maybe (HashMap Text Text)
 -> Maybe [JobOutput]
 -> Maybe JobOutput
 -> Maybe Text
 -> Maybe [Playlist]
 -> Maybe Text
 -> Maybe Timing
 -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [JobInput]
      -> Maybe JobInput
      -> Maybe (HashMap Text Text)
      -> Maybe [JobOutput]
      -> Maybe JobOutput
      -> Maybe Text
      -> Maybe [Playlist]
      -> Maybe Text
      -> Maybe Timing
      -> Job)
forall (f :: * -> *) a b. Functor 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
"Status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [JobInput]
   -> Maybe JobInput
   -> Maybe (HashMap Text Text)
   -> Maybe [JobOutput]
   -> Maybe JobOutput
   -> Maybe Text
   -> Maybe [Playlist]
   -> Maybe Text
   -> Maybe Timing
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [JobInput]
      -> Maybe JobInput
      -> Maybe (HashMap Text Text)
      -> Maybe [JobOutput]
      -> Maybe JobOutput
      -> Maybe Text
      -> Maybe [Playlist]
      -> Maybe Text
      -> Maybe Timing
      -> Job)
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
"PipelineId")
            Parser
  (Maybe Text
   -> Maybe [JobInput]
   -> Maybe JobInput
   -> Maybe (HashMap Text Text)
   -> Maybe [JobOutput]
   -> Maybe JobOutput
   -> Maybe Text
   -> Maybe [Playlist]
   -> Maybe Text
   -> Maybe Timing
   -> Job)
-> Parser (Maybe Text)
-> Parser
     (Maybe [JobInput]
      -> Maybe JobInput
      -> Maybe (HashMap Text Text)
      -> Maybe [JobOutput]
      -> Maybe JobOutput
      -> Maybe Text
      -> Maybe [Playlist]
      -> Maybe Text
      -> Maybe Timing
      -> Job)
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 [JobInput]
   -> Maybe JobInput
   -> Maybe (HashMap Text Text)
   -> Maybe [JobOutput]
   -> Maybe JobOutput
   -> Maybe Text
   -> Maybe [Playlist]
   -> Maybe Text
   -> Maybe Timing
   -> Job)
-> Parser (Maybe [JobInput])
-> Parser
     (Maybe JobInput
      -> Maybe (HashMap Text Text)
      -> Maybe [JobOutput]
      -> Maybe JobOutput
      -> Maybe Text
      -> Maybe [Playlist]
      -> Maybe Text
      -> Maybe Timing
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [JobInput]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Inputs" Parser (Maybe (Maybe [JobInput]))
-> Maybe [JobInput] -> Parser (Maybe [JobInput])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [JobInput]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe JobInput
   -> Maybe (HashMap Text Text)
   -> Maybe [JobOutput]
   -> Maybe JobOutput
   -> Maybe Text
   -> Maybe [Playlist]
   -> Maybe Text
   -> Maybe Timing
   -> Job)
-> Parser (Maybe JobInput)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe [JobOutput]
      -> Maybe JobOutput
      -> Maybe Text
      -> Maybe [Playlist]
      -> Maybe Text
      -> Maybe Timing
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobInput)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Input")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe [JobOutput]
   -> Maybe JobOutput
   -> Maybe Text
   -> Maybe [Playlist]
   -> Maybe Text
   -> Maybe Timing
   -> Job)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe [JobOutput]
      -> Maybe JobOutput
      -> Maybe Text
      -> Maybe [Playlist]
      -> Maybe Text
      -> Maybe Timing
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserMetadata" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [JobOutput]
   -> Maybe JobOutput
   -> Maybe Text
   -> Maybe [Playlist]
   -> Maybe Text
   -> Maybe Timing
   -> Job)
-> Parser (Maybe [JobOutput])
-> Parser
     (Maybe JobOutput
      -> Maybe Text
      -> Maybe [Playlist]
      -> Maybe Text
      -> Maybe Timing
      -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [JobOutput]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Outputs" Parser (Maybe (Maybe [JobOutput]))
-> Maybe [JobOutput] -> Parser (Maybe [JobOutput])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [JobOutput]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe JobOutput
   -> Maybe Text
   -> Maybe [Playlist]
   -> Maybe Text
   -> Maybe Timing
   -> Job)
-> Parser (Maybe JobOutput)
-> Parser
     (Maybe Text
      -> Maybe [Playlist] -> Maybe Text -> Maybe Timing -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobOutput)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Output")
            Parser
  (Maybe Text
   -> Maybe [Playlist] -> Maybe Text -> Maybe Timing -> Job)
-> Parser (Maybe Text)
-> Parser (Maybe [Playlist] -> Maybe Text -> Maybe Timing -> Job)
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
"Id")
            Parser (Maybe [Playlist] -> Maybe Text -> Maybe Timing -> Job)
-> Parser (Maybe [Playlist])
-> Parser (Maybe Text -> Maybe Timing -> Job)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Playlist]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Playlists" Parser (Maybe (Maybe [Playlist]))
-> Maybe [Playlist] -> Parser (Maybe [Playlist])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Playlist]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe Text -> Maybe Timing -> Job)
-> Parser (Maybe Text) -> Parser (Maybe Timing -> Job)
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
"OutputKeyPrefix")
            Parser (Maybe Timing -> Job) -> Parser (Maybe Timing) -> Parser Job
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Timing)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Timing")
      )

instance Prelude.Hashable Job

instance Prelude.NFData Job