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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.AncillarySourceSettings
import Amazonka.MediaConvert.Types.CaptionSourceType
import Amazonka.MediaConvert.Types.DvbSubSourceSettings
import Amazonka.MediaConvert.Types.EmbeddedSourceSettings
import Amazonka.MediaConvert.Types.FileSourceSettings
import Amazonka.MediaConvert.Types.TeletextSourceSettings
import Amazonka.MediaConvert.Types.TrackSourceSettings
import Amazonka.MediaConvert.Types.WebvttHlsSourceSettings
import qualified Amazonka.Prelude as Prelude

-- | If your input captions are SCC, TTML, STL, SMI, SRT, or IMSC in an xml
-- file, specify the URI of the input captions source file. If your input
-- captions are IMSC in an IMF package, use TrackSourceSettings instead of
-- FileSoureSettings.
--
-- /See:/ 'newCaptionSourceSettings' smart constructor.
data CaptionSourceSettings = CaptionSourceSettings'
  { -- | Settings specific to Teletext caption sources, including Page number.
    CaptionSourceSettings -> Maybe TeletextSourceSettings
teletextSourceSettings :: Prelude.Maybe TeletextSourceSettings,
    -- | Use Source (SourceType) to identify the format of your input captions.
    -- The service cannot auto-detect caption format.
    CaptionSourceSettings -> Maybe CaptionSourceType
sourceType :: Prelude.Maybe CaptionSourceType,
    -- | If your input captions are SCC, SMI, SRT, STL, TTML, WebVTT, or IMSC 1.1
    -- in an xml file, specify the URI of the input caption source file. If
    -- your caption source is IMSC in an IMF package, use TrackSourceSettings
    -- instead of FileSoureSettings.
    CaptionSourceSettings -> Maybe FileSourceSettings
fileSourceSettings :: Prelude.Maybe FileSourceSettings,
    -- | Settings specific to WebVTT sources in HLS alternative rendition group.
    -- Specify the properties (renditionGroupId, renditionName or
    -- renditionLanguageCode) to identify the unique subtitle track among the
    -- alternative rendition groups present in the HLS manifest. If no unique
    -- track is found, or multiple tracks match the specified properties, the
    -- job fails. If there is only one subtitle track in the rendition group,
    -- the settings can be left empty and the default subtitle track will be
    -- chosen. If your caption source is a sidecar file, use FileSourceSettings
    -- instead of WebvttHlsSourceSettings.
    CaptionSourceSettings -> Maybe WebvttHlsSourceSettings
webvttHlsSourceSettings :: Prelude.Maybe WebvttHlsSourceSettings,
    -- | DVB Sub Source Settings
    CaptionSourceSettings -> Maybe DvbSubSourceSettings
dvbSubSourceSettings :: Prelude.Maybe DvbSubSourceSettings,
    -- | Settings specific to caption sources that are specified by track number.
    -- Currently, this is only IMSC captions in an IMF package. If your caption
    -- source is IMSC 1.1 in a separate xml file, use FileSourceSettings
    -- instead of TrackSourceSettings.
    CaptionSourceSettings -> Maybe TrackSourceSettings
trackSourceSettings :: Prelude.Maybe TrackSourceSettings,
    -- | Settings for ancillary captions source.
    CaptionSourceSettings -> Maybe AncillarySourceSettings
ancillarySourceSettings :: Prelude.Maybe AncillarySourceSettings,
    -- | Settings for embedded captions Source
    CaptionSourceSettings -> Maybe EmbeddedSourceSettings
embeddedSourceSettings :: Prelude.Maybe EmbeddedSourceSettings
  }
  deriving (CaptionSourceSettings -> CaptionSourceSettings -> Bool
(CaptionSourceSettings -> CaptionSourceSettings -> Bool)
-> (CaptionSourceSettings -> CaptionSourceSettings -> Bool)
-> Eq CaptionSourceSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaptionSourceSettings -> CaptionSourceSettings -> Bool
$c/= :: CaptionSourceSettings -> CaptionSourceSettings -> Bool
== :: CaptionSourceSettings -> CaptionSourceSettings -> Bool
$c== :: CaptionSourceSettings -> CaptionSourceSettings -> Bool
Prelude.Eq, ReadPrec [CaptionSourceSettings]
ReadPrec CaptionSourceSettings
Int -> ReadS CaptionSourceSettings
ReadS [CaptionSourceSettings]
(Int -> ReadS CaptionSourceSettings)
-> ReadS [CaptionSourceSettings]
-> ReadPrec CaptionSourceSettings
-> ReadPrec [CaptionSourceSettings]
-> Read CaptionSourceSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaptionSourceSettings]
$creadListPrec :: ReadPrec [CaptionSourceSettings]
readPrec :: ReadPrec CaptionSourceSettings
$creadPrec :: ReadPrec CaptionSourceSettings
readList :: ReadS [CaptionSourceSettings]
$creadList :: ReadS [CaptionSourceSettings]
readsPrec :: Int -> ReadS CaptionSourceSettings
$creadsPrec :: Int -> ReadS CaptionSourceSettings
Prelude.Read, Int -> CaptionSourceSettings -> ShowS
[CaptionSourceSettings] -> ShowS
CaptionSourceSettings -> String
(Int -> CaptionSourceSettings -> ShowS)
-> (CaptionSourceSettings -> String)
-> ([CaptionSourceSettings] -> ShowS)
-> Show CaptionSourceSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaptionSourceSettings] -> ShowS
$cshowList :: [CaptionSourceSettings] -> ShowS
show :: CaptionSourceSettings -> String
$cshow :: CaptionSourceSettings -> String
showsPrec :: Int -> CaptionSourceSettings -> ShowS
$cshowsPrec :: Int -> CaptionSourceSettings -> ShowS
Prelude.Show, (forall x. CaptionSourceSettings -> Rep CaptionSourceSettings x)
-> (forall x. Rep CaptionSourceSettings x -> CaptionSourceSettings)
-> Generic CaptionSourceSettings
forall x. Rep CaptionSourceSettings x -> CaptionSourceSettings
forall x. CaptionSourceSettings -> Rep CaptionSourceSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CaptionSourceSettings x -> CaptionSourceSettings
$cfrom :: forall x. CaptionSourceSettings -> Rep CaptionSourceSettings x
Prelude.Generic)

