{-# 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.WebvttDestinationSettings
-- 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.WebvttDestinationSettings 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.WebvttAccessibilitySubs
import Amazonka.MediaConvert.Types.WebvttStylePassthrough
import qualified Amazonka.Prelude as Prelude

-- | Settings related to WebVTT captions. WebVTT 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 WebVTT.
--
-- /See:/ 'newWebvttDestinationSettings' smart constructor.
data WebvttDestinationSettings = WebvttDestinationSettings'
  { -- | 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.
    WebvttDestinationSettings -> Maybe WebvttAccessibilitySubs
accessibility :: Prelude.Maybe WebvttAccessibilitySubs,
    -- | To use the available style, color, and position information from your
    -- input captions: Set Style passthrough (stylePassthrough) to Enabled
    -- (ENABLED). MediaConvert uses default settings when style and position
    -- information is missing from your input captions. To recreate the input
    -- captions exactly: Set Style passthrough to Strict (STRICT). MediaConvert
    -- automatically applies timing adjustments, including adjustments for
    -- frame rate conversion, ad avails, and input clipping. Your input
    -- captions format must be WebVTT. To ignore the style and position
    -- information from your input captions and use simplified output captions:
    -- Set Style passthrough to Disabled (DISABLED), or leave blank.
    WebvttDestinationSettings -> Maybe WebvttStylePassthrough
stylePassthrough :: Prelude.Maybe WebvttStylePassthrough
  }
  deriving (WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
$c/= :: WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
== :: WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
$c== :: WebvttDestinationSettings -> WebvttDestinationSettings -> Bool
Prelude.Eq, ReadPrec [WebvttDestinationSettings]
ReadPrec WebvttDestinationSettings
Int -> ReadS WebvttDestinationSettings
ReadS [WebvttDestinationSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WebvttDestinationSettings]
$creadListPrec :: ReadPrec [WebvttDestinationSettings]
readPrec :: ReadPrec WebvttDestinationSettings
$creadPrec :: ReadPrec WebvttDestinationSettings
readList :: ReadS [WebvttDestinationSettings]
$creadList :: ReadS [WebvttDestinationSettings]
readsPrec :: Int -> ReadS WebvttDestinationSettings
$creadsPrec :: Int -> ReadS WebvttDestinationSettings
Prelude.Read, Int -> WebvttDestinationSettings -> ShowS
[WebvttDestinationSettings] -> ShowS
WebvttDestinationSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WebvttDestinationSettings] -> ShowS
$cshowList :: [WebvttDestinationSettings] -> ShowS
show :: WebvttDestinationSettings -> String
$cshow :: WebvttDestinationSettings -> String
showsPrec :: Int -> WebvttDestinationSettings -> ShowS
$cshowsPrec :: Int -> WebvttDestinationSettings -> ShowS
Prelude.Show, forall x.
Rep WebvttDestinationSettings x -> WebvttDestinationSettings
forall x.
WebvttDestinationSettings -> Rep WebvttDestinationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WebvttDestinationSettings x -> WebvttDestinationSettings
$cfrom :: forall x.
WebvttDestinationSettings -> Rep WebvttDestinationSettings x
Prelude.Generic)

-- |
-- Create a value of 'WebvttDestinationSettings' 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', 'webvttDestinationSettings_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', 'webvttDestinationSettings_stylePassthrough' - To use the available style, color, and position information from your
-- input captions: Set Style passthrough (stylePassthrough) to Enabled
-- (ENABLED). MediaConvert uses default settings when style and position
-- information is missing from your input captions. To recreate the input
-- captions exactly: Set Style passthrough to Strict (STRICT). MediaConvert
-- automatically applies timing adjustments, including adjustments for
-- frame rate conversion, ad avails, and input clipping. Your input
-- captions format must be WebVTT. To ignore the style and position
-- information from your input captions and use simplified output captions:
-- Set Style passthrough to Disabled (DISABLED), or leave blank.
newWebvttDestinationSettings ::
  WebvttDestinationSettings
