{-# 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.Output
-- 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.Output where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.AudioDescription
import Amazonka.MediaConvert.Types.CaptionDescription
import Amazonka.MediaConvert.Types.ContainerSettings
import Amazonka.MediaConvert.Types.OutputSettings
import Amazonka.MediaConvert.Types.VideoDescription
import qualified Amazonka.Prelude as Prelude

-- | Each output in your job is a collection of settings that describes how
-- you want MediaConvert to encode a single output file or stream. For more
-- information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/create-outputs.html.
--
-- /See:/ 'newOutput' smart constructor.
data Output = Output'
  { -- | (CaptionDescriptions) contains groups of captions settings. For each
    -- output that has captions, include one instance of (CaptionDescriptions).
    -- (CaptionDescriptions) can contain multiple groups of captions settings.
    Output -> Maybe [CaptionDescription]
captionDescriptions :: Prelude.Maybe [CaptionDescription],
    -- | Use Extension (Extension) to specify the file extension for outputs in
    -- File output groups. If you do not specify a value, the service will use
    -- default extensions by container type as follows * MPEG-2 transport
    -- stream, m2ts * Quicktime, mov * MXF container, mxf * MPEG-4 container,
    -- mp4 * WebM container, webm * No Container, the service will use codec
    -- extensions (e.g. AAC, H265, H265, AC3)
    Output -> Maybe Text
extension :: Prelude.Maybe Prelude.Text,
    -- | VideoDescription contains a group of video encoding settings. The
    -- specific video settings depend on the video codec that you choose for
    -- the property codec. Include one instance of VideoDescription per output.
    Output -> Maybe VideoDescription
videoDescription :: Prelude.Maybe VideoDescription,
    -- | Container specific settings.
    Output -> Maybe ContainerSettings
containerSettings :: Prelude.Maybe ContainerSettings,
    -- | Specific settings for this type of output.
    Output -> Maybe OutputSettings
outputSettings :: Prelude.Maybe OutputSettings,
    -- | Use Preset (Preset) to specify a preset for your transcoding settings.
    -- Provide the system or custom preset name. You can specify either Preset
    -- (Preset) or Container settings (ContainerSettings), but not both.
    Output -> Maybe Text
preset :: Prelude.Maybe Prelude.Text,
    -- | Use Name modifier (NameModifier) to have the service add a string to the
    -- end of each output filename. You specify the base filename as part of
    -- your destination URI. When you create multiple outputs in the same
    -- output group, Name modifier (NameModifier) is required. Name modifier
    -- also accepts format identifiers. For DASH ISO outputs, if you use the
    -- format identifiers $Number$ or $Time$ in one output, you must use them
    -- in the same way in all outputs of the output group.
    Output -> Maybe Text
nameModifier :: Prelude.Maybe Prelude.Text,
    -- | (AudioDescriptions) contains groups of audio encoding settings organized
    -- by audio codec. Include one instance of (AudioDescriptions) per output.
    -- (AudioDescriptions) can contain multiple groups of encoding settings.
    Output -> Maybe [AudioDescription]
audioDescriptions :: Prelude.Maybe [AudioDescription]
  }
  deriving (Output -> Output -> Bool
(Output -> Output -> Bool)
-> (Output -> Output -> Bool) -> Eq Output
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Output -> Output -> Bool
$c/= :: Output -> Output -> Bool
== :: Output -> Output -> Bool
$c== :: Output -> Output -> Bool
Prelude.Eq, ReadPrec [Output]
ReadPrec Output
Int -> ReadS Output
ReadS [Output]
(Int -> ReadS Output)
-> ReadS [Output]
-> ReadPrec Output
-> ReadPrec [Output]
-> Read Output
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Output]
$creadListPrec :: ReadPrec [Output]
readPrec :: ReadPrec Output
$creadPrec :: ReadPrec Output
readList :: ReadS [Output]
$creadList :: ReadS [Output]
readsPrec :: Int -> ReadS Output
$creadsPrec :: Int -> ReadS Output
Prelude.Read, Int -> Output -> ShowS
[Output] -> ShowS
Output -> String
(Int -> Output -> ShowS)
-> (Output -> String) -> ([Output] -> ShowS) -> Show Output
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Output] -> ShowS
$cshowList :: [Output] -> ShowS
show :: Output -> String
$cshow :: Output -> String
showsPrec :: Int -> Output -> ShowS
$cshowsPrec :: Int -> Output -> ShowS
Prelude.Show, (forall x. Output -> Rep Output x)
-> (forall x. Rep Output x -> Output) -> Generic Output
forall x. Rep Output x -> Output
forall x. Output -> Rep Output x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Output x -> Output
$cfrom :: forall x. Output -> Rep Output x
Prelude.Generic)