-- |
-- Create a value of 'CaptionSourceSettings' 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:
--
-- 'teletextSourceSettings', 'captionSourceSettings_teletextSourceSettings' - Settings specific to Teletext caption sources, including Page number.
--
-- 'sourceType', 'captionSourceSettings_sourceType' - Use Source (SourceType) to identify the format of your input captions.
-- The service cannot auto-detect caption format.
--
-- 'fileSourceSettings', 'captionSourceSettings_fileSourceSettings' - If your input captions are SCC, SMI, SRT, STL, TTML, WebVTT, or IMSC 1.1
-- in an xml file, specify the URI of the input caption source file. If
-- your caption source is IMSC in an IMF package, use TrackSourceSettings
-- instead of FileSoureSettings.
--
-- 'webvttHlsSourceSettings', 'captionSourceSettings_webvttHlsSourceSettings' - Settings specific to WebVTT sources in HLS alternative rendition group.
-- Specify the properties (renditionGroupId, renditionName or
-- renditionLanguageCode) to identify the unique subtitle track among the
-- alternative rendition groups present in the HLS manifest. If no unique
-- track is found, or multiple tracks match the specified properties, the
-- job fails. If there is only one subtitle track in the rendition group,
-- the settings can be left empty and the default subtitle track will be
-- chosen. If your caption source is a sidecar file, use FileSourceSettings
-- instead of WebvttHlsSourceSettings.
--
-- 'dvbSubSourceSettings', 'captionSourceSettings_dvbSubSourceSettings' - DVB Sub Source Settings
--
-- 'trackSourceSettings', 'captionSourceSettings_trackSourceSettings' - Settings specific to caption sources that are specified by track number.
-- Currently, this is only IMSC captions in an IMF package. If your caption
-- source is IMSC 1.1 in a separate xml file, use FileSourceSettings
-- instead of TrackSourceSettings.
--
-- 'ancillarySourceSettings', 'captionSourceSettings_ancillarySourceSettings' - Settings for ancillary captions source.
--
-- 'embeddedSourceSettings', 'captionSourceSettings_embeddedSourceSettings' - Settings for embedded captions Source
newCaptionSourceSettings ::
  CaptionSourceSettings
