{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.ImscDestinationSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types.ImscAccessibilitySubs
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'
  { -- | Set Accessibility subtitles to Enabled if the ISMC or WebVTT captions
    -- track is intended to provide accessibility for people who are deaf or
    -- hard of hearing. When you enable this feature, MediaConvert adds the
    -- following attributes under EXT-X-MEDIA in the HLS or CMAF manifest for
    -- this track:
    -- CHARACTERISTICS=\"public.accessibility.describes-spoken-dialog,public.accessibility.describes-music-and-sound\"
    -- and AUTOSELECT=\"YES\". Keep the default value, Disabled, if the
    -- captions track is not intended to provide such accessibility.
    -- MediaConvert will not add the above attributes.
    ImscDestinationSettings -> Maybe ImscAccessibilitySubs
accessibility :: Prelude.Maybe ImscAccessibilitySubs,
    -- | 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
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]
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
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. 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:
--
-- 'accessibility', 'imscDestinationSettings_accessibility' - Set Accessibility subtitles to Enabled if the ISMC or WebVTT captions
-- track is intended to provide accessibility for people who are deaf or
-- hard of hearing. When you enable this feature, MediaConvert adds the
-- following attributes under EXT-X-MEDIA in the HLS or CMAF manifest for
-- this track:
-- CHARACTERISTICS=\"public.accessibility.describes-spoken-dialog,public.accessibility.describes-music-and-sound\"
-- and AUTOSELECT=\"YES\". Keep the default value, Disabled, if the
-- captions track is not intended to provide such accessibility.
-- MediaConvert will not add the above attributes.
--
-- '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'
    { $sel:accessibility:ImscDestinationSettings' :: Maybe ImscAccessibilitySubs
accessibility =
        forall a. Maybe a
Prelude.Nothing,
      $sel:stylePassthrough:ImscDestinationSettings' :: Maybe ImscStylePassthrough
stylePassthrough = forall a. Maybe a
Prelude.Nothing
    }

-- | Set Accessibility subtitles to Enabled if the ISMC or WebVTT captions
-- track is intended to provide accessibility for people who are deaf or
-- hard of hearing. When you enable this feature, MediaConvert adds the
-- following attributes under EXT-X-MEDIA in the HLS or CMAF manifest for
-- this track:
-- CHARACTERISTICS=\"public.accessibility.describes-spoken-dialog,public.accessibility.describes-music-and-sound\"
-- and AUTOSELECT=\"YES\". Keep the default value, Disabled, if the
-- captions track is not intended to provide such accessibility.
-- MediaConvert will not add the above attributes.
imscDestinationSettings_accessibility :: Lens.Lens' ImscDestinationSettings (Prelude.Maybe ImscAccessibilitySubs)
imscDestinationSettings_accessibility :: Lens' ImscDestinationSettings (Maybe ImscAccessibilitySubs)
imscDestinationSettings_accessibility = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImscDestinationSettings' {Maybe ImscAccessibilitySubs
accessibility :: Maybe ImscAccessibilitySubs
$sel:accessibility:ImscDestinationSettings' :: ImscDestinationSettings -> Maybe ImscAccessibilitySubs
accessibility} -> Maybe ImscAccessibilitySubs
accessibility) (\s :: ImscDestinationSettings
s@ImscDestinationSettings' {} Maybe ImscAccessibilitySubs
a -> ImscDestinationSettings
s {$sel:accessibility:ImscDestinationSettings' :: Maybe ImscAccessibilitySubs
accessibility = Maybe ImscAccessibilitySubs
a} :: 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_stylePassthrough :: Lens.Lens' ImscDestinationSettings (Prelude.Maybe ImscStylePassthrough)
imscDestinationSettings_stylePassthrough :: Lens' ImscDestinationSettings (Maybe ImscStylePassthrough)
imscDestinationSettings_stylePassthrough = 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 Data.FromJSON ImscDestinationSettings where
  parseJSON :: Value -> Parser ImscDestinationSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ImscDestinationSettings"
      ( \Object
x ->
          Maybe ImscAccessibilitySubs
-> Maybe ImscStylePassthrough -> ImscDestinationSettings
ImscDestinationSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"accessibility")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"stylePassthrough")
      )

instance Prelude.Hashable ImscDestinationSettings where
  hashWithSalt :: Int -> ImscDestinationSettings -> Int
hashWithSalt Int
_salt ImscDestinationSettings' {Maybe ImscAccessibilitySubs
Maybe ImscStylePassthrough
stylePassthrough :: Maybe ImscStylePassthrough
accessibility :: Maybe ImscAccessibilitySubs
$sel:stylePassthrough:ImscDestinationSettings' :: ImscDestinationSettings -> Maybe ImscStylePassthrough
$sel:accessibility:ImscDestinationSettings' :: ImscDestinationSettings -> Maybe ImscAccessibilitySubs
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ImscAccessibilitySubs
accessibility
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ImscStylePassthrough
stylePassthrough

instance Prelude.NFData ImscDestinationSettings where
  rnf :: ImscDestinationSettings -> ()
rnf ImscDestinationSettings' {Maybe ImscAccessibilitySubs
Maybe ImscStylePassthrough
stylePassthrough :: Maybe ImscStylePassthrough
accessibility :: Maybe ImscAccessibilitySubs
$sel:stylePassthrough:ImscDestinationSettings' :: ImscDestinationSettings -> Maybe ImscStylePassthrough
$sel:accessibility:ImscDestinationSettings' :: ImscDestinationSettings -> Maybe ImscAccessibilitySubs
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ImscAccessibilitySubs
accessibility
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ImscStylePassthrough
stylePassthrough

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