-- |
-- Create a value of 'Output' 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:
--
-- 'captionDescriptions', 'output_captionDescriptions' - (CaptionDescriptions) contains groups of captions settings. For each
-- output that has captions, include one instance of (CaptionDescriptions).
-- (CaptionDescriptions) can contain multiple groups of captions settings.
--
-- 'extension', 'output_extension' - Use Extension (Extension) to specify the file extension for outputs in
-- File output groups. If you do not specify a value, the service will use
-- default extensions by container type as follows * MPEG-2 transport
-- stream, m2ts * Quicktime, mov * MXF container, mxf * MPEG-4 container,
-- mp4 * WebM container, webm * No Container, the service will use codec
-- extensions (e.g. AAC, H265, H265, AC3)
--
-- 'videoDescription', 'output_videoDescription' - VideoDescription contains a group of video encoding settings. The
-- specific video settings depend on the video codec that you choose for
-- the property codec. Include one instance of VideoDescription per output.
--
-- 'containerSettings', 'output_containerSettings' - Container specific settings.
--
-- 'outputSettings', 'output_outputSettings' - Specific settings for this type of output.
--
-- 'preset', 'output_preset' - Use Preset (Preset) to specify a preset for your transcoding settings.
-- Provide the system or custom preset name. You can specify either Preset
-- (Preset) or Container settings (ContainerSettings), but not both.
--
-- 'nameModifier', 'output_nameModifier' - Use Name modifier (NameModifier) to have the service add a string to the
-- end of each output filename. You specify the base filename as part of
-- your destination URI. When you create multiple outputs in the same
-- output group, Name modifier (NameModifier) is required. Name modifier
-- also accepts format identifiers. For DASH ISO outputs, if you use the
-- format identifiers $Number$ or $Time$ in one output, you must use them
-- in the same way in all outputs of the output group.
--
-- 'audioDescriptions', 'output_audioDescriptions' - (AudioDescriptions) contains groups of audio encoding settings organized
-- by audio codec. Include one instance of (AudioDescriptions) per output.
-- (AudioDescriptions) can contain multiple groups of encoding settings.
newOutput ::
  Output
newOutput :: Output
newOutput =
  Output' :: Maybe [CaptionDescription]
-> Maybe Text
-> Maybe VideoDescription
-> Maybe ContainerSettings
-> Maybe OutputSettings
-> Maybe Text
-> Maybe Text
-> Maybe [AudioDescription]
-> Output
Output'
    { $sel:captionDescriptions:Output' :: Maybe [CaptionDescription]
captionDescriptions = Maybe [CaptionDescription]
forall a. Maybe a
Prelude.Nothing,
      $sel:extension:Output' :: Maybe Text
extension = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:videoDescription:Output' :: Maybe VideoDescription
videoDescription = Maybe VideoDescription
forall a. Maybe a
Prelude.Nothing,
      $sel:containerSettings:Output' :: Maybe ContainerSettings
containerSettings = Maybe ContainerSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:outputSettings:Output' :: Maybe OutputSettings
outputSettings = Maybe OutputSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:preset:Output' :: Maybe Text
preset = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nameModifier:Output' :: Maybe Text
nameModifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:audioDescriptions:Output' :: Maybe [AudioDescription]
audioDescriptions = Maybe [AudioDescription]
forall a. Maybe a
Prelude.Nothing
    }