newCaptionSourceSettings :: CaptionSourceSettings
newCaptionSourceSettings =
  CaptionSourceSettings' :: Maybe TeletextSourceSettings
-> Maybe CaptionSourceType
-> Maybe FileSourceSettings
-> Maybe WebvttHlsSourceSettings
-> Maybe DvbSubSourceSettings
-> Maybe TrackSourceSettings
-> Maybe AncillarySourceSettings
-> Maybe EmbeddedSourceSettings
-> CaptionSourceSettings
CaptionSourceSettings'
    { $sel:teletextSourceSettings:CaptionSourceSettings' :: Maybe TeletextSourceSettings
teletextSourceSettings =
        Maybe TeletextSourceSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceType:CaptionSourceSettings' :: Maybe CaptionSourceType
sourceType = Maybe CaptionSourceType
forall a. Maybe a
Prelude.Nothing,
      $sel:fileSourceSettings:CaptionSourceSettings' :: Maybe FileSourceSettings
fileSourceSettings = Maybe FileSourceSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:webvttHlsSourceSettings:CaptionSourceSettings' :: Maybe WebvttHlsSourceSettings
webvttHlsSourceSettings = Maybe WebvttHlsSourceSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:dvbSubSourceSettings:CaptionSourceSettings' :: Maybe DvbSubSourceSettings
dvbSubSourceSettings = Maybe DvbSubSourceSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:trackSourceSettings:CaptionSourceSettings' :: Maybe TrackSourceSettings
trackSourceSettings = Maybe TrackSourceSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:ancillarySourceSettings:CaptionSourceSettings' :: Maybe AncillarySourceSettings
ancillarySourceSettings = Maybe AncillarySourceSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:embeddedSourceSettings:CaptionSourceSettings' :: Maybe EmbeddedSourceSettings
embeddedSourceSettings = Maybe EmbeddedSourceSettings
forall a. Maybe a
Prelude.Nothing
    }

-- | Settings specific to Teletext caption sources, including Page number.
captionSourceSettings_teletextSourceSettings :: Lens.Lens' CaptionSourceSettings (Prelude.Maybe TeletextSourceSettings)
captionSourceSettings_teletextSourceSettings :: (Maybe TeletextSourceSettings -> f (Maybe TeletextSourceSettings))
-> CaptionSourceSettings -> f CaptionSourceSettings
captionSourceSettings_teletextSourceSettings = (CaptionSourceSettings -> Maybe TeletextSourceSettings)
-> (CaptionSourceSettings
    -> Maybe TeletextSourceSettings -> CaptionSourceSettings)
-> Lens
     CaptionSourceSettings
     CaptionSourceSettings
     (Maybe TeletextSourceSettings)
     (Maybe TeletextSourceSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSourceSettings' {Maybe TeletextSourceSettings
teletextSourceSettings :: Maybe TeletextSourceSettings
$sel:teletextSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe TeletextSourceSettings
teletextSourceSettings} -> Maybe TeletextSourceSettings
teletextSourceSettings) (\s :: CaptionSourceSettings
s@CaptionSourceSettings' {} Maybe TeletextSourceSettings
a -> CaptionSourceSettings
s {$sel:teletextSourceSettings:CaptionSourceSettings' :: Maybe TeletextSourceSettings
teletextSourceSettings = Maybe TeletextSourceSettings
a} :: CaptionSourceSettings)

