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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.CmfcSettings
import Amazonka.MediaConvert.Types.ContainerType
import Amazonka.MediaConvert.Types.F4vSettings
import Amazonka.MediaConvert.Types.M2tsSettings
import Amazonka.MediaConvert.Types.M3u8Settings
import Amazonka.MediaConvert.Types.MovSettings
import Amazonka.MediaConvert.Types.Mp4Settings
import Amazonka.MediaConvert.Types.MpdSettings
import Amazonka.MediaConvert.Types.MxfSettings
import qualified Amazonka.Prelude as Prelude

-- | Container specific settings.
--
-- /See:/ 'newContainerSettings' smart constructor.
data ContainerSettings = ContainerSettings'
  { -- | MPEG-2 TS container settings. These apply to outputs in a File output
    -- group when the output\'s container (ContainerType) is MPEG-2 Transport
    -- Stream (M2TS). In these assets, data is organized by the program map
    -- table (PMT). Each transport stream program contains subsets of data,
    -- including audio, video, and metadata. Each of these subsets of data has
    -- a numerical label called a packet identifier (PID). Each transport
    -- stream program corresponds to one MediaConvert output. The PMT lists the
    -- types of data in a program along with their PID. Downstream systems and
    -- players use the program map table to look up the PID for each type of
    -- data it accesses and then uses the PIDs to locate specific data within
    -- the asset.
    ContainerSettings -> Maybe M2tsSettings
m2tsSettings :: Prelude.Maybe M2tsSettings,
    -- | These settings relate to your MXF output container.
    ContainerSettings -> Maybe MxfSettings
mxfSettings :: Prelude.Maybe MxfSettings,
    -- | These settings relate to the MPEG-2 transport stream (MPEG2-TS)
    -- container for the MPEG2-TS segments in your HLS outputs.
    ContainerSettings -> Maybe M3u8Settings
m3u8Settings :: Prelude.Maybe M3u8Settings,
    -- | These settings relate to the fragmented MP4 container for the segments
    -- in your CMAF outputs.
    ContainerSettings -> Maybe CmfcSettings
cmfcSettings :: Prelude.Maybe CmfcSettings,
    -- | These settings relate to your QuickTime MOV output container.
    ContainerSettings -> Maybe MovSettings
movSettings :: Prelude.Maybe MovSettings,
    -- | These settings relate to your MP4 output container. You can create audio
    -- only outputs with this container. For more information, see
    -- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/supported-codecs-containers-audio-only.html#output-codecs-and-containers-supported-for-audio-only.
    ContainerSettings -> Maybe Mp4Settings
mp4Settings :: Prelude.Maybe Mp4Settings,
    -- | These settings relate to the fragmented MP4 container for the segments
    -- in your DASH outputs.
    ContainerSettings -> Maybe MpdSettings
mpdSettings :: Prelude.Maybe MpdSettings,
    -- | Container for this output. Some containers require a container settings
    -- object. If not specified, the default object will be created.
    ContainerSettings -> Maybe ContainerType
container :: Prelude.Maybe ContainerType,
    -- | Settings for F4v container
    ContainerSettings -> Maybe F4vSettings
f4vSettings :: Prelude.Maybe F4vSettings
  }
  deriving (ContainerSettings -> ContainerSettings -> Bool
(ContainerSettings -> ContainerSettings -> Bool)
-> (ContainerSettings -> ContainerSettings -> Bool)
-> Eq ContainerSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerSettings -> ContainerSettings -> Bool
$c/= :: ContainerSettings -> ContainerSettings -> Bool
== :: ContainerSettings -> ContainerSettings -> Bool
$c== :: ContainerSettings -> ContainerSettings -> Bool
Prelude.Eq, ReadPrec [ContainerSettings]
ReadPrec ContainerSettings
Int -> ReadS ContainerSettings
ReadS [ContainerSettings]
(Int -> ReadS ContainerSettings)
-> ReadS [ContainerSettings]
-> ReadPrec ContainerSettings
-> ReadPrec [ContainerSettings]
-> Read ContainerSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerSettings]
$creadListPrec :: ReadPrec [ContainerSettings]
readPrec :: ReadPrec ContainerSettings
$creadPrec :: ReadPrec ContainerSettings
readList :: ReadS [ContainerSettings]
$creadList :: ReadS [ContainerSettings]
readsPrec :: Int -> ReadS ContainerSettings
$creadsPrec :: Int -> ReadS ContainerSettings
Prelude.Read, Int -> ContainerSettings -> ShowS
[ContainerSettings] -> ShowS
ContainerSettings -> String
(Int -> ContainerSettings -> ShowS)
-> (ContainerSettings -> String)
-> ([ContainerSettings] -> ShowS)
-> Show ContainerSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerSettings] -> ShowS
$cshowList :: [ContainerSettings] -> ShowS
show :: ContainerSettings -> String
$cshow :: ContainerSettings -> String
showsPrec :: Int -> ContainerSettings -> ShowS
$cshowsPrec :: Int -> ContainerSettings -> ShowS
Prelude.Show, (forall x. ContainerSettings -> Rep ContainerSettings x)
-> (forall x. Rep ContainerSettings x -> ContainerSettings)
-> Generic ContainerSettings
forall x. Rep ContainerSettings x -> ContainerSettings
forall x. ContainerSettings -> Rep ContainerSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerSettings x -> ContainerSettings
$cfrom :: forall x. ContainerSettings -> Rep ContainerSettings x
Prelude.Generic)