-- | (CaptionDescriptions) contains groups of captions settings. For each
-- output that has captions, include one instance of (CaptionDescriptions).
-- (CaptionDescriptions) can contain multiple groups of captions settings.
output_captionDescriptions :: Lens.Lens' Output (Prelude.Maybe [CaptionDescription])
output_captionDescriptions :: (Maybe [CaptionDescription] -> f (Maybe [CaptionDescription]))
-> Output -> f Output
output_captionDescriptions = (Output -> Maybe [CaptionDescription])
-> (Output -> Maybe [CaptionDescription] -> Output)
-> Lens
     Output
     Output
     (Maybe [CaptionDescription])
     (Maybe [CaptionDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe [CaptionDescription]
captionDescriptions :: Maybe [CaptionDescription]
$sel:captionDescriptions:Output' :: Output -> Maybe [CaptionDescription]
captionDescriptions} -> Maybe [CaptionDescription]
captionDescriptions) (\s :: Output
s@Output' {} Maybe [CaptionDescription]
a -> Output
s {$sel:captionDescriptions:Output' :: Maybe [CaptionDescription]
captionDescriptions = Maybe [CaptionDescription]
a} :: Output) ((Maybe [CaptionDescription] -> f (Maybe [CaptionDescription]))
 -> Output -> f Output)
-> ((Maybe [CaptionDescription] -> f (Maybe [CaptionDescription]))
    -> Maybe [CaptionDescription] -> f (Maybe [CaptionDescription]))
-> (Maybe [CaptionDescription] -> f (Maybe [CaptionDescription]))
-> Output
-> f Output
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CaptionDescription]
  [CaptionDescription]
  [CaptionDescription]
  [CaptionDescription]
-> Iso
     (Maybe [CaptionDescription])
     (Maybe [CaptionDescription])
     (Maybe [CaptionDescription])
     (Maybe [CaptionDescription])
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
  [CaptionDescription]
  [CaptionDescription]
  [CaptionDescription]
  [CaptionDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Use Extension (Extension) to specify the file extension for outputs in
-- File output groups. If you do not specify a value, the service will use
-- default extensions by container type as follows * MPEG-2 transport
-- stream, m2ts * Quicktime, mov * MXF container, mxf * MPEG-4 container,
-- mp4 * WebM container, webm * No Container, the service will use codec
-- extensions (e.g. AAC, H265, H265, AC3)
output_extension :: Lens.Lens' Output (Prelude.Maybe Prelude.Text)
output_extension :: (Maybe Text -> f (Maybe Text)) -> Output -> f Output
output_extension = (Output -> Maybe Text)
-> (Output -> Maybe Text -> Output)
-> Lens Output Output (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe Text
extension :: Maybe Text
$sel:extension:Output' :: Output -> Maybe Text
extension} -> Maybe Text
extension) (\s :: Output
s@Output' {} Maybe Text
a -> Output
s {$sel:extension:Output' :: Maybe Text
extension = Maybe Text
a} :: Output)

-- | VideoDescription contains a group of video encoding settings. The
-- specific video settings depend on the video codec that you choose for
-- the property codec. Include one instance of VideoDescription per output.
output_videoDescription :: Lens.Lens' Output (Prelude.Maybe VideoDescription)
output_videoDescription :: (Maybe VideoDescription -> f (Maybe VideoDescription))
-> Output -> f Output
output_videoDescription = (Output -> Maybe VideoDescription)
-> (Output -> Maybe VideoDescription -> Output)
-> Lens
     Output Output (Maybe VideoDescription) (Maybe VideoDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe VideoDescription
videoDescription :: Maybe VideoDescription
$sel:videoDescription:Output' :: Output -> Maybe VideoDescription
videoDescription} -> Maybe VideoDescription
videoDescription) (\s :: Output
s@Output' {} Maybe VideoDescription
a -> Output
s {$sel:videoDescription:Output' :: Maybe VideoDescription
videoDescription = Maybe VideoDescription
a} :: Output)