-- | Use Source (SourceType) to identify the format of your input captions.
-- The service cannot auto-detect caption format.
captionSourceSettings_sourceType :: Lens.Lens' CaptionSourceSettings (Prelude.Maybe CaptionSourceType)
captionSourceSettings_sourceType :: (Maybe CaptionSourceType -> f (Maybe CaptionSourceType))
-> CaptionSourceSettings -> f CaptionSourceSettings
captionSourceSettings_sourceType = (CaptionSourceSettings -> Maybe CaptionSourceType)
-> (CaptionSourceSettings
    -> Maybe CaptionSourceType -> CaptionSourceSettings)
-> Lens
     CaptionSourceSettings
     CaptionSourceSettings
     (Maybe CaptionSourceType)
     (Maybe CaptionSourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSourceSettings' {Maybe CaptionSourceType
sourceType :: Maybe CaptionSourceType
$sel:sourceType:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe CaptionSourceType
sourceType} -> Maybe CaptionSourceType
sourceType) (\s :: CaptionSourceSettings
s@CaptionSourceSettings' {} Maybe CaptionSourceType
a -> CaptionSourceSettings
s {$sel:sourceType:CaptionSourceSettings' :: Maybe CaptionSourceType
sourceType = Maybe CaptionSourceType
a} :: CaptionSourceSettings)

-- | If your input captions are SCC, SMI, SRT, STL, TTML, WebVTT, or IMSC 1.1
-- in an xml file, specify the URI of the input caption source file. If
-- your caption source is IMSC in an IMF package, use TrackSourceSettings
-- instead of FileSoureSettings.
captionSourceSettings_fileSourceSettings :: Lens.Lens' CaptionSourceSettings (Prelude.Maybe FileSourceSettings)
captionSourceSettings_fileSourceSettings :: (Maybe FileSourceSettings -> f (Maybe FileSourceSettings))
-> CaptionSourceSettings -> f CaptionSourceSettings
captionSourceSettings_fileSourceSettings = (CaptionSourceSettings -> Maybe FileSourceSettings)
-> (CaptionSourceSettings
    -> Maybe FileSourceSettings -> CaptionSourceSettings)
-> Lens
     CaptionSourceSettings
     CaptionSourceSettings
     (Maybe FileSourceSettings)
     (Maybe FileSourceSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSourceSettings' {Maybe FileSourceSettings
fileSourceSettings :: Maybe FileSourceSettings
$sel:fileSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe FileSourceSettings
fileSourceSettings} -> Maybe FileSourceSettings
fileSourceSettings) (\s :: CaptionSourceSettings
s@CaptionSourceSettings' {} Maybe FileSourceSettings
a -> CaptionSourceSettings
s {$sel:fileSourceSettings:CaptionSourceSettings' :: Maybe FileSourceSettings
fileSourceSettings = Maybe FileSourceSettings
a} :: CaptionSourceSettings)

-- | Settings specific to WebVTT sources in HLS alternative rendition group.
-- Specify the properties (renditionGroupId, renditionName or
-- renditionLanguageCode) to identify the unique subtitle track among the
-- alternative rendition groups present in the HLS manifest. If no unique
-- track is found, or multiple tracks match the specified properties, the
-- job fails. If there is only one subtitle track in the rendition group,
-- the settings can be left empty and the default subtitle track will be
-- chosen. If your caption source is a sidecar file, use FileSourceSettings
-- instead of WebvttHlsSourceSettings.
captionSourceSettings_webvttHlsSourceSettings :: Lens.Lens' CaptionSourceSettings (Prelude.Maybe WebvttHlsSourceSettings)
captionSourceSettings_webvttHlsSourceSettings :: (Maybe WebvttHlsSourceSettings
 -> f (Maybe WebvttHlsSourceSettings))
