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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.ImscStylePassthrough
import qualified Amazonka.Prelude as Prelude

-- | Settings related to IMSC captions. IMSC is a sidecar format that holds
-- captions in a file that is separate from the video container. Set up
-- sidecar captions in the same output group, but different output from
-- your video. For more information, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/ttml-and-webvtt-output-captions.html.
-- When you work directly in your JSON job specification, include this
-- object and any required children when you set destinationType to IMSC.
--
-- /See:/ 'newImscDestinationSettings' smart constructor.
data ImscDestinationSettings = ImscDestinationSettings'
  { -- | Keep this setting enabled to have MediaConvert use the font style and
    -- position information from the captions source in the output. This option
    -- is available only when your input captions are IMSC, SMPTE-TT, or TTML.
    -- Disable this setting for simplified output captions.
    ImscDestinationSettings -> Maybe ImscStylePassthrough
stylePassthrough :: Prelude.Maybe ImscStylePassthrough
  }
  deriving (ImscDestinationSettings -> ImscDestinationSettings -> Bool
(ImscDestinationSettings -> ImscDestinationSettings -> Bool)
-> (ImscDestinationSettings -> ImscDestinationSettings -> Bool)
-> Eq ImscDestinationSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImscDestinationSettings -> ImscDestinationSettings -> Bool
$c/= :: ImscDestinationSettings -> ImscDestinationSettings -> Bool
== :: ImscDestinationSettings -> ImscDestinationSettings -> Bool
$c== :: ImscDestinationSettings -> ImscDestinationSettings -> Bool
Prelude.Eq, ReadPrec [ImscDestinationSettings]
ReadPrec ImscDestinationSettings
Int -> ReadS ImscDestinationSettings
ReadS [ImscDestinationSettings]
(Int -> ReadS ImscDestinationSettings)
-> ReadS [ImscDestinationSettings]
-> ReadPrec ImscDestinationSettings
-> ReadPrec [ImscDestinationSettings]
-> Read ImscDestinationSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImscDestinationSettings]
$creadListPrec :: ReadPrec [ImscDestinationSettings]
readPrec :: ReadPrec ImscDestinationSettings
$creadPrec :: ReadPrec ImscDestinationSettings
readList :: ReadS [ImscDestinationSettings]
$creadList :: ReadS [ImscDestinationSettings]
readsPrec :: Int -> ReadS ImscDestinationSettings
$creadsPrec :: Int -> ReadS ImscDestinationSettings
Prelude.Read, Int -> ImscDestinationSettings -> ShowS
[ImscDestinationSettings] -> ShowS
ImscDestinationSettings -> String
(Int -> ImscDestinationSettings -> ShowS)
-> (ImscDestinationSettings -> String)
-> ([ImscDestinationSettings] -> ShowS)
-> Show ImscDestinationSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImscDestinationSettings] -> ShowS
$cshowList :: [ImscDestinationSettings] -> ShowS
show :: ImscDestinationSettings -> String
$cshow :: ImscDestinationSettings -> String
showsPrec :: Int -> ImscDestinationSettings -> ShowS
$cshowsPrec :: Int -> ImscDestinationSettings -> ShowS
Prelude.Show, (forall x.
 ImscDestinationSettings -> Rep ImscDestinationSettings x)
-> (forall x.
    Rep ImscDestinationSettings x -> ImscDestinationSettings)
-> Generic ImscDestinationSettings
forall x. Rep ImscDestinationSettings x -> ImscDestinationSettings
forall x. ImscDestinationSettings -> Rep ImscDestinationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImscDestinationSettings x -> ImscDestinationSettings
$cfrom :: forall x. ImscDestinationSettings -> Rep ImscDestinationSettings x
Prelude.Generic)

-- |
-- Create a value of 'ImscDestinationSettings' 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:
--
-- 'stylePassthrough', 'imscDestinationSettings_stylePassthrough' - Keep this setting enabled to have MediaConvert use the font style and
-- position information from the captions source in the output. This option
-- is available only when your input captions are IMSC, SMPTE-TT, or TTML.
-- Disable this setting for simplified output captions.
newImscDestinationSettings ::
  ImscDestinationSettings
newImscDestinationSettings :: ImscDestinationSettings
newImscDestinationSettings =
  ImscDestinationSettings' :: Maybe ImscStylePassthrough -> ImscDestinationSettings
ImscDestinationSettings'
    { $sel:stylePassthrough:ImscDestinationSettings' :: Maybe ImscStylePassthrough
stylePassthrough =
        Maybe ImscStylePassthrough
forall a. Maybe a
Prelude.Nothing
    }

-- | Keep this setting enabled to have MediaConvert use the font style and
-- position information from the captions source in the output. This option
-- is available only when your input captions are IMSC, SMPTE-TT, or TTML.
-- Disable this setting for simplified output captions.
imscDestinationSettings_stylePassthrough :: Lens.Lens' ImscDestinationSettings (Prelude.Maybe ImscStylePassthrough)
imscDestinationSettings_stylePassthrough :: (Maybe ImscStylePassthrough -> f (Maybe ImscStylePassthrough))
-> ImscDestinationSettings -> f ImscDestinationSettings
imscDestinationSettings_stylePassthrough = (ImscDestinationSettings -> Maybe ImscStylePassthrough)
-> (ImscDestinationSettings
    -> Maybe ImscStylePassthrough -> ImscDestinationSettings)
-> Lens
     ImscDestinationSettings
     ImscDestinationSettings
     (Maybe ImscStylePassthrough)
     (Maybe ImscStylePassthrough)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImscDestinationSettings' {Maybe ImscStylePassthrough
stylePassthrough :: Maybe ImscStylePassthrough
$sel:stylePassthrough:ImscDestinationSettings' :: ImscDestinationSettings -> Maybe ImscStylePassthrough
stylePassthrough} -> Maybe ImscStylePassthrough
stylePassthrough) (\s :: ImscDestinationSettings
s@ImscDestinationSettings' {} Maybe ImscStylePassthrough
a -> ImscDestinationSettings
s {$sel:stylePassthrough:ImscDestinationSettings' :: Maybe ImscStylePassthrough
stylePassthrough = Maybe ImscStylePassthrough
a} :: ImscDestinationSettings)

instance Core.FromJSON ImscDestinationSettings where
  parseJSON :: Value -> Parser ImscDestinationSettings
parseJSON =
    String
-> (Object -> Parser ImscDestinationSettings)
-> Value
-> Parser ImscDestinationSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ImscDestinationSettings"
      ( \Object
x ->
          Maybe ImscStylePassthrough -> ImscDestinationSettings
ImscDestinationSettings'
            (Maybe ImscStylePassthrough -> ImscDestinationSettings)
-> Parser (Maybe ImscStylePassthrough)
-> Parser ImscDestinationSettings
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ImscStylePassthrough)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"stylePassthrough")
      )

instance Prelude.Hashable ImscDestinationSettings

instance Prelude.NFData ImscDestinationSettings

instance Core.ToJSON ImscDestinationSettings where
  toJSON :: ImscDestinationSettings -> Value
toJSON ImscDestinationSettings' {Maybe ImscStylePassthrough
stylePassthrough :: Maybe ImscStylePassthrough
$sel:stylePassthrough:ImscDestinationSettings' :: ImscDestinationSettings -> Maybe ImscStylePassthrough
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"stylePassthrough" Text -> ImscStylePassthrough -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ImscStylePassthrough -> Pair)
-> Maybe ImscStylePassthrough -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ImscStylePassthrough
stylePassthrough
          ]
      )