-- | Container specific settings.
output_containerSettings :: Lens.Lens' Output (Prelude.Maybe ContainerSettings)
output_containerSettings :: (Maybe ContainerSettings -> f (Maybe ContainerSettings))
-> Output -> f Output
output_containerSettings = (Output -> Maybe ContainerSettings)
-> (Output -> Maybe ContainerSettings -> Output)
-> Lens
     Output Output (Maybe ContainerSettings) (Maybe ContainerSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe ContainerSettings
containerSettings :: Maybe ContainerSettings
$sel:containerSettings:Output' :: Output -> Maybe ContainerSettings
containerSettings} -> Maybe ContainerSettings
containerSettings) (\s :: Output
s@Output' {} Maybe ContainerSettings
a -> Output
s {$sel:containerSettings:Output' :: Maybe ContainerSettings
containerSettings = Maybe ContainerSettings
a} :: Output)

-- | Specific settings for this type of output.
output_outputSettings :: Lens.Lens' Output (Prelude.Maybe OutputSettings)
output_outputSettings :: (Maybe OutputSettings -> f (Maybe OutputSettings))
-> Output -> f Output
output_outputSettings = (Output -> Maybe OutputSettings)
-> (Output -> Maybe OutputSettings -> Output)
-> Lens Output Output (Maybe OutputSettings) (Maybe OutputSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe OutputSettings
outputSettings :: Maybe OutputSettings
$sel:outputSettings:Output' :: Output -> Maybe OutputSettings
outputSettings} -> Maybe OutputSettings
outputSettings) (\s :: Output
s@Output' {} Maybe OutputSettings
a -> Output
s {$sel:outputSettings:Output' :: Maybe OutputSettings
outputSettings = Maybe OutputSettings
a} :: Output)

-- | Use Preset (Preset) to specify a preset for your transcoding settings.
-- Provide the system or custom preset name. You can specify either Preset
-- (Preset) or Container settings (ContainerSettings), but not both.
output_preset :: Lens.Lens' Output (Prelude.Maybe Prelude.Text)
output_preset :: (Maybe Text -> f (Maybe Text)) -> Output -> f Output
output_preset = (Output -> Maybe Text)
-> (Output -> Maybe Text -> Output)
-> Lens Output Output (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe Text
preset :: Maybe Text
$sel:preset:Output' :: Output -> Maybe Text
preset} -> Maybe Text
preset) (\s :: Output
s@Output' {} Maybe Text
a -> Output
s {$sel:preset:Output' :: Maybe Text
preset = Maybe Text
a} :: Output)

-- | Use Name modifier (NameModifier) to have the service add a string to the
-- end of each output filename. You specify the base filename as part of
-- your destination URI. When you create multiple outputs in the same
-- output group, Name modifier (NameModifier) is required. Name modifier
-- also accepts format identifiers. For DASH ISO outputs, if you use the
-- format identifiers $Number$ or $Time$ in one output, you must use them
-- in the same way in all outputs of the output group.
output_nameModifier :: Lens.Lens' Output (Prelude.Maybe Prelude.Text)
output_nameModifier :: (Maybe Text -> f (Maybe Text)) -> Output -> f Output
output_nameModifier = (Output -> Maybe Text)
-> (Output -> Maybe Text -> Output)
-> Lens Output Output (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe Text
nameModifier :: Maybe Text
$sel:nameModifier:Output' :: Output -> Maybe Text
nameModifier} -> Maybe Text
nameModifier) (\s :: Output
s@Output' {} Maybe Text
a -> Output
s {$sel:nameModifier:Output' :: Maybe Text
nameModifier = Maybe Text
a} :: Output)