-> CaptionSourceSettings -> f CaptionSourceSettings
captionSourceSettings_webvttHlsSourceSettings = (CaptionSourceSettings -> Maybe WebvttHlsSourceSettings)
-> (CaptionSourceSettings
    -> Maybe WebvttHlsSourceSettings -> CaptionSourceSettings)
-> Lens
     CaptionSourceSettings
     CaptionSourceSettings
     (Maybe WebvttHlsSourceSettings)
     (Maybe WebvttHlsSourceSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSourceSettings' {Maybe WebvttHlsSourceSettings
webvttHlsSourceSettings :: Maybe WebvttHlsSourceSettings
$sel:webvttHlsSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe WebvttHlsSourceSettings
webvttHlsSourceSettings} -> Maybe WebvttHlsSourceSettings
webvttHlsSourceSettings) (\s :: CaptionSourceSettings
s@CaptionSourceSettings' {} Maybe WebvttHlsSourceSettings
a -> CaptionSourceSettings
s {$sel:webvttHlsSourceSettings:CaptionSourceSettings' :: Maybe WebvttHlsSourceSettings
webvttHlsSourceSettings = Maybe WebvttHlsSourceSettings
a} :: CaptionSourceSettings)

-- | DVB Sub Source Settings
captionSourceSettings_dvbSubSourceSettings :: Lens.Lens' CaptionSourceSettings (Prelude.Maybe DvbSubSourceSettings)
captionSourceSettings_dvbSubSourceSettings :: (Maybe DvbSubSourceSettings -> f (Maybe DvbSubSourceSettings))
-> CaptionSourceSettings -> f CaptionSourceSettings
captionSourceSettings_dvbSubSourceSettings = (CaptionSourceSettings -> Maybe DvbSubSourceSettings)
-> (CaptionSourceSettings
    -> Maybe DvbSubSourceSettings -> CaptionSourceSettings)
-> Lens
     CaptionSourceSettings
     CaptionSourceSettings
     (Maybe DvbSubSourceSettings)
     (Maybe DvbSubSourceSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSourceSettings' {Maybe DvbSubSourceSettings
dvbSubSourceSettings :: Maybe DvbSubSourceSettings
$sel:dvbSubSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe DvbSubSourceSettings
dvbSubSourceSettings} -> Maybe DvbSubSourceSettings
dvbSubSourceSettings) (\s :: CaptionSourceSettings
s@CaptionSourceSettings' {} Maybe DvbSubSourceSettings
a -> CaptionSourceSettings
s {$sel:dvbSubSourceSettings:CaptionSourceSettings' :: Maybe DvbSubSourceSettings
dvbSubSourceSettings = Maybe DvbSubSourceSettings
a} :: CaptionSourceSettings)

-- | Settings specific to caption sources that are specified by track number.
-- Currently, this is only IMSC captions in an IMF package. If your caption
-- source is IMSC 1.1 in a separate xml file, use FileSourceSettings
-- instead of TrackSourceSettings.
captionSourceSettings_trackSourceSettings :: Lens.Lens' CaptionSourceSettings (Prelude.Maybe TrackSourceSettings)
captionSourceSettings_trackSourceSettings :: (Maybe TrackSourceSettings -> f (Maybe TrackSourceSettings))
-> CaptionSourceSettings -> f CaptionSourceSettings
captionSourceSettings_trackSourceSettings = (CaptionSourceSettings -> Maybe TrackSourceSettings)
-> (CaptionSourceSettings
    -> Maybe TrackSourceSettings -> CaptionSourceSettings)
-> Lens
     CaptionSourceSettings
     CaptionSourceSettings
     (Maybe TrackSourceSettings)
     (Maybe TrackSourceSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSourceSettings' {Maybe TrackSourceSettings
trackSourceSettings :: Maybe TrackSourceSettings
$sel:trackSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe TrackSourceSettings
trackSourceSettings} -> Maybe TrackSourceSettings
trackSourceSettings) (\s :: CaptionSourceSettings
s@CaptionSourceSettings' {} Maybe TrackSourceSettings
a -> CaptionSourceSettings
s {$sel:trackSourceSettings:CaptionSourceSettings' :: Maybe TrackSourceSettings
trackSourceSettings = Maybe TrackSourceSettings
a} :: CaptionSourceSettings)