newWebvttDestinationSettings :: WebvttDestinationSettings
newWebvttDestinationSettings =
  WebvttDestinationSettings'
    { $sel:accessibility:WebvttDestinationSettings' :: Maybe WebvttAccessibilitySubs
accessibility =
        forall a. Maybe a
Prelude.Nothing,
      $sel:stylePassthrough:WebvttDestinationSettings' :: Maybe WebvttStylePassthrough
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.
webvttDestinationSettings_accessibility :: Lens.Lens' WebvttDestinationSettings (Prelude.Maybe WebvttAccessibilitySubs)
webvttDestinationSettings_accessibility :: Lens' WebvttDestinationSettings (Maybe WebvttAccessibilitySubs)
webvttDestinationSettings_accessibility = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebvttDestinationSettings' {Maybe WebvttAccessibilitySubs
accessibility :: Maybe WebvttAccessibilitySubs
$sel:accessibility:WebvttDestinationSettings' :: WebvttDestinationSettings -> Maybe WebvttAccessibilitySubs
accessibility} -> Maybe WebvttAccessibilitySubs
accessibility) (\s :: WebvttDestinationSettings
s@WebvttDestinationSettings' {} Maybe WebvttAccessibilitySubs
a -> WebvttDestinationSettings
s {$sel:accessibility:WebvttDestinationSettings' :: Maybe WebvttAccessibilitySubs
accessibility = Maybe WebvttAccessibilitySubs
a} :: WebvttDestinationSettings)

-- | To use the available style, color, and position information from your
-- input captions: Set Style passthrough (stylePassthrough) to Enabled
-- (ENABLED). MediaConvert uses default settings when style and position
-- information is missing from your input captions. To recreate the input
-- captions exactly: Set Style passthrough to Strict (STRICT). MediaConvert
-- automatically applies timing adjustments, including adjustments for
-- frame rate conversion, ad avails, and input clipping. Your input
-- captions format must be WebVTT. To ignore the style and position
-- information from your input captions and use simplified output captions:
-- Set Style passthrough to Disabled (DISABLED), or leave blank.
webvttDestinationSettings_stylePassthrough :: Lens.Lens' WebvttDestinationSettings (Prelude.Maybe WebvttStylePassthrough)
webvttDestinationSettings_stylePassthrough :: Lens' WebvttDestinationSettings (Maybe WebvttStylePassthrough)
webvttDestinationSettings_stylePassthrough = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebvttDestinationSettings' {Maybe WebvttStylePassthrough
stylePassthrough :: Maybe WebvttStylePassthrough
$sel:stylePassthrough:WebvttDestinationSettings' :: WebvttDestinationSettings -> Maybe WebvttStylePassthrough
stylePassthrough} -> Maybe WebvttStylePassthrough
stylePassthrough) (\s :: WebvttDestinationSettings
s@WebvttDestinationSettings' {} Maybe WebvttStylePassthrough
a -> WebvttDestinationSettings
s {$sel:stylePassthrough:WebvttDestinationSettings' :: Maybe WebvttStylePassthrough
stylePassthrough = Maybe WebvttStylePassthrough
a} :: WebvttDestinationSettings)

instance Data.FromJSON WebvttDestinationSettings where
  parseJSON :: Value -> Parser WebvttDestinationSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WebvttDestinationSettings"
      ( \Object
x ->
          Maybe WebvttAccessibilitySubs
-> Maybe WebvttStylePassthrough -> WebvttDestinationSettings
WebvttDestinationSettings'
            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 WebvttDestinationSettings where
  hashWithSalt :: Int -> WebvttDestinationSettings -> Int
hashWithSalt Int
_salt WebvttDestinationSettings' {Maybe WebvttAccessibilitySubs
Maybe WebvttStylePassthrough
stylePassthrough :: Maybe WebvttStylePassthrough
accessibility :: Maybe WebvttAccessibilitySubs
$sel:stylePassthrough:WebvttDestinationSettings' :: WebvttDestinationSettings -> Maybe WebvttStylePassthrough
$sel:accessibility:WebvttDestinationSettings' :: WebvttDestinationSettings -> Maybe WebvttAccessibilitySubs
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WebvttAccessibilitySubs
accessibility
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WebvttStylePassthrough
stylePassthrough

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

instance Data.ToJSON WebvttDestinationSettings where
  toJSON :: WebvttDestinationSettings -> Value
toJSON WebvttDestinationSettings' {Maybe WebvttAccessibilitySubs
Maybe WebvttStylePassthrough
stylePassthrough :: Maybe WebvttStylePassthrough
accessibility :: Maybe WebvttAccessibilitySubs
$sel:stylePassthrough:WebvttDestinationSettings' :: WebvttDestinationSettings -> Maybe WebvttStylePassthrough
$sel:accessibility:WebvttDestinationSettings' :: WebvttDestinationSettings -> Maybe WebvttAccessibilitySubs
..} =
    [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 WebvttAccessibilitySubs
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 WebvttStylePassthrough
stylePassthrough
          ]
      )