-- | (AudioDescriptions) contains groups of audio encoding settings organized
-- by audio codec. Include one instance of (AudioDescriptions) per output.
-- (AudioDescriptions) can contain multiple groups of encoding settings.
output_audioDescriptions :: Lens.Lens' Output (Prelude.Maybe [AudioDescription])
output_audioDescriptions :: (Maybe [AudioDescription] -> f (Maybe [AudioDescription]))
-> Output -> f Output
output_audioDescriptions = (Output -> Maybe [AudioDescription])
-> (Output -> Maybe [AudioDescription] -> Output)
-> Lens
     Output Output (Maybe [AudioDescription]) (Maybe [AudioDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Output' {Maybe [AudioDescription]
audioDescriptions :: Maybe [AudioDescription]
$sel:audioDescriptions:Output' :: Output -> Maybe [AudioDescription]
audioDescriptions} -> Maybe [AudioDescription]
audioDescriptions) (\s :: Output
s@Output' {} Maybe [AudioDescription]
a -> Output
s {$sel:audioDescriptions:Output' :: Maybe [AudioDescription]
audioDescriptions = Maybe [AudioDescription]
a} :: Output) ((Maybe [AudioDescription] -> f (Maybe [AudioDescription]))
 -> Output -> f Output)
-> ((Maybe [AudioDescription] -> f (Maybe [AudioDescription]))
    -> Maybe [AudioDescription] -> f (Maybe [AudioDescription]))
-> (Maybe [AudioDescription] -> f (Maybe [AudioDescription]))
-> Output
-> f Output
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AudioDescription]
  [AudioDescription]
  [AudioDescription]
  [AudioDescription]
-> Iso
     (Maybe [AudioDescription])
     (Maybe [AudioDescription])
     (Maybe [AudioDescription])
     (Maybe [AudioDescription])
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
  [AudioDescription]
  [AudioDescription]
  [AudioDescription]
  [AudioDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON Output where
  parseJSON :: Value -> Parser Output
parseJSON =
    String -> (Object -> Parser Output) -> Value -> Parser Output
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Output"
      ( \Object
x ->
          Maybe [CaptionDescription]
-> Maybe Text
-> Maybe VideoDescription
-> Maybe ContainerSettings
-> Maybe OutputSettings
-> Maybe Text
-> Maybe Text
-> Maybe [AudioDescription]
-> Output
Output'
            (Maybe [CaptionDescription]
 -> Maybe Text
 -> Maybe VideoDescription
 -> Maybe ContainerSettings
 -> Maybe OutputSettings
 -> Maybe Text
 -> Maybe Text
 -> Maybe [AudioDescription]
 -> Output)
-> Parser (Maybe [CaptionDescription])
-> Parser
     (Maybe Text
      -> Maybe VideoDescription
      -> Maybe ContainerSettings
      -> Maybe OutputSettings
      -> Maybe Text
      -> Maybe Text
      -> Maybe [AudioDescription]
      -> Output)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [CaptionDescription]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"captionDescriptions"
                            Parser (Maybe (Maybe [CaptionDescription]))
-> Maybe [CaptionDescription]
-> Parser (Maybe [CaptionDescription])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CaptionDescription]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe VideoDescription
   -> Maybe ContainerSettings
   -> Maybe OutputSettings
   -> Maybe Text
   -> Maybe Text
   -> Maybe [AudioDescription]
   -> Output)
-> Parser (Maybe Text)
-> Parser
     (Maybe VideoDescription
      -> Maybe ContainerSettings
      -> Maybe OutputSettings
      -> Maybe Text
      -> Maybe Text
      -> Maybe [AudioDescription]
      -> Output)
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
"extension")
            Parser
  (Maybe VideoDescription
   -> Maybe ContainerSettings
   -> Maybe OutputSettings
   -> Maybe Text
   -> Maybe Text
   -> Maybe [AudioDescription]
   -> Output)