-- | Settings for ancillary captions source.
captionSourceSettings_ancillarySourceSettings :: Lens.Lens' CaptionSourceSettings (Prelude.Maybe AncillarySourceSettings)
captionSourceSettings_ancillarySourceSettings :: (Maybe AncillarySourceSettings
 -> f (Maybe AncillarySourceSettings))
-> CaptionSourceSettings -> f CaptionSourceSettings
captionSourceSettings_ancillarySourceSettings = (CaptionSourceSettings -> Maybe AncillarySourceSettings)
-> (CaptionSourceSettings
    -> Maybe AncillarySourceSettings -> CaptionSourceSettings)
-> Lens
     CaptionSourceSettings
     CaptionSourceSettings
     (Maybe AncillarySourceSettings)
     (Maybe AncillarySourceSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSourceSettings' {Maybe AncillarySourceSettings
ancillarySourceSettings :: Maybe AncillarySourceSettings
$sel:ancillarySourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe AncillarySourceSettings
ancillarySourceSettings} -> Maybe AncillarySourceSettings
ancillarySourceSettings) (\s :: CaptionSourceSettings
s@CaptionSourceSettings' {} Maybe AncillarySourceSettings
a -> CaptionSourceSettings
s {$sel:ancillarySourceSettings:CaptionSourceSettings' :: Maybe AncillarySourceSettings
ancillarySourceSettings = Maybe AncillarySourceSettings
a} :: CaptionSourceSettings)

-- | Settings for embedded captions Source
captionSourceSettings_embeddedSourceSettings :: Lens.Lens' CaptionSourceSettings (Prelude.Maybe EmbeddedSourceSettings)
captionSourceSettings_embeddedSourceSettings :: (Maybe EmbeddedSourceSettings -> f (Maybe EmbeddedSourceSettings))
-> CaptionSourceSettings -> f CaptionSourceSettings
captionSourceSettings_embeddedSourceSettings = (CaptionSourceSettings -> Maybe EmbeddedSourceSettings)
-> (CaptionSourceSettings
    -> Maybe EmbeddedSourceSettings -> CaptionSourceSettings)
-> Lens
     CaptionSourceSettings
     CaptionSourceSettings
     (Maybe EmbeddedSourceSettings)
     (Maybe EmbeddedSourceSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaptionSourceSettings' {Maybe EmbeddedSourceSettings
embeddedSourceSettings :: Maybe EmbeddedSourceSettings
$sel:embeddedSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe EmbeddedSourceSettings
embeddedSourceSettings} -> Maybe EmbeddedSourceSettings
embeddedSourceSettings) (\s :: CaptionSourceSettings
s@CaptionSourceSettings' {} Maybe EmbeddedSourceSettings
a -> CaptionSourceSettings
s {$sel:embeddedSourceSettings:CaptionSourceSettings' :: Maybe EmbeddedSourceSettings
embeddedSourceSettings = Maybe EmbeddedSourceSettings
a} :: CaptionSourceSettings)

instance Core.FromJSON CaptionSourceSettings where
  parseJSON :: Value -> Parser CaptionSourceSettings
parseJSON =
    String