-- |
-- Create a value of 'ContainerSettings' 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:
--
-- 'm2tsSettings', 'containerSettings_m2tsSettings' - MPEG-2 TS container settings. These apply to outputs in a File output
-- group when the output\'s container (ContainerType) is MPEG-2 Transport
-- Stream (M2TS). In these assets, data is organized by the program map
-- table (PMT). Each transport stream program contains subsets of data,
-- including audio, video, and metadata. Each of these subsets of data has
-- a numerical label called a packet identifier (PID). Each transport
-- stream program corresponds to one MediaConvert output. The PMT lists the
-- types of data in a program along with their PID. Downstream systems and
-- players use the program map table to look up the PID for each type of
-- data it accesses and then uses the PIDs to locate specific data within
-- the asset.
--
-- 'mxfSettings', 'containerSettings_mxfSettings' - These settings relate to your MXF output container.
--
-- 'm3u8Settings', 'containerSettings_m3u8Settings' - These settings relate to the MPEG-2 transport stream (MPEG2-TS)
-- container for the MPEG2-TS segments in your HLS outputs.
--
-- 'cmfcSettings', 'containerSettings_cmfcSettings' - These settings relate to the fragmented MP4 container for the segments
-- in your CMAF outputs.
--
-- 'movSettings', 'containerSettings_movSettings' - These settings relate to your QuickTime MOV output container.
--
-- 'mp4Settings', 'containerSettings_mp4Settings' - These settings relate to your MP4 output container. You can create audio
-- only outputs with this container. For more information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/supported-codecs-containers-audio-only.html#output-codecs-and-containers-supported-for-audio-only.
--
-- 'mpdSettings', 'containerSettings_mpdSettings' - These settings relate to the fragmented MP4 container for the segments
-- in your DASH outputs.
--
-- 'container', 'containerSettings_container' - Container for this output. Some containers require a container settings
-- object. If not specified, the default object will be created.
--
-- 'f4vSettings', 'containerSettings_f4vSettings' - Settings for F4v container
newContainerSettings ::
  ContainerSettings
newContainerSettings :: ContainerSettings
newContainerSettings =
  ContainerSettings' :: Maybe M2tsSettings