-> Parser (Maybe VideoDescription)
-> Parser
     (Maybe ContainerSettings
      -> Maybe OutputSettings
      -> Maybe Text
      -> Maybe Text
      -> Maybe [AudioDescription]
      -> Output)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VideoDescription)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"videoDescription")
            Parser
  (Maybe ContainerSettings
   -> Maybe OutputSettings
   -> Maybe Text
   -> Maybe Text
   -> Maybe [AudioDescription]
   -> Output)
-> Parser (Maybe ContainerSettings)
-> Parser
     (Maybe OutputSettings
      -> Maybe Text -> Maybe Text -> Maybe [AudioDescription] -> Output)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ContainerSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"containerSettings")
            Parser
  (Maybe OutputSettings
   -> Maybe Text -> Maybe Text -> Maybe [AudioDescription] -> Output)
-> Parser (Maybe OutputSettings)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe [AudioDescription] -> Output)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OutputSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"outputSettings")
            Parser
  (Maybe Text -> Maybe Text -> Maybe [AudioDescription] -> Output)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [AudioDescription] -> Output)
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
"preset")
            Parser (Maybe Text -> Maybe [AudioDescription] -> Output)
-> Parser (Maybe Text)
-> Parser (Maybe [AudioDescription] -> Output)
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
"nameModifier")
            Parser (Maybe [AudioDescription] -> Output)
-> Parser (Maybe [AudioDescription]) -> Parser Output
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [AudioDescription]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"audioDescriptions"
                            Parser (Maybe (Maybe [AudioDescription]))
-> Maybe [AudioDescription] -> Parser (Maybe [AudioDescription])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AudioDescription]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable Output

instance Prelude.NFData Output

instance Core.ToJSON Output where
  toJSON :: Output -> Value
toJSON Output' {Maybe [AudioDescription]
Maybe [CaptionDescription]
Maybe Text
Maybe OutputSettings
Maybe ContainerSettings
Maybe VideoDescription
audioDescriptions :: Maybe [AudioDescription]
nameModifier :: Maybe Text
preset :: Maybe Text
outputSettings :: Maybe OutputSettings
containerSettings :: Maybe ContainerSettings
videoDescription :: Maybe VideoDescription
extension :: Maybe Text
captionDescriptions :: Maybe [CaptionDescription]
$sel:audioDescriptions:Output' :: Output -> Maybe [AudioDescription]
$sel:nameModifier:Output' :: Output -> Maybe Text
$sel:preset:Output' :: Output -> Maybe Text
$sel:outputSettings:Output' :: Output -> Maybe OutputSettings
$sel:containerSettings:Output' :: Output -> Maybe ContainerSettings
$sel:videoDescription:Output' :: Output -> Maybe VideoDescription
$sel:extension:Output' :: Output -> Maybe Text
$sel:captionDescriptions:Output' :: Output -> Maybe [CaptionDescription]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"captionDescriptions" Text -> [CaptionDescription] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([CaptionDescription] -> Pair)
-> Maybe [CaptionDescription] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CaptionDescription]
captionDescriptions,
            (Text
"extension" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
extension,
            (Text
"videoDescription" Text -> VideoDescription -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (VideoDescription -> Pair) -> Maybe VideoDescription -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VideoDescription
videoDescription,
            (Text
"containerSettings" Text -> ContainerSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ContainerSettings -> Pair)
-> Maybe ContainerSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContainerSettings
containerSettings,
            (Text
"outputSettings" Text -> OutputSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (OutputSettings -> Pair) -> Maybe OutputSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OutputSettings
outputSettings,
            (Text
"preset" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
preset,
            (Text
"nameModifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nameModifier,
            (Text
"audioDescriptions" Text -> [AudioDescription] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AudioDescription] -> Pair)
-> Maybe [AudioDescription] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AudioDescription]
audioDescriptions
          ]
      )