-> (Object -> Parser CaptionSourceSettings)
-> Value
-> Parser CaptionSourceSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CaptionSourceSettings"
      ( \Object
x ->
          Maybe TeletextSourceSettings
-> Maybe CaptionSourceType
-> Maybe FileSourceSettings
-> Maybe WebvttHlsSourceSettings
-> Maybe DvbSubSourceSettings
-> Maybe TrackSourceSettings
-> Maybe AncillarySourceSettings
-> Maybe EmbeddedSourceSettings
-> CaptionSourceSettings
CaptionSourceSettings'
            (Maybe TeletextSourceSettings
 -> Maybe CaptionSourceType
 -> Maybe FileSourceSettings
 -> Maybe WebvttHlsSourceSettings
 -> Maybe DvbSubSourceSettings
 -> Maybe TrackSourceSettings
 -> Maybe AncillarySourceSettings
 -> Maybe EmbeddedSourceSettings
 -> CaptionSourceSettings)
-> Parser (Maybe TeletextSourceSettings)
-> Parser
     (Maybe CaptionSourceType
      -> Maybe FileSourceSettings
      -> Maybe WebvttHlsSourceSettings
      -> Maybe DvbSubSourceSettings
      -> Maybe TrackSourceSettings
      -> Maybe AncillarySourceSettings
      -> Maybe EmbeddedSourceSettings
      -> CaptionSourceSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TeletextSourceSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"teletextSourceSettings")
            Parser
  (Maybe CaptionSourceType
   -> Maybe FileSourceSettings
   -> Maybe WebvttHlsSourceSettings
   -> Maybe DvbSubSourceSettings
   -> Maybe TrackSourceSettings
   -> Maybe AncillarySourceSettings
   -> Maybe EmbeddedSourceSettings
   -> CaptionSourceSettings)
-> Parser (Maybe CaptionSourceType)
-> Parser
     (Maybe FileSourceSettings
      -> Maybe WebvttHlsSourceSettings
      -> Maybe DvbSubSourceSettings
      -> Maybe TrackSourceSettings
      -> Maybe AncillarySourceSettings
      -> Maybe EmbeddedSourceSettings
      -> CaptionSourceSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CaptionSourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sourceType")
            Parser
  (Maybe FileSourceSettings
   -> Maybe WebvttHlsSourceSettings
   -> Maybe DvbSubSourceSettings
   -> Maybe TrackSourceSettings
   -> Maybe AncillarySourceSettings
   -> Maybe EmbeddedSourceSettings
   -> CaptionSourceSettings)
-> Parser (Maybe FileSourceSettings)
-> Parser
     (Maybe WebvttHlsSourceSettings
      -> Maybe DvbSubSourceSettings
      -> Maybe TrackSourceSettings
      -> Maybe AncillarySourceSettings
      -> Maybe EmbeddedSourceSettings
      -> CaptionSourceSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FileSourceSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fileSourceSettings")
            Parser
  (Maybe WebvttHlsSourceSettings
   -> Maybe DvbSubSourceSettings
   -> Maybe TrackSourceSettings
   -> Maybe AncillarySourceSettings
   -> Maybe EmbeddedSourceSettings
   -> CaptionSourceSettings)
-> Parser (Maybe WebvttHlsSourceSettings)
-> Parser
     (Maybe DvbSubSourceSettings
      -> Maybe TrackSourceSettings
      -> Maybe AncillarySourceSettings
      -> Maybe EmbeddedSourceSettings
      -> CaptionSourceSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WebvttHlsSourceSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"webvttHlsSourceSettings")
            Parser
  (Maybe DvbSubSourceSettings
   -> Maybe TrackSourceSettings
   -> Maybe AncillarySourceSettings
   -> Maybe EmbeddedSourceSettings
   -> CaptionSourceSettings)
-> Parser (Maybe DvbSubSourceSettings)
-> Parser
     (Maybe TrackSourceSettings
      -> Maybe AncillarySourceSettings
      -> Maybe EmbeddedSourceSettings
      -> CaptionSourceSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DvbSubSourceSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dvbSubSourceSettings")
            Parser
  (Maybe TrackSourceSettings
   -> Maybe AncillarySourceSettings
   -> Maybe EmbeddedSourceSettings
   -> CaptionSourceSettings)
-> Parser (Maybe TrackSourceSettings)
-> Parser
     (Maybe AncillarySourceSettings
      -> Maybe EmbeddedSourceSettings -> CaptionSourceSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TrackSourceSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"trackSourceSettings")
            Parser
  (Maybe AncillarySourceSettings
   -> Maybe EmbeddedSourceSettings -> CaptionSourceSettings)
-> Parser (Maybe AncillarySourceSettings)
-> Parser (Maybe EmbeddedSourceSettings -> CaptionSourceSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AncillarySourceSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ancillarySourceSettings")
            Parser (Maybe EmbeddedSourceSettings -> CaptionSourceSettings)
-> Parser (Maybe EmbeddedSourceSettings)
-> Parser CaptionSourceSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EmbeddedSourceSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"embeddedSourceSettings")
      )

instance Prelude.Hashable CaptionSourceSettings

instance Prelude.NFData CaptionSourceSettings

instance Core.ToJSON CaptionSourceSettings where
  toJSON :: CaptionSourceSettings -> Value
toJSON CaptionSourceSettings' {Maybe AncillarySourceSettings
Maybe CaptionSourceType
Maybe DvbSubSourceSettings
Maybe EmbeddedSourceSettings
Maybe FileSourceSettings
Maybe TeletextSourceSettings
Maybe TrackSourceSettings
Maybe WebvttHlsSourceSettings
embeddedSourceSettings :: Maybe EmbeddedSourceSettings
ancillarySourceSettings :: Maybe AncillarySourceSettings
trackSourceSettings :: Maybe TrackSourceSettings
dvbSubSourceSettings :: Maybe DvbSubSourceSettings
webvttHlsSourceSettings :: Maybe WebvttHlsSourceSettings
fileSourceSettings :: Maybe FileSourceSettings
sourceType :: Maybe CaptionSourceType
teletextSourceSettings :: Maybe TeletextSourceSettings
$sel:embeddedSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe EmbeddedSourceSettings
$sel:ancillarySourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe AncillarySourceSettings
$sel:trackSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe TrackSourceSettings
$sel:dvbSubSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe DvbSubSourceSettings
$sel:webvttHlsSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe WebvttHlsSourceSettings
$sel:fileSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe FileSourceSettings
$sel:sourceType:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe CaptionSourceType
$sel:teletextSourceSettings:CaptionSourceSettings' :: CaptionSourceSettings -> Maybe TeletextSourceSettings
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"teletextSourceSettings" Text -> TeletextSourceSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TeletextSourceSettings -> Pair)
-> Maybe TeletextSourceSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TeletextSourceSettings
teletextSourceSettings,
            (Text
"sourceType" Text -> CaptionSourceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (CaptionSourceType -> Pair)
-> Maybe CaptionSourceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CaptionSourceType
sourceType,
            (Text
"fileSourceSettings" Text -> FileSourceSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (FileSourceSettings -> Pair)
-> Maybe FileSourceSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FileSourceSettings
fileSourceSettings,
            (Text
"webvttHlsSourceSettings" Text -> WebvttHlsSourceSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (WebvttHlsSourceSettings -> Pair)
-> Maybe WebvttHlsSourceSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WebvttHlsSourceSettings
webvttHlsSourceSettings,
            (Text
"dvbSubSourceSettings" Text -> DvbSubSourceSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DvbSubSourceSettings -> Pair)
-> Maybe DvbSubSourceSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DvbSubSourceSettings
dvbSubSourceSettings,
            (Text
"trackSourceSettings" Text -> TrackSourceSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (TrackSourceSettings -> Pair)
-> Maybe TrackSourceSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TrackSourceSettings
trackSourceSettings,
            (Text
"ancillarySourceSettings" Text -> AncillarySourceSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AncillarySourceSettings -> Pair)
-> Maybe AncillarySourceSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AncillarySourceSettings
ancillarySourceSettings,
            (Text
"embeddedSourceSettings" Text -> EmbeddedSourceSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EmbeddedSourceSettings -> Pair)
-> Maybe EmbeddedSourceSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EmbeddedSourceSettings
embeddedSourceSettings
          ]
      )