-> Maybe MxfSettings
-> Maybe M3u8Settings
-> Maybe CmfcSettings
-> Maybe MovSettings
-> Maybe Mp4Settings
-> Maybe MpdSettings
-> Maybe ContainerType
-> Maybe F4vSettings
-> ContainerSettings
ContainerSettings'
    { $sel:m2tsSettings:ContainerSettings' :: Maybe M2tsSettings
m2tsSettings = Maybe M2tsSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:mxfSettings:ContainerSettings' :: Maybe MxfSettings
mxfSettings = Maybe MxfSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:m3u8Settings:ContainerSettings' :: Maybe M3u8Settings
m3u8Settings = Maybe M3u8Settings
forall a. Maybe a
Prelude.Nothing,
      $sel:cmfcSettings:ContainerSettings' :: Maybe CmfcSettings
cmfcSettings = Maybe CmfcSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:movSettings:ContainerSettings' :: Maybe MovSettings
movSettings = Maybe MovSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:mp4Settings:ContainerSettings' :: Maybe Mp4Settings
mp4Settings = Maybe Mp4Settings
forall a. Maybe a
Prelude.Nothing,
      $sel:mpdSettings:ContainerSettings' :: Maybe MpdSettings
mpdSettings = Maybe MpdSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:container:ContainerSettings' :: Maybe ContainerType
container = Maybe ContainerType
forall a. Maybe a
Prelude.Nothing,
      $sel:f4vSettings:ContainerSettings' :: Maybe F4vSettings
f4vSettings = Maybe F4vSettings
forall a. Maybe a
Prelude.Nothing
    }

-- | MPEG-2 TS container settings. These apply to outputs in a File output
-- group when the output\'s container (ContainerType) is MPEG-2 Transport
-- Stream (M2TS). In these assets, data is organized by the program map
-- table (PMT). Each transport stream program contains subsets of data,
-- including audio, video, and metadata. Each of these subsets of data has
-- a numerical label called a packet identifier (PID). Each transport
-- stream program corresponds to one MediaConvert output. The PMT lists the
-- types of data in a program along with their PID. Downstream systems and
-- players use the program map table to look up the PID for each type of
-- data it accesses and then uses the PIDs to locate specific data within
-- the asset.
containerSettings_m2tsSettings :: Lens.Lens' ContainerSettings (Prelude.Maybe M2tsSettings)
containerSettings_m2tsSettings :: (Maybe M2tsSettings -> f (Maybe M2tsSettings))
-> ContainerSettings -> f ContainerSettings
containerSettings_m2tsSettings = (ContainerSettings -> Maybe M2tsSettings)
-> (ContainerSettings -> Maybe M2tsSettings -> ContainerSettings)
-> Lens
     ContainerSettings
     ContainerSettings
     (Maybe M2tsSettings)
     (Maybe M2tsSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerSettings' {Maybe M2tsSettings
m2tsSettings :: Maybe M2tsSettings
$sel:m2tsSettings:ContainerSettings' :: ContainerSettings -> Maybe M2tsSettings
m2tsSettings} -> Maybe M2tsSettings
m2tsSettings) (\s :: ContainerSettings
s@ContainerSettings' {} Maybe M2tsSettings
a -> ContainerSettings
s {$sel:m2tsSettings:ContainerSettings' :: Maybe M2tsSettings
m2tsSettings = Maybe M2tsSettings
a} :: ContainerSettings)

-- | These settings relate to your MXF output container.
containerSettings_mxfSettings :: Lens.Lens' ContainerSettings (Prelude.Maybe MxfSettings)
containerSettings_mxfSettings :: (Maybe MxfSettings -> f (Maybe MxfSettings))
-> ContainerSettings -> f ContainerSettings
containerSettings_mxfSettings = (ContainerSettings -> Maybe MxfSettings)
-> (ContainerSettings -> Maybe MxfSettings -> ContainerSettings)
-> Lens
     ContainerSettings
     ContainerSettings
     (Maybe MxfSettings)
     (Maybe MxfSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerSettings' {Maybe MxfSettings
mxfSettings :: Maybe MxfSettings
$sel:mxfSettings:ContainerSettings' :: ContainerSettings -> Maybe MxfSettings
mxfSettings} -> Maybe MxfSettings
mxfSettings) (\s :: ContainerSettings
s@ContainerSettings' {} Maybe MxfSettings
a -> ContainerSettings
s {$sel:mxfSettings:ContainerSettings' :: Maybe MxfSettings
mxfSettings = Maybe MxfSettings
a} :: ContainerSettings)

-- | These settings relate to the MPEG-2 transport stream (MPEG2-TS)
-- container for the MPEG2-TS segments in your HLS outputs.
containerSettings_m3u8Settings :: Lens.Lens' ContainerSettings (Prelude.Maybe M3u8Settings)
containerSettings_m3u8Settings :: (Maybe M3u8Settings -> f (Maybe M3u8Settings))
-> ContainerSettings -> f ContainerSettings
containerSettings_m3u8Settings = (ContainerSettings -> Maybe M3u8Settings)
-> (ContainerSettings -> Maybe M3u8Settings -> ContainerSettings)
-> Lens
     ContainerSettings
     ContainerSettings
     (Maybe M3u8Settings)
     (Maybe M3u8Settings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerSettings' {Maybe M3u8Settings
m3u8Settings :: Maybe M3u8Settings
$sel:m3u8Settings:ContainerSettings' :: ContainerSettings -> Maybe M3u8Settings
m3u8Settings} -> Maybe M3u8Settings
m3u8Settings) (\s :: ContainerSettings
s@ContainerSettings' {} Maybe M3u8Settings
a -> ContainerSettings
s {$sel:m3u8Settings:ContainerSettings' :: Maybe M3u8Settings
m3u8Settings = Maybe M3u8Settings
a} :: ContainerSettings)

-- | These settings relate to the fragmented MP4 container for the segments
-- in your CMAF outputs.
containerSettings_cmfcSettings :: Lens.Lens' ContainerSettings (Prelude.Maybe CmfcSettings)
containerSettings_cmfcSettings :: (Maybe CmfcSettings -> f (Maybe CmfcSettings))
-> ContainerSettings -> f ContainerSettings
containerSettings_cmfcSettings = (ContainerSettings -> Maybe CmfcSettings)
-> (ContainerSettings -> Maybe CmfcSettings -> ContainerSettings)
-> Lens
     ContainerSettings
     ContainerSettings
     (Maybe CmfcSettings)
     (Maybe CmfcSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerSettings' {Maybe CmfcSettings
cmfcSettings :: Maybe CmfcSettings
$sel:cmfcSettings:ContainerSettings' :: ContainerSettings -> Maybe CmfcSettings
cmfcSettings} -> Maybe CmfcSettings
cmfcSettings) (\s :: ContainerSettings
s@ContainerSettings' {} Maybe CmfcSettings
a -> ContainerSettings
s {$sel:cmfcSettings:ContainerSettings' :: Maybe CmfcSettings
cmfcSettings = Maybe CmfcSettings
a} :: ContainerSettings)

-- | These settings relate to your QuickTime MOV output container.
containerSettings_movSettings :: Lens.Lens' ContainerSettings (Prelude.Maybe MovSettings)
containerSettings_movSettings :: (Maybe MovSettings -> f (Maybe MovSettings))
-> ContainerSettings -> f ContainerSettings
containerSettings_movSettings = (ContainerSettings -> Maybe MovSettings)
-> (ContainerSettings -> Maybe MovSettings -> ContainerSettings)
-> Lens
     ContainerSettings
     ContainerSettings
     (Maybe MovSettings)
     (Maybe MovSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerSettings' {Maybe MovSettings
movSettings :: Maybe MovSettings
$sel:movSettings:ContainerSettings' :: ContainerSettings -> Maybe MovSettings
movSettings} -> Maybe MovSettings
movSettings) (\s :: ContainerSettings
s@ContainerSettings' {} Maybe MovSettings
a -> ContainerSettings
s {$sel:movSettings:ContainerSettings' :: Maybe MovSettings
movSettings = Maybe MovSettings
a} :: ContainerSettings)

-- | These settings relate to your MP4 output container. You can create audio
-- only outputs with this container. For more information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/supported-codecs-containers-audio-only.html#output-codecs-and-containers-supported-for-audio-only.
containerSettings_mp4Settings :: Lens.Lens' ContainerSettings (Prelude.Maybe Mp4Settings)
containerSettings_mp4Settings :: (Maybe Mp4Settings -> f (Maybe Mp4Settings))
-> ContainerSettings -> f ContainerSettings
containerSettings_mp4Settings = (ContainerSettings -> Maybe Mp4Settings)
-> (ContainerSettings -> Maybe Mp4Settings -> ContainerSettings)
-> Lens
     ContainerSettings
     ContainerSettings
     (Maybe Mp4Settings)
     (Maybe Mp4Settings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerSettings' {Maybe Mp4Settings
mp4Settings :: Maybe Mp4Settings
$sel:mp4Settings:ContainerSettings' :: ContainerSettings -> Maybe Mp4Settings
mp4Settings} -> Maybe Mp4Settings
mp4Settings) (\s :: ContainerSettings
s@ContainerSettings' {} Maybe Mp4Settings
a -> ContainerSettings
s {$sel:mp4Settings:ContainerSettings' :: Maybe Mp4Settings
mp4Settings = Maybe Mp4Settings
a} :: ContainerSettings)

-- | These settings relate to the fragmented MP4 container for the segments
-- in your DASH outputs.
containerSettings_mpdSettings :: Lens.Lens' ContainerSettings (Prelude.Maybe MpdSettings)
containerSettings_mpdSettings :: (Maybe MpdSettings -> f (Maybe MpdSettings))
-> ContainerSettings -> f ContainerSettings
containerSettings_mpdSettings = (ContainerSettings -> Maybe MpdSettings)
-> (ContainerSettings -> Maybe MpdSettings -> ContainerSettings)
-> Lens
     ContainerSettings
     ContainerSettings
     (Maybe MpdSettings)
     (Maybe MpdSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerSettings' {Maybe MpdSettings
mpdSettings :: Maybe MpdSettings
$sel:mpdSettings:ContainerSettings' :: ContainerSettings -> Maybe MpdSettings
mpdSettings} -> Maybe MpdSettings
mpdSettings) (\s :: ContainerSettings
s@ContainerSettings' {} Maybe MpdSettings
a -> ContainerSettings
s {$sel:mpdSettings:ContainerSettings' :: Maybe MpdSettings
mpdSettings = Maybe MpdSettings
a} :: ContainerSettings)

-- | Container for this output. Some containers require a container settings
-- object. If not specified, the default object will be created.
containerSettings_container :: Lens.Lens' ContainerSettings (Prelude.Maybe ContainerType)
containerSettings_container :: (Maybe ContainerType -> f (Maybe ContainerType))
-> ContainerSettings -> f ContainerSettings
containerSettings_container = (ContainerSettings -> Maybe ContainerType)
-> (ContainerSettings -> Maybe ContainerType -> ContainerSettings)
-> Lens
     ContainerSettings
     ContainerSettings
     (Maybe ContainerType)
     (Maybe ContainerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerSettings' {Maybe ContainerType
container :: Maybe ContainerType
$sel:container:ContainerSettings' :: ContainerSettings -> Maybe ContainerType
container} -> Maybe ContainerType
container) (\s :: ContainerSettings
s@ContainerSettings' {} Maybe ContainerType
a -> ContainerSettings
s {$sel:container:ContainerSettings' :: Maybe ContainerType
container = Maybe ContainerType
a} :: ContainerSettings)

-- | Settings for F4v container
containerSettings_f4vSettings :: Lens.Lens' ContainerSettings (Prelude.Maybe F4vSettings)
containerSettings_f4vSettings :: (Maybe F4vSettings -> f (Maybe F4vSettings))
-> ContainerSettings -> f ContainerSettings
containerSettings_f4vSettings = (ContainerSettings -> Maybe F4vSettings)
-> (ContainerSettings -> Maybe F4vSettings -> ContainerSettings)
-> Lens
     ContainerSettings
     ContainerSettings
     (Maybe F4vSettings)
     (Maybe F4vSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerSettings' {Maybe F4vSettings
f4vSettings :: Maybe F4vSettings
$sel:f4vSettings:ContainerSettings' :: ContainerSettings -> Maybe F4vSettings
f4vSettings} -> Maybe F4vSettings
f4vSettings) (\s :: ContainerSettings
s@ContainerSettings' {} Maybe F4vSettings
a -> ContainerSettings
s {$sel:f4vSettings:ContainerSettings' :: Maybe F4vSettings
f4vSettings = Maybe F4vSettings
a} :: ContainerSettings)

instance Core.FromJSON ContainerSettings where
  parseJSON :: Value -> Parser ContainerSettings
parseJSON =
    String
-> (Object -> Parser ContainerSettings)
-> Value
-> Parser ContainerSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ContainerSettings"
      ( \Object
x ->
          Maybe M2tsSettings
-> Maybe MxfSettings
-> Maybe M3u8Settings
-> Maybe CmfcSettings
-> Maybe MovSettings
-> Maybe Mp4Settings
-> Maybe MpdSettings
-> Maybe ContainerType
-> Maybe F4vSettings
-> ContainerSettings
ContainerSettings'
            (Maybe M2tsSettings
 -> Maybe MxfSettings
 -> Maybe M3u8Settings
 -> Maybe CmfcSettings
 -> Maybe MovSettings
 -> Maybe Mp4Settings
 -> Maybe MpdSettings
 -> Maybe ContainerType
 -> Maybe F4vSettings
 -> ContainerSettings)
-> Parser (Maybe M2tsSettings)
-> Parser
     (Maybe MxfSettings
      -> Maybe M3u8Settings
      -> Maybe CmfcSettings
      -> Maybe MovSettings
      -> Maybe Mp4Settings
      -> Maybe MpdSettings
      -> Maybe ContainerType
      -> Maybe F4vSettings
      -> ContainerSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe M2tsSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"m2tsSettings")
            Parser
  (Maybe MxfSettings
   -> Maybe M3u8Settings
   -> Maybe CmfcSettings
   -> Maybe MovSettings
   -> Maybe Mp4Settings
   -> Maybe MpdSettings
   -> Maybe ContainerType
   -> Maybe F4vSettings
   -> ContainerSettings)
-> Parser (Maybe MxfSettings)
-> Parser
     (Maybe M3u8Settings
      -> Maybe CmfcSettings
      -> Maybe MovSettings
      -> Maybe Mp4Settings
      -> Maybe MpdSettings
      -> Maybe ContainerType
      -> Maybe F4vSettings
      -> ContainerSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MxfSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mxfSettings")
            Parser
  (Maybe M3u8Settings
   -> Maybe CmfcSettings
   -> Maybe MovSettings
   -> Maybe Mp4Settings
   -> Maybe MpdSettings
   -> Maybe ContainerType
   -> Maybe F4vSettings
   -> ContainerSettings)
-> Parser (Maybe M3u8Settings)
-> Parser
     (Maybe CmfcSettings
      -> Maybe MovSettings
      -> Maybe Mp4Settings
      -> Maybe MpdSettings
      -> Maybe ContainerType
      -> Maybe F4vSettings
      -> ContainerSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe M3u8Settings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"m3u8Settings")
            Parser
  (Maybe CmfcSettings
   -> Maybe MovSettings
   -> Maybe Mp4Settings
   -> Maybe MpdSettings
   -> Maybe ContainerType
   -> Maybe F4vSettings
   -> ContainerSettings)
-> Parser (Maybe CmfcSettings)
-> Parser
     (Maybe MovSettings
      -> Maybe Mp4Settings
      -> Maybe MpdSettings
      -> Maybe ContainerType
      -> Maybe F4vSettings
      -> ContainerSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CmfcSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cmfcSettings")
            Parser
  (Maybe MovSettings
   -> Maybe Mp4Settings
   -> Maybe MpdSettings
   -> Maybe ContainerType
   -> Maybe F4vSettings
   -> ContainerSettings)
-> Parser (Maybe MovSettings)
-> Parser
     (Maybe Mp4Settings
      -> Maybe MpdSettings
      -> Maybe ContainerType
      -> Maybe F4vSettings
      -> ContainerSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MovSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"movSettings")
            Parser
  (Maybe Mp4Settings
   -> Maybe MpdSettings
   -> Maybe ContainerType
   -> Maybe F4vSettings
   -> ContainerSettings)
-> Parser (Maybe Mp4Settings)
-> Parser
     (Maybe MpdSettings
      -> Maybe ContainerType -> Maybe F4vSettings -> ContainerSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Mp4Settings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mp4Settings")
            Parser
  (Maybe MpdSettings
   -> Maybe ContainerType -> Maybe F4vSettings -> ContainerSettings)
-> Parser (Maybe MpdSettings)
-> Parser
     (Maybe ContainerType -> Maybe F4vSettings -> ContainerSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MpdSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mpdSettings")
            Parser
  (Maybe ContainerType -> Maybe F4vSettings -> ContainerSettings)
-> Parser (Maybe ContainerType)
-> Parser (Maybe F4vSettings -> ContainerSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ContainerType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"container")
            Parser (Maybe F4vSettings -> ContainerSettings)
-> Parser (Maybe F4vSettings) -> Parser ContainerSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe F4vSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"f4vSettings")
      )

instance Prelude.Hashable ContainerSettings

instance Prelude.NFData ContainerSettings

instance Core.ToJSON ContainerSettings where
  toJSON :: ContainerSettings -> Value
toJSON ContainerSettings' {Maybe CmfcSettings
Maybe ContainerType
Maybe F4vSettings
Maybe MovSettings
Maybe Mp4Settings
Maybe MpdSettings
Maybe MxfSettings
Maybe M2tsSettings
Maybe M3u8Settings
f4vSettings :: Maybe F4vSettings
container :: Maybe ContainerType
mpdSettings :: Maybe MpdSettings
mp4Settings :: Maybe Mp4Settings
movSettings :: Maybe MovSettings
cmfcSettings :: Maybe CmfcSettings
m3u8Settings :: Maybe M3u8Settings
mxfSettings :: Maybe MxfSettings
m2tsSettings :: Maybe M2tsSettings
$sel:f4vSettings:ContainerSettings' :: ContainerSettings -> Maybe F4vSettings
$sel:container:ContainerSettings' :: ContainerSettings -> Maybe ContainerType
$sel:mpdSettings:ContainerSettings' :: ContainerSettings -> Maybe MpdSettings
$sel:mp4Settings:ContainerSettings' :: ContainerSettings -> Maybe Mp4Settings
$sel:movSettings:ContainerSettings' :: ContainerSettings -> Maybe MovSettings
$sel:cmfcSettings:ContainerSettings' :: ContainerSettings -> Maybe CmfcSettings
$sel:m3u8Settings:ContainerSettings' :: ContainerSettings -> Maybe M3u8Settings
$sel:mxfSettings:ContainerSettings' :: ContainerSettings -> Maybe MxfSettings
$sel:m2tsSettings:ContainerSettings' :: ContainerSettings -> Maybe M2tsSettings
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"m2tsSettings" Text -> M2tsSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (M2tsSettings -> Pair) -> Maybe M2tsSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe M2tsSettings
m2tsSettings,
            (Text
"mxfSettings" Text -> MxfSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MxfSettings -> Pair) -> Maybe MxfSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MxfSettings
mxfSettings,
            (Text
"m3u8Settings" Text -> M3u8Settings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (M3u8Settings -> Pair) -> Maybe M3u8Settings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe M3u8Settings
m3u8Settings,
            (Text
"cmfcSettings" Text -> CmfcSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CmfcSettings -> Pair) -> Maybe CmfcSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CmfcSettings
cmfcSettings,
            (Text
"movSettings" Text -> MovSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MovSettings -> Pair) -> Maybe MovSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MovSettings
movSettings,
            (Text
"mp4Settings" Text -> Mp4Settings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Mp4Settings -> Pair) -> Maybe Mp4Settings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Mp4Settings
mp4Settings,
            (Text
"mpdSettings" Text -> MpdSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MpdSettings -> Pair) -> Maybe MpdSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MpdSettings
mpdSettings,
            (Text
"container" Text -> ContainerType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ContainerType -> Pair) -> Maybe ContainerType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ContainerType
container,
            (Text
"f4vSettings" Text -> F4vSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (F4vSettings -> Pair) -> Maybe F4vSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe F4vSettings
f4vSettings
          